Skip to content

Instantly share code, notes, and snippets.

@aujkis
Forked from lmars/flynn-mongodb.txt
Last active August 29, 2015 14:21
Show Gist options
  • Save aujkis/4f36c87423a55a6acdfe to your computer and use it in GitHub Desktop.
Save aujkis/4f36c87423a55a6acdfe to your computer and use it in GitHub Desktop.
# create a mongo app
flynn create --remote "" mongo
# create a release using the latest (at the time of writing) Docker MongoDB image
flynn -a mongo release add -f config.json "https://registry.hub.docker.com?name=mongo&id=216d9a0e82646f77b31b78eeb0e26db5500930bbd6085d5d5c3844ec27c0ca50"
# scale the server to one process. This may time out initially as the server pulls the image, but watch "flynn -a mongo ps" and it should come up.
flynn -a mongo scale server=1
# mongo should now be running in the cluster at mongo.discoverd:27017
flynn -a mongo run mongo --host mongo.discoverd --port 27017
> db.hostInfo().ok
1
# note that the container does not have a data volume, so restarting the container will get a new data directory. This will be fixed when we have a MongoDB appliance within Flynn.
{
"processes": {
"server": {
"cmd": ["mongod"],
"ports": [{
"port": 27017,
"proto": "tcp",
"service": {
"name": "mongo",
"create": true,
"check": { "type": "tcp" }
}
}]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment