Community Articles
Find and share helpful community-sourced technical articles

Change Log directory for Ranger Admin logs

On Ranger Admin nodes: ADMIN LOGS (Change the symbolic link for in ews directory):

mkdir /opt/ranger/admin

chmod -R 775/opt/ranger/admin

chown -R ranger:ranger /opt/ranger/admin

cd /usr/hdp/current/ranger-admin/ews

unlink log

ln -s /opt/ranger/admin logs

Change log directory for USERSYNC LOGS

On Ranger Usersync node:

mkdir /opt/ranger/usersync

chmod -R 775/opt/ranger/usersync

chown -R ranger:ranger /opt/ranger/usersync

cd /usr/hdp/current/ranger-usersync/

unlink logs

ln -s /opt/ranger/usersync logs

cd /usr/hdp/current/ranger-usersync/

cp ranger-usersync-services.sh{,.backup01122015}

vim ranger-usersync-services.sh

	#logdir=/var/log/ranger/usersync (If it is present)

	logdir=/opt/ranger/usersync

Change log directory for TAGSYNC LOGS:

On Ranger Tagsync nodes:

mkdir /opt/ranger/tagsync

chmod -R 775/opt/ranger/tagsync

chown -R ranger:ranger /opt/ranger/tagsync

cd /usr/hdp/current/ranger-tagsync/

unlink logs

ln -s /opt/ranger/tagsync logs

cp ranger-tagsync-services.sh{,.backup01122015}

vim ranger-tagsync-services.sh

	#logdir=/var/log/ranger/tagsync

	logdir=/opt/ranger/tagsync

From Ambari Web UI --> Change Log directory for Ranger Usersync, Ranger Admin and Ranger Tagsync, Restart Ranger Service.

Note: If you are not able to change the directories in Ambari UI use below mathod for this,

  1. Go to Ranger Service -> Configs -> Advanced -> Advanced ”Advanced ranger-env”.
  2. Right click on the value of property “ranger_admin_log_dir” -> Inspect element -> Change the value in element section(in my case value=”/opt/ranger/admin”)-> Hit Enter.

Screen Shot 2017-06-12 at 8.00.03 PM.png

3. In the same tab Right click on the value of property “ranger_usersync_log_dir” -> Inspect element -> Change the value in element section(in my case value=”/opt/ranger/usersync”)-> Hit Enter.

Screen Shot 2017-06-12 at 8.00.52 PM.png

4. Go to ”Advanced ranger-tagsync-site” -> Right click on the value of property “ranger_tagsync_logdir” -> Inspect element -> Change the value in element section(in my case value=”/opt/ranger/tagsync”)-> Hit Enter.

Screen Shot 2017-06-12 at 8.01.45 PM.png

5. Click on save changes and restart the Ranger Whole service and check at the backend in those directories(In my case it is in /opt/ranger/ directory).

2,007 Views
Comments
New Contributor

Thanks NShelke.

Explorer

@nshelk, to modify a config, configs.sh utility mentioned in Modify configurations can be used. Update the read-only config and restart services/components to have the config take effect.