Open edX: Setting Up Devstack
25 Sep 2014

Development is much easier using Devstack instead of modifying a production instance. Significantly, it’s configured to only use 2GB of RAM, which makes it fit much better on your dev machine.

The instructions on this are reasonable, but they’re scattered around a bit, so:

  1. Download the base VM

    • There’s no resuming on the download, so I used the torrent (4GB is nontrivial in Australia).
  2. Set up VirtualBox Get the exact version mentioned on the edX wiki. Newer ones will cause headaches. I’ve had success with 4.3.12 and 4.3.20.

“mount.nfs: requested NFS version or transport protocol is not supported”

I never figured out exactly what went wrong here. The nfsd port was being held open by something, but lsof would not list a process. A reboot fixed it.

Also, if you are prompted for a password, it means the admin/root password on the host machine, not the VM. This is not entirely clear.

You can log in to Devstack with

vagrant ssh

You will need a particular user/virtualenv to do anything, so almost always do

sudo su edxapp

on the VM after you ssh in.

Devstack doesn’t start the services automatically. To start the LMS, for instance, run the following on the VM:

cd /edx/app/edxapp/edx-platform
paver devstack lms

This will take a little while the first time around.

You can then access the LMS at http://localhost:9000 (on the host).

MongoDB won’t start

I see this error a lot:

pymongo.errors.ConnectionFailure: could not connect to localhost:27017: [Errno 111] Connection refused

If this is the first time installing/running Devstack, running vagrant provision again is probably the right thing to do. It reinstalls everything, so don’t use it after you’ve made changes.

Usually the error is caused by MongoDB shutting down unexpectedly. I put the following into a shell script and run it whenever I see the error:

sudo rm /edx/var/mongo/mongodb/mongod.lock
sudo -u mongodb mongod --dbpath /edx/var/mongo/mongodb --repair --repairpath /edx/var/mongo/mongodb
sudo start mongodb

If that doesn’t fix it for you, there is more information on repairing the Mongo database at http://docs.mongodb.org/manual/tutorial/recover-data-following-unexpected-shutdown/.

More errors

ImportError at /
No module named exceptions

Per https://groups.google.com/forum/#!topic/openedx-ops/bk4dvZRH1dk:

pip uninstall edx-analytics-api-client
pip install -e git+https://github.com/edx/edx-analytics-data-api-client.git@0.1.0#egg=edx-analytics-data-api-client

Unsorted notes

This uses VirtualBox, which is really a lowest-common-denominator type of decision. My Mac freezes hard if I start up another VM (either Parallels or HAXM for Android), which is somewhat inconvenient, because all of my VMs are in Parallels and Android dev is very slow without HAXM.

There are hooks in the Vagrantfile to use VMware Fusion, but I haven’t tried it.

There is a Parallels target for Vagrant, but I haven’t tried it.

The Developer Stack is configured with 2GB of RAM by default, but you can reduce it to 1GB through the VirtualBox GUI. Performance at 1GB is fine. This helps a lot if your dev machine only has 4GB of RAM.


comments powered by Disqus