Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Not able to change log directories for Ranger Admin and Ranger usersync

avatar

While Ambari UI provides feature to change log directories from UI, but it still is not being taken by Ranger. Looks like Ranger is overriding what I am setting in Ambari.

1 ACCEPTED SOLUTION

avatar

Got the solution after working with support. This is BUG in current Ambari and HDP versions.

https://hortonworks.jira.com/browse/BUG-38390

Below is workaround:

Change Log directory for Ranger Admin logs

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

 
mkdir /opt/hadoop/log/ranger/admin 
chmod 775 /opt/hadoop/log/ranger/admin 
chown ranger_qa:ranger_qa_grp /opt/hadoop/log/ranger/admin 
cd /usr/hdp/current/ranger-admin/ews 
unlink logs
ln -s /opt/hadoop/log/ranger/admin logs 

From Ambari Web UI --> Change Log directory for Ranger Admin and restart Ranger.

Note: here ranger_qa and ranger_qa_grp are ranger user and group respectively which are customized in my case.

Change log directory for USERSYNC LOGS

On Ranger Usersync node:

mkdir /opt/hadoop/log/ranger/usersync 

chmod 775 /opt/hadoop/log/ranger/usersync 

chown ranger_qa:ranger_qa_grp /opt/hadoop/log/ranger/usersync

Note: here ranger_qa and ranger_qa_grp are ranger user and group respectively which are customized in my case.

1. Make a back of file /usr/hdp/current/ranger-usersync/ranger-usersync-services.sh

2. Change the file to the path to your new log location.

logdir=/var/log/ranger/usersync

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

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

vi ranger-usersync-services.sh
    #logdir=/var/log/ranger/usersync          
     logdir=/opt/hadoop/log/ranger/usersync

From Ambari Web UI --> Change Log directory for Ranger Usersync and restart Ranger

View solution in original post

1 REPLY 1

avatar

Got the solution after working with support. This is BUG in current Ambari and HDP versions.

https://hortonworks.jira.com/browse/BUG-38390

Below is workaround:

Change Log directory for Ranger Admin logs

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

 
mkdir /opt/hadoop/log/ranger/admin 
chmod 775 /opt/hadoop/log/ranger/admin 
chown ranger_qa:ranger_qa_grp /opt/hadoop/log/ranger/admin 
cd /usr/hdp/current/ranger-admin/ews 
unlink logs
ln -s /opt/hadoop/log/ranger/admin logs 

From Ambari Web UI --> Change Log directory for Ranger Admin and restart Ranger.

Note: here ranger_qa and ranger_qa_grp are ranger user and group respectively which are customized in my case.

Change log directory for USERSYNC LOGS

On Ranger Usersync node:

mkdir /opt/hadoop/log/ranger/usersync 

chmod 775 /opt/hadoop/log/ranger/usersync 

chown ranger_qa:ranger_qa_grp /opt/hadoop/log/ranger/usersync

Note: here ranger_qa and ranger_qa_grp are ranger user and group respectively which are customized in my case.

1. Make a back of file /usr/hdp/current/ranger-usersync/ranger-usersync-services.sh

2. Change the file to the path to your new log location.

logdir=/var/log/ranger/usersync

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

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

vi ranger-usersync-services.sh
    #logdir=/var/log/ranger/usersync          
     logdir=/opt/hadoop/log/ranger/usersync

From Ambari Web UI --> Change Log directory for Ranger Usersync and restart Ranger