Encounter a problem, because the default is to install CDH System/var/log directory, because it is a virtual instance, the system disk smaller only 50G, is the use of the system cm will be alerted to the alarm log directory space is not enough, if the script is deleted periodically, although it can solve the current problem, but not a good way. The other is to directly modify the configuration file, all the/var/log/* manually changed to/home/var/log/* and then restarted, but this feeling is very much, manually change the trouble.
Then try to link this directory to another large disk attached to the mount.
The goal is to link the/var/log to/home/var/log so that the log will be written to/home/var/log (my home directory is mounted on a large hard drive) directory without taking up the system disk space.
Build the/home/var/log and execute the following command:
Ln-s /home/var/log/var/
will report the following error,
ln:creating Symbolic Link '/var/log ': File exists
Because it is the log directory, so there are no important files, directly remove/var/log, CDH will re-build these log files.
Re-execute
Ln-s/home/var/log/var/
Also modify the permissions of the next/home/var/log to avoid permissions issues
I am only operating in the test environment.
If it is an online environment, consider carefully whether there are other important files in the/var/log, and whether other processes will be affected.