MongoDB's log growth is fast,/Var space is immediately full, even if you change to another disk partition to save the log, the log is growing fast, the disk to see the chime.
A good way to do this is to use a rotational log.
MongoDB rotation Log a bit strange, the Linux mongd service accepts a KILL-SGIUSR1 command immediately renames the current log file to a file with a date, and then creates a new log file.
You can configure a rotation policy if you do not want a general rotation log. However, after testing, sending the command will not affect MongoDB's service.
Here is an example of finding the process ID and then sending the command.
[Email protected]:/etc/init.d# ps-def | grep mongodmongodb 723 1 May04? 6-22:23:53/usr/bin/mongod--config/etc/mongodb.confroot 22035 22012 0 20:22 pts/2 00:00:00 grep--color= Auto Mongod[email protected]:/etc/init.d# kill-sigusr1 723[email protected]:/etc/init.d# cd/home/mongodb/log/[email protected]:/home/mongodb/log# lsmongodb.log Mongodb.log.2014-05-18t12-23-51[email protected]:/home/mongodb/ log# ls-alhtotal 20Gdrwxrwxrwx 2 root root 4.0K may 20:23. drwxrwxrwx 4 root root 4.0K Apr 20 21:25. .-rw-r--r--1 MongoDB nogroup 34K 20:24 mongodb.log-rwxrwxrwx 1 mongodb nogroup 20G may 20:23 MongoDB. Log.2014-05-18t12-23-51
Official documents:
http://docs.mongodb.org/manual/tutorial/rotate-log-files/
You can now move or delete the log files for the previous 20G.
You can also make a regular script on your own and send commands to the Mongod service regularly.