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
dd990618
Commit
dd990618
authored
May 22, 2014
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding mysql restore
parent
752c0aab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
playbooks/edx-east/connect_sandbox.yml
+52
-0
util/jenkins/connect-sandbox-to-prod-clone.sh
+1
-0
No files found.
playbooks/edx-east/connect_sandbox.yml
View file @
dd990618
...
@@ -3,6 +3,26 @@
...
@@ -3,6 +3,26 @@
gather_facts
:
False
gather_facts
:
False
sudo
:
True
sudo
:
True
tasks
:
tasks
:
-
name
:
Switch the mongo db to use ephemeral
file
:
>
name=/mnt/mongodb
state=directory
owner=mongodb
group=mongodb
tags
:
update_mongo_data1
-
name
:
update the mongo config to use the new mongo dir
shell
:
>
sed -i 's#^dbpath=.*#dbpath=/mnt/mongodb/#' /etc/mongodb.conf
tags
:
update_mongo_data1
-
name
:
restart mongodb
service
:
>
name=mongodb
state=restarted
tags
:
update_mongo_data1
-
name
:
Dump mongo data using the cloned dbs for forums
-
name
:
Dump mongo data using the cloned dbs for forums
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 }}
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 }}
...
@@ -15,18 +35,26 @@
...
@@ -15,18 +35,26 @@
-
results
-
results
-
subscriptions
-
subscriptions
-
users
-
users
tags
:
update_mongo_data
-
name
:
Restore the mongo data for the forums
-
name
:
Restore the mongo data for the forums
shell
:
>
shell
:
>
mongorestore --drop -d cs_comments_service /mnt/forum-dump/comments-prod-clone
mongorestore --drop -d cs_comments_service /mnt/forum-dump/comments-prod-clone
tags
:
update_mongo_data
-
name
:
Dump mongo data using the cloned dbs for the modulestore
-
name
:
Dump mongo data using the cloned dbs for the modulestore
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 modulestore
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 modulestore
with_items
:
-
modulestore
-
fs.chunks
-
fs.files
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/modulestore-dump/prod-edx-clone
tags
:
update_mongo_data
-
name
:
Remove dump files
-
name
:
Remove dump files
shell
:
>
shell
:
>
...
@@ -34,3 +62,27 @@
...
@@ -34,3 +62,27 @@
with_items
:
with_items
:
-
/mnt/forum-dump
-
/mnt/forum-dump
-
/mnt/modulestore-dump
-
/mnt/modulestore-dump
# WARNING - calling lineinfile on a symlink
# will convert the symlink to a file!
# don't use /edx/etc/serv-ars.yml here
#
# What we are doing here is updating the sandbox
# server-vars config file so that when update
# is called it will use the new MYSQL connection
# info.
-
name
:
Update RDS to point to the sandbox clone
lineinfile
:
>
dest=/edx/app/edx_ansible/server-vars.yml
line="{{ item }}"
with_items
:
-
"
EDXAPP_MYSQL_HOST:
{{
EDXAPP_MYSQL_HOST
}}"
-
"
EDXAPP_MYSQL_DB_NAME:
{{
EDXAPP_MYSQL_DB_NAME
}}"
-
"
EDXAPP_MYSQL_USER:
{{
EDXAPP_MYSQL_USER
}}"
-
"
EDXAPP_MYSQL_PASSWORD:
{{
EDXAPP_MYSQL_PASSWORD
}}"
tags
:
update_edxapp_mysql_host
-
name
:
call update on edx-platform
shell
:
>
/edx/bin/update edx-platform master
tags
:
update_edxapp_mysql_host
util/jenkins/connect-sandbox-to-prod-clone.sh
View file @
dd990618
...
@@ -39,3 +39,4 @@ fi
...
@@ -39,3 +39,4 @@ fi
cd
$WORKSPACE
/configuration/playbooks/edx-east
cd
$WORKSPACE
/configuration/playbooks/edx-east
ansible-playbook connect_sandbox.yml
-i
$sandbox_to_update
,
-e
@
${
WORKSPACE
}
/configuration-secure/ansible/vars/clone-db.yml
--user
ubuntu
-v
ansible-playbook connect_sandbox.yml
-i
$sandbox_to_update
,
-e
@
${
WORKSPACE
}
/configuration-secure/ansible/vars/clone-db.yml
--user
ubuntu
-v
ansible-playbook edxapp.yml
-i
$sandbox_to_update
,
-e
@
${
WORKSPACE
}
/configuration-secure/ansible/vars/clone-db.yml
-e
EDXAPP_MYSQL_HOST
=
$EDXAPP_MYSQL_HOST
--user
ubuntu
-v
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