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
c0ab7c92
Commit
c0ab7c92
authored
9 years ago
by
Max Rothman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2228 from edx/max/mongo-serverstatus
Switch to using db.serverStatus instead of mongostat
parents
4da70f52
b454a942
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
9 deletions
+11
-9
playbooks/roles/mongo_3_0/defaults/main.yml
+1
-1
playbooks/roles/mongo_3_0/tasks/main.yml
+7
-7
playbooks/roles/mongo_3_0/templates/log-mongo-serverStatus.sh.j2
+3
-0
playbooks/roles/mongo_3_0/templates/log-mongostat.sh.j2
+0
-1
No files found.
playbooks/roles/mongo_3_0/defaults/main.yml
View file @
c0ab7c92
...
...
@@ -77,4 +77,4 @@ MONGO_S3_S3CMD_CONFIG: "{{ COMMON_DATA_DIR }}/mongo-s3-backup.s3cfg"
MONGO_S3_BACKUP_AWS_ACCESS_KEY
:
!!null
MONGO_S3_BACKUP_AWS_SECRET_KEY
:
!!null
MONGO_LOG_
MONGOSTAT
:
true
MONGO_LOG_
SERVERSTATUS
:
true
This diff is collapsed.
Click to expand it.
playbooks/roles/mongo_3_0/tasks/main.yml
View file @
c0ab7c92
...
...
@@ -57,21 +57,21 @@
-
"
{{
mongo_log_dir
}}"
-
"
{{
mongo_journal_dir
}}"
-
name
:
add
mongostat
logging script
-
name
:
add
serverStatus
logging script
template
:
src="log-mongo
stat
.sh.j2"
dest="{{ COMMON_BIN_DIR }}/log-mongo
stat
.sh"
src="log-mongo
-serverStatus
.sh.j2"
dest="{{ COMMON_BIN_DIR }}/log-mongo
-serverStatus
.sh"
owner="{{ mongo_user }}"
group="{{ mongo_user }}"
mode=0700
when
:
MONGO_LOG_
MONGOSTAT
when
:
MONGO_LOG_
SERVERSTATUS
-
name
:
add
mongostat
logging script to cron
-
name
:
add
serverStatus
logging script to cron
cron
:
name
:
"
mongostat
logging
job"
job
:
/edx/bin/log-mongo
stat.sh >{{ mongo_log_dir }}/mongostat
.log 2>&1
job
:
/edx/bin/log-mongo
-serverStatus.sh >> {{ mongo_log_dir }}/serverStatus
.log 2>&1
become
:
yes
when
:
MONGO_LOG_
MONGOSTAT
when
:
MONGO_LOG_
SERVERSTATUS
-
name
:
stop mongod service
service
:
name=mongod state=stopped
...
...
This diff is collapsed.
Click to expand it.
playbooks/roles/mongo_3_0/templates/log-mongo-serverStatus.sh.j2
0 → 100644
View file @
c0ab7c92
#!/usr/bin/env bash
# Using JSON.stringify forces output of normal JSON, as opposed to Mongo's weird non-compliant extended JSON
/usr/bin/mongo
-u
{{
MONGO_ADMIN_USER
}}
--authenticationDatabase
admin
-p
'{{ MONGO_ADMIN_PASSWORD }}'
--quiet
<<<
'JSON.stringify(db.serverStatus())'
This diff is collapsed.
Click to expand it.
playbooks/roles/mongo_3_0/templates/log-mongostat.sh.j2
deleted
100644 → 0
View file @
4da70f52
/usr/bin/mongostat -u {{ MONGO_ADMIN_USER }} --authenticationDatabase admin -p '{{ MONGO_ADMIN_PASSWORD }}' --all -n 1 --json
This diff is collapsed.
Click to expand it.
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