In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
# cut out the contents of the log itself and automatically generate new date-generated history files: method 1: mongod-v-- logpath / var/log/mongodb/mongos.log method 2: kill-SIGUSR1 {pid} method 3: use admindb.runCommand ("logRotate") # two kinds of delete the old log file, keep the log file find / var/log/mongodb/mongos.log.*-mtime + 7-exec rm-rf {}\ Find / var/log/mongodb/mongos.log.*-mtime + 7-delete method 4: vim / etc/logrotate.d/mongodb/mongod/config.log {daily # every day rotate 7 # rotation 7 days compress # compress missingok through gzip # ignore this warning notifempty if the log does not exist # do not rollover sharedscripts if the file is empty # script copytruncate that runs only once for the entire log group # for log files that are still open Back up the current log and truncate dateext # use date as the naming format size 200m # log files are saved when they reach the specified size, you can specify K Mpostrotate / bin/kill-SIGUSR1 'cat / mongod/mongod.lock 2 > / dev/null' 2 > / dev/null | | trueendscript # end script} # make the above statement take effect immediately. Logrotate mongodb# script implements automatic log cutting vim / rootDB cutout mongodblog log.shelled logs automatically. 'cat $datafile/mongod.lock'find $logfile/-mtime + $days-deletechmod + x / root/cut_mongodb_log.shvim / etc/crontab0 0 * / root/cut_mongodb_log.shservice crond restartchkconfig crond on
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.