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
9323a427
Commit
9323a427
authored
Oct 28, 2013
by
John Jarvis
Browse files
Options
Browse Files
Download
Plain Diff
updating from master, merge conflicts
parents
1030fd7a
c3d104fd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
3 deletions
+40
-3
cloudformation_templates/edx-reference-architecture.json
+0
-0
playbooks/roles/mongo/defaults/main.yml
+5
-0
playbooks/roles/mongo/tasks/main.yml
+19
-1
playbooks/roles/mongo/templates/mongodb.conf.j2
+6
-2
playbooks/roles/mongo/templates/repset_init.j2
+10
-0
No files found.
cloudformation_templates/edx-reference-architecture.json
View file @
9323a427
This diff is collapsed.
Click to expand it.
playbooks/roles/mongo/defaults/main.yml
View file @
9323a427
mongo_dbpath
:
/var/lib/mongodb
mongo_logpath
:
/var/log/mongodb/mongodb.log
mongo_logpath
:
/var/log/mongodb/mongodb.log
mongo_logappend
:
true
mongo_logappend
:
true
mongo_version
:
2.4.7
mongo_version
:
2.4.7
mongo_bind_ip
:
127.0.0.1
mongo_bind_ip
:
127.0.0.1
mongo_extra_conf
:
'
'
mongo_extra_conf
:
'
'
mongo_key_file
:
'
/etc/mongodb_key'
mongo_repl_set
:
rs0
mongo_cluster_members
:
mongo_data_dir
:
"
{{
data_dir
}}/mongo"
mongo_data_dir
:
"
{{
data_dir
}}/mongo"
mongo_app_dir
:
"
{{
app_dir
}}/mongo"
mongo_app_dir
:
"
{{
app_dir
}}/mongo"
mongo_dbpath
:
"
{{
mongo_data_dir
}}/mongodb"
mongo_dbpath
:
"
{{
mongo_data_dir
}}/mongodb"
...
...
playbooks/roles/mongo/tasks/main.yml
View file @
9323a427
---
---
-
name
:
mongo | install python pymongo for mongo_user ansible module
-
name
:
mongo | install python pymongo for mongo_user ansible module
pip
:
>
pip
:
>
name=pymongo state=present
name=pymongo state=present
...
@@ -39,6 +38,16 @@
...
@@ -39,6 +38,16 @@
-
name
:
mongo | move mongodb to {{ mongo_data_dir }}
-
name
:
mongo | move mongodb to {{ mongo_data_dir }}
command
:
mv /var/lib/mongodb {{ mongo_data_dir}}/. creates={{ mongo_data_dir }}/mongodb
command
:
mv /var/lib/mongodb {{ mongo_data_dir}}/. creates={{ mongo_data_dir }}/mongodb
-
name
:
mongo | copy mongodb key file
copy
:
>
src={{ secure_dir }}/files/mongo_key
dest={{ mongo_key_file }}
mode=0600
owner=mongodb
group=mongodb
when
:
mongo_clustered is defined
-
name
:
mongo | copy configuration template
-
name
:
mongo | copy configuration template
template
:
src=mongodb.conf.j2 dest=/etc/mongodb.conf backup=yes
template
:
src=mongodb.conf.j2 dest=/etc/mongodb.conf backup=yes
notify
:
restart mongo
notify
:
restart mongo
...
@@ -49,6 +58,15 @@
...
@@ -49,6 +58,15 @@
-
name
:
mongo | wait for mongo server to start
-
name
:
mongo | wait for mongo server to start
wait_for
:
port=27017 delay=2
wait_for
:
port=27017 delay=2
-
name
:
mongo | Create the file to initialize the mongod replica set
template
:
src=repset_init.j2 dest=/tmp/repset_init.js
when
:
mongo_clustered is defined
-
name
:
mongo | Initialize the replication set
shell
:
/usr/bin/mongo /tmp/repset_init.js
# Ignoring errors here because slave instances will fail this command
# since slaveOk is false in ansible 1.3.
-
name
:
mongo | create a mongodb user
-
name
:
mongo | create a mongodb user
mongodb_user
:
>
mongodb_user
:
>
database={{ item.database }}
database={{ item.database }}
...
...
playbooks/roles/mongo/templates/mongodb.conf.j2
View file @
9323a427
...
@@ -15,6 +15,11 @@ bind_ip = {{ mongo_bind_ip }}
...
@@ -15,6 +15,11 @@ bind_ip = {{ mongo_bind_ip }}
# Enable journaling, http://www.mongodb.org/display/DOCS/Journaling
# Enable journaling, http://www.mongodb.org/display/DOCS/Journaling
journal=true
journal=true
{% if mongo_clustered is defined %}
keyFile = {{ mongo_key_file }}
replSet = {{ mongo_repl_set }}
{% endif %}
# Enables periodic logging of CPU utilization and I/O wait
# Enables periodic logging of CPU utilization and I/O wait
#cpu = true
#cpu = true
...
@@ -93,4 +98,4 @@ journal=true
...
@@ -93,4 +98,4 @@ journal=true
# Size limit for in-memory storage of op ids.
# Size limit for in-memory storage of op ids.
#opIdMem = <bytes>
#opIdMem = <bytes>
{{ mongo_extra_conf }}
{{ mongo_extra_conf }}
\ No newline at end of file
playbooks/roles/mongo/templates/repset_init.j2
0 → 100644
View file @
9323a427
config = {_id: '{{ mongo_repl_set }}', members: [
{% for host in mongo_cluster_members %}
{_id: {{ loop.index }}, host: '{{ host }}'}{% if not loop.last %},{% endif %}
{% endfor %}
]};
rs.initiate(config)
sleep(30000)
rs.slaveOk()
printjson(rs.status())
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