Skip to content
Sef Kloninger edited this page Jul 23, 2013 · 9 revisions

These are some of the steps and commands that we use to operate our instance of edX here at Stanford.

Installation

End-To-End Test

cd playbooks/edx-west
ANSIBLE_EC2_INI=./ec2.ini ansible-playbook  -c ssh -vvv -i ./ec2.py edxapp_prod.yml --list-hosts

playbook: edxapp_prod.yml

Should this playbook run database migrations? (Type 'yes' to run, anything else to skip migrations):

Normal Update -- run all plays

cd playbook/edx-west
ANSIBLE_EC2_INI=./ec2.ini ansible-playbook  -c ssh -vvv -i ./ec2.py edxapp_prod.yml

Deploy Only -- run only the "deploy" play

doesn't change any of the *.json files, ie. the configuration steps, so only want to do this when we're sure we just want new software.

Specify the branch here, variable is lms_version: configuration-secure/ansible/vars/edxapp_prod_vars.yml

and then run this:

cd playbook/edx-west
ANSIBLE_EC2_INI=./ec2.ini ansible-playbook  -c ssh -vvv -i ./ec2.py edxapp_prod.yml

Useful Commands

Restarts

cd playbooks/edx-west
ANSIBLE_EC2_INI=./ec2.ini ansible '~tag_Name_app(4)_prod' -s -c ssh -i ./ec2.py -m shell -a "sudo shutdown -g0 -r -y"

Useful line to detect connections piling up:

cd playbooks/edx-west
ANSIBLE_EC2_INI=./ec2.ini ansible '~tag_Name_app(10|20|11|21)_prod' -s -c ssh -i ./ec2.py -m shell -a "lsof -i |grep TCP | wc -l"