How to clear Ranger Admin access logs

Starting with version 7.1.7sp1, you can set the max number of days to retain access logs in the Ranger Admin Web UI.

Ranger admin access log files accrue in the following path: /var/log/ranger/admin/access_log.yyyy-mm-dd.log. By default, these files aren't removed which consumes free space in the /var/ directory. You can set a maximum number of days for which these files are retained, after which they are deleted. To do so, you must add a configuration property to the ranger-admin-site.xml file.
  1. In Cloudera Manager Home, select Ranger, then choose Configuration.
  2. On Configuration, in Search, type ranger-admin.
  3. In conf/ranger-admin-site.xml_role_safety_valve, click + (Add).
  4. Add a key-value pair that configures the maximum number of days to retain Ranger Admin access log files.



    any suitable number of days

    To retain Ranger Admin access log files for 90 days, in the Value field, type 90

  5. Click Save Changes.

    After saving changes, the Stale Configuration icon appears on the Cloudera Manager UI. Optionally, click Stale Configuration to view details.

  6. Select Actions > Restart.