Commit 4da70f52 by Max Rothman

Merge pull request #2221 from edx/max/mongo-logrotate

Rotate mongo logs
parents 572835c8 91418ec6
mongo_logappend: true
#This way, when mongod receives a SIGUSR1, it'll close and reopen its log file handle
mongo_logrotate: reopen
mongo_version: 3.0.4
mongo_port: "27017"
mongo_extra_conf: ''
......
......@@ -94,6 +94,9 @@
template: src=mongodb-standalone.conf.j2 dest=/etc/mongod.conf backup=yes
notify: restart mongo
- name: install logrotate configuration
template: src=mongo_logrotate.j2 dest=/etc/logrotate.d/hourly/mongo
- name: start mongo service
service: name=mongod state=started
......
{{ mongo_log_dir }}/* {
create
compress
copytruncate
delaycompress
dateext
dateformat -%Y%m%d-%s
missingok
notifempty
daily
rotate 90
size 1M
postrotate
/usr/bin/killall -USR1 mongod
endscript
}
......@@ -24,6 +24,7 @@ systemLog:
{% else %}
logAppend: false
{% endif %}
logRotate: {{ mongo_logrotate }}
net:
{% if MONGO_CLUSTERED is not defined %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment