XenServer Log Cleanup
I believe many people are filled with disk space by XenServer log, causing the problem that the machine finally hangs up, I met 2 times (once the pool master hung up, No. 200 people can not work 1 hours). It's a headache.
The server used a long time, XenServer generated a lot of logs, and even some people because the log filled up with space,
Causing system problems: XAPI crashes, or the system dies, and the reboot is invalid.
So we have to see whether the log occupies the space, clean up the log
First view the system disk usage (xenserver default is 4G system space)
[Root@xenserver-shptahqk log]#
Df-hal
FileSystem Size Used Avail use% mounted on
/DEV/SDA1 4.0G 4.0G 0G 100%/
None 0 0 0-//proc
None 0 0 0-/sys
............
You can see that the/dev/sda1 space is full, in the system with a lot of directories, maybe a directory occupies a lot of space, then we can find out, clean up
List what directories are in the system first
CD/
Ls
Bin Dev Home media opt root srv usr
Boot etc lib mnt proc Sbin sys var
Cli-rt EULA lost+found myiso read_me_first.html selinux tmp
You can see a lot of directories, where we can look at the size of each directory individually
Du-hcs var
2G var
2G Total
Can see var this directory takes up the system look Oh you're 2G, then we're switching to this directory to see if it's the root directory that takes up space
Cd/var
Ls
Cache DB Games local log NIS patch run swap XAPI YP
Crash empty Lib lock mail opt preserve spool tmp Xen
Log directory Right here: Log, check it out.
Du-hcs Log
1.9G Log
1.9G Total
See the OG directory occupies the largest space, this is the log directory we can delete the following files
CD Log
Ls
Then we can delete all the following files, you are afraid of the operation of the error, you delete
RM-RF file name
Restart the System log service after deletion
Service Syslog Restart
If the above reboot or invalid, you need to restart the next XAPI
Service XAPI Restart
Thank you for reading, I hope to help you, thank you for your support for this site!