Get the latest news and information about the ObjectRocket platform and its fully managed instances.

Free 30-Day Trial

Provision a single Redis (500MB), MongoDB with MMAPv1 (up to 5GB), or Elasticsearch with Kibana (512MB RAM / 4GB Disk) instance and experience the ObjectRocket platform backed by Fanatical Support® free for your first 30 days. Learn more

Try now

Building your new application on Rackspace Carina and ObjectRocket High-Performance MongoDB

Our mission at ObjectRocket is to provide the fastest, most reliable databases available. There are plenty of great places to run your applications, but the role that containers (and Docker in particular) play in the enterprise today is undeniable. Rackspace recently released a great new service called 'Carina', providing a high performance hosted Docker Swarm service that complements ObjectRocket very well. In this post, I'd like to show you how to get started deploying and scaling applications on Carina, while easily integrating with blazing fast databases on ObjectRocket.

First, head on over to and sign up for a free account - only takes a few seconds. Once you create your account, you'll pretty much immediately see this:

Add a Cluster

Select a name to describe your cluster and click 'Create Cluster':

Add a Cluster

Your cluster will take a few seconds to build, and then should be active.

Add a Cluster

Download the zipfile provided - this contains everything you need to get started. First, unzip the file:

$ mkdir carina_deployment && cd carina_deployment
$ unzip ~/Downloads/
Archive:  /Users/erik/Downloads/
 extracting: my_new_test_cluster/ca.pem
 extracting: my_new_test_cluster/
 extracting: my_new_test_cluster/ca-key.pem
 extracting: my_new_test_cluster/docker.cmd
 extracting: my_new_test_cluster/docker.env
 extracting: my_new_test_cluster/docker.ps1
 extracting: my_new_test_cluster/cert.pem
 extracting: my_new_test_cluster/key.pem

Next, configure your Docker environment, using the provided environment file:

$ source my_new_test_cluster/docker.env

Now our Docker environment is configured, let's check it out:

$ docker info
Containers: 5
Images: 4
Role: primary
Strategy: spread
Filters: affinity, health, constraint, port, dependency
Nodes: 1
  └ Containers: 5
  └ Reserved CPUs: 0 / 12
  └ Reserved Memory: 0 B / 4.2 GiB
  └ Labels: executiondriver=native-0.2, kernelversion=3.18.21-1-rackos, operatingsystem=Debian GNU/Linux 7 (wheezy) (containerized), storagedriver=aufs
CPUs: 12
Total Memory: 4.2 GiB
Name: c4873c9dd65d

We've now got a working Docker Swarm cluster! Let's get an application running. I'll start by grabbing an existing image from Docker Hub, which provides an Ubuntu environment, complete with Flask, Gunicorn, etc.

$ docker pull objectrocket/ubuntu_flask_python
4847681a-dcfc-44bd-84d3-66b67307fdb1-n1: Pulling objectrocket/ubuntu_flask_python:latest... : downloaded
$ docker images
REPOSITORY                         TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
objectrocket/ubuntu_flask_python   latest              be574a6575a4        9 hours ago         370.8 MB

So now we've got an image; The only thing we need to do is give it credentials to our MongoDB instance, and it's ready to do some work.

Let's create a MongoDB instance in your ObjectRocket account. Log in to your account at, and click on 'Add Instance':

Add an Instance

We'll select a simple "replica set" instance (not sharded), give it an easy-to-remember name "ErikTestReplicaSet", and then click "Next":

Add an Instance

We'll select a 2.6.10 instance, 5GB, in the IAD zone:

Add an Instance

Now review, and click 'Create':

Add an Instance

Now you've got a MongoDB instance! Your instances list should look like this:

Add an Instance

Now there's one thing left - give yourself access to your instance. You'll need to do two things, first, add a user. Click on your instance, and then click on '+ Instance User'. Then you'll define a login and password:

Add an Instance

Next, you'll need a network ACL as well. Refer to a few steps back when we checked the output of 'docker info' - you'll see that our public IP is:

Nodes: 1

Simply add an ACL to allow this node access:

Add an Instance

And that's all there is to it. Let's fire this thing up and see what happens.

$ echo "MONGO_URI=mongodb://," > myapp.env
$ docker run -d --env-file=myapp.env -P objectrocket/ubuntu_flask_python

Your container should be running - let's check:

$ docker ps --latest
5aa9159675f7        objectrocket/ubuntu_flask_python   gunicorn app:app -w   About a minute ago   Up About a minute>8080/tcp   4847681a-dcfc-44bd-84d3-66b67307fdb1-n1/reverent_kare

Looks good. Let's check the logs and make sure Gunicorn is up and healthy:

$ docker logs 5aa9159675f7
[2015-11-17 00:34:24 +0000] [1] [INFO] Starting gunicorn 19.3.0
[2015-11-17 00:34:24 +0000] [1] [INFO] Listening at: (1)
[2015-11-17 00:34:24 +0000] [1] [INFO] Using worker: sync
[2015-11-17 00:34:24 +0000] [9] [INFO] Booting worker with pid: 9

Now, let's check our port mapping to see how to connect to it via the Internet:

$ docker port 5aa9159675f7
8080/tcp ->

Our webserver, running on the (non-privileged) port tcp/8080, has been NAT'ed to the public address


That's all there is to it - you're up and running with a high performance database ready to do some work. Where do you go from here? Simple, modify this container, add your own code, your own modules, your own management pieces, and make it your own! The flexibility of Docker makes it trivial and fun to extend your environment, and MongoDB is a great way to manage your data!

Resource Links - Try this at home!

Any questions? Don't hesitate to ask, we're happy to help. Thanks for reading!

We've got your back 24x7x365
  • Sales: 1-888-440-3242