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
222c43bd
Commit
222c43bd
authored
May 22, 2014
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use s3 backups instead of mongodump
parent
6b0ecb32
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
26 deletions
+48
-26
playbooks/edx-east/connect_sandbox.yml
+48
-26
No files found.
playbooks/edx-east/connect_sandbox.yml
View file @
222c43bd
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
-
name
:
update the mongo config to use the new mongo dir
-
name
:
update the mongo config to use the new mongo dir
shell
:
>
shell
:
>
sed -i 's#^dbpath=.*#dbpath=/mnt/mongodb#' /etc/mongodb.conf
sed -i 's#^dbpath=.*#dbpath=/mnt/mongodb#' /etc/mongodb.conf
tags
:
update_mongo_data
1
tags
:
update_mongo_data
-
name
:
restart mongodb
-
name
:
restart mongodb
service
:
>
service
:
>
...
@@ -23,45 +23,67 @@
...
@@ -23,45 +23,67 @@
state=restarted
state=restarted
tags
:
update_mongo_data
tags
:
update_mongo_data
-
name
:
Dump mongo data using the cloned dbs for forums
-
name
:
grab the most recent backup from s3 for forums
shell
:
>
/edx/bin/s3cmd ls s3://edx-mongohq/mongohq_backups/ | grep comment | sort | tail -1 | awk '{ print $4 }'
register
:
s3cmd_out_forum
tags
:
update_mongo_data
-
name
:
grab the most recent backup from s3 for forums
shell
:
>
/edx/bin/s3cmd get {{ s3cmd_out_forum.stdout }}
chdir=/mnt
tags
:
update_mongo_data
-
name
:
untar the s3 backup
shell
:
>
shell
:
>
mongodump -d comments-prod-clone -u {{ CLONE_FORUM_USER }} -p {{ CLONE_FORUM_PASS }} -h {{ CLONE_FORUM_HOST }} --port {{ CLONE_FORUM_PORT }} -o /mnt/forum-dump -c {{ item }}
tar zxf {{ s3cmd_out_forum.stdout }}
with_items
:
chdir=/mnt
-
activities
-
blocked_hash
-
contents
-
contents_tag_aggregation
-
delayed_backend_mongoid_jobs
-
results
-
subscriptions
-
users
tags
:
update_mongo_data
tags
:
update_mongo_data
-
name
:
Restore the mongo data for the forums
-
name
:
grab the most recent backup from s3 for prod-edx
shell
:
>
/edx/bin/s3cmd ls s3://edx-mongohq/mongohq_backups/ | grep prod-edx | sort | tail -1 | awk '{ print $4 }'
register
:
s3cmd_out_modulestore
tags
:
update_mongo_data
-
name
:
grab the most recent backup from s3 for prod-edx
shell
:
>
/edx/bin/s3cmd get {{ s3cmd_out_modulestore.stdout }}
chdir=/mnt
tags
:
update_mongo_data
-
name
:
untar the s3 backup
shell
:
>
shell
:
>
mongorestore --drop -d cs_comments_service /mnt/forum-dump/comments-prod-clone
tar zxf {{ s3cmd_out_modulestore.stdout }}
chdir=/mnt
tags
:
update_mongo_data
tags
:
update_mongo_data
-
name
:
Dump mongo data using the cloned dbs for the modulestore
-
name
:
Restore the mongo data for the forums
shell
:
>
shell
:
>
mongodump -d prod-edx-clone -u {{ CLONE_MODULESTORE_USER }} -p {{ CLONE_MODULESTORE_PASS }} -h {{ CLONE_MODULESTORE_HOST }} --port {{ CLONE_MODULESTORE_PORT }} -o /mnt/modulestore-dump -c {{ item }}
mongorestore --drop -d cs_comments_service /mnt/comments-prod
with_items
:
-
modulestore
-
fs.chunks
-
fs.files
tags
:
update_mongo_data
tags
:
update_mongo_data
-
name
:
Restore the mongo data for the modulestore
-
name
:
Restore the mongo data for the modulestore
shell
:
>
shell
:
>
mongorestore --drop -d edxapp /mnt/
modulestore-dump/prod-edx-clone
mongorestore --drop -d edxapp /mnt/
prod-edx
tags
:
update_mongo_data
tags
:
update_mongo_data
-
name
:
Remove dump files
# recreate users after the restore
shell
:
>
-
name
:
create a mongodb users
rm -rf {{ item }}
mongodb_user
:
>
database={{ item.database }}
name={{ item.user }}
password={{ item.password }}
state=present
with_items
:
with_items
:
-
/mnt/forum-dump
-
user
:
cs_comments_service
-
/mnt/modulestore-dump
password
:
password
database
:
cs_comments_service
-
user
:
exdapp
password
:
password
database
:
edxapp
# WARNING - calling lineinfile on a symlink
# WARNING - calling lineinfile on a symlink
# will convert the symlink to a file!
# will convert the symlink to a file!
...
...
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