Support Questions

Find answers, ask questions, and share your expertise

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

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

View solution in original post

6 REPLIES 6

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.

@Andrew Grande

Thank you! No symlinks allowed at corporate level.

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

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”

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.

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.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.