Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
4da70f52
Commit
4da70f52
authored
Aug 19, 2015
by
Max Rothman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2221 from edx/max/mongo-logrotate
Rotate mongo logs
parents
572835c8
91418ec6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
0 deletions
+24
-0
playbooks/roles/mongo_3_0/defaults/main.yml
+4
-0
playbooks/roles/mongo_3_0/tasks/main.yml
+3
-0
playbooks/roles/mongo_3_0/templates/mongo_logrotate.j2
+16
-0
playbooks/roles/mongo_3_0/templates/mongodb-standalone.conf.j2
+1
-0
No files found.
playbooks/roles/mongo_3_0/defaults/main.yml
View file @
4da70f52
mongo_logappend
:
true
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_version
:
3.0.4
mongo_port
:
"
27017"
mongo_port
:
"
27017"
mongo_extra_conf
:
'
'
mongo_extra_conf
:
'
'
...
...
playbooks/roles/mongo_3_0/tasks/main.yml
View file @
4da70f52
...
@@ -94,6 +94,9 @@
...
@@ -94,6 +94,9 @@
template
:
src=mongodb-standalone.conf.j2 dest=/etc/mongod.conf backup=yes
template
:
src=mongodb-standalone.conf.j2 dest=/etc/mongod.conf backup=yes
notify
:
restart mongo
notify
:
restart mongo
-
name
:
install logrotate configuration
template
:
src=mongo_logrotate.j2 dest=/etc/logrotate.d/hourly/mongo
-
name
:
start mongo service
-
name
:
start mongo service
service
:
name=mongod state=started
service
:
name=mongod state=started
...
...
playbooks/roles/mongo_3_0/templates/mongo_logrotate.j2
0 → 100644
View file @
4da70f52
{{ 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
}
playbooks/roles/mongo_3_0/templates/mongodb-standalone.conf.j2
View file @
4da70f52
...
@@ -24,6 +24,7 @@ systemLog:
...
@@ -24,6 +24,7 @@ systemLog:
{% else %}
{% else %}
logAppend: false
logAppend: false
{% endif %}
{% endif %}
logRotate: {{ mongo_logrotate }}
net:
net:
{% if MONGO_CLUSTERED is not defined %}
{% if MONGO_CLUSTERED is not defined %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment