Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Log file location - Is there a way to change /var/log location to /var/log/hdp during the install ?

Solved Go to solution

Log file location - Is there a way to change /var/log location to /var/log/hdp during the install ?

Log file location - Is there a way to change /var/log location to /var/log/hdp during the install ?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Log file location - Is there a way to change /var/log location to /var/log/hdp during the install ?

Guru

The best time to change log directories is at installation where each of the different components will expose their log directory prefix. This is where you can choose an alternate log directory prefix for which all component-specific logs will be created under.log-dir-prefix.png

6 REPLIES 6

Re: Log file location - Is there a way to change /var/log location to /var/log/hdp during the install ?

There's no single point where this change can be made. The reason is many components in the HDP stack will have their own log locations all set to /var/log.

The good news is most of the components already create a subdir for their logs under /var/log.

You could try symlinking /var/log/<component> to /var/log/hdp/<component> post-install, but the downside is having to apply the change on every node and deviating from defaults.

Re: Log file location - Is there a way to change /var/log location to /var/log/hdp during the install ?

@Andrew Grande

Thank you! No symlinks allowed at corporate level.

Re: Log file location - Is there a way to change /var/log location to /var/log/hdp during the install ?

Guru

The best time to change log directories is at installation where each of the different components will expose their log directory prefix. This is where you can choose an alternate log directory prefix for which all component-specific logs will be created under.log-dir-prefix.png

Re: Log file location - Is there a way to change /var/log location to /var/log/hdp during the install ?

If you've missed a folder at install time, you can use the API to amend it post-install, First, you will need to stop the service. You can then use the configs.sh script to easily modify it.

configs.sh is located in /var/lib/ambari-server/resources/scripts on your ambari server

If you would like to change the zookeeper log dir.

./configs.sh set localhost <clustername> zookeeper-env zk_log_dir “/my/new/zookeeper/log/directory”

Highlighted

Re: Log file location - Is there a way to change /var/log location to /var/log/hdp during the install ?

I used:

grep '/var/log' /var/lib/ambari-agent/cache/cluster_configuration/* 

to identify all locations that need to be changed then Ambari/configs.sh to make the adjustments.

Re: Log file location - Is there a way to change /var/log location to /var/log/hdp during the install ?

Cloudera Employee

It's simple to change it with ambari UI. Otherwise use the ambari configs.sh script and restart all the services. It's smooth and easy.

Don't have an account?
Coming from Hortonworks? Activate your account here