Skip to content

Instantly share code, notes, and snippets.

@StephanieSunshine
Created September 23, 2014 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StephanieSunshine/2d8918d991491003e555 to your computer and use it in GitHub Desktop.
Save StephanieSunshine/2d8918d991491003e555 to your computer and use it in GitHub Desktop.
Steps to build plug many locomotives into one mongo
docker run -d --name mongodb dockerfile/mongodb mongod --noprealloc --smallfiles --rest --httpinterface
# use nsenter to enter it and find it's ip using 'ip addr'
### For future notes
### docker run -p 127.0.0.01:804:80 --link=mongodb:27017 --link=mongodb:28017 -d -e MONGODB_PORT_27017_TCP_ADDR="172.17.0.2" metakungfu/locomotive-cms
docker run -p 127.0.0.01:801:80 --link=mongodb:27017 --link=mongodb:28017 -d metakungfu/locomotive-cms
docker run -p 127.0.0.01:802:80 --link=mongodb:27017 --link=mongodb:28017 -d metakungfu/locomotive-cms
docker run -p 127.0.0.01:803:80 --link=mongodb:27017 --link=mongodb:28017 -d metakungfu/locomotive-cms
# Enter each one:
apt-get install -y vim
# Edit each file
vim /opt/locomotive_cms/app/config/mongoid.yml
# Make sure the database names are always unique and then change the ip of each database server to the ip noted above
# Then use haproxy to do name based reverse proxy rules and you are all set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment