Getting Started with MongoDB

1. Create an instance

Note

If you need help deciding what kind of instance to create, take a look at our MongoDB Overview!

Create Instance

  1. Click the Instance heading, then click on Add Instance.

  2. Enter a name for your instance.

    This can be almost anything, as any alpha numeric string is valid.

  3. Select MongoDB for the service.

  4. Select a database type.

    Choose either MongoDB Sharded or MongoDB Replica Set. Each selection includes a brief description, and more information can be found on our MongoDB Overview.

_images/createmongo1.png

Click on Configuration to continue.

Configuration

  1. Select a version to deploy.

    We offer the latest version of MongoDB 2.6, 3.0, and 3.2. If you select 3.0+ or 3.2+, you can also select either WiredTiger or MMAPv1 as a storage engine.

  2. Select a zone that suits your needs.

    Zones are Rackspace and/or AWS Direct Connect zones, labeled by airport codes in that region. For more information about ObjectRocket’s datacenters, check out the FAQ or our zone map.

  3. Select a plan that suits your needs.

    Consider that as you grow you always add shards in your plan size when using a Sharded instance, but that isn’t possible for a Replica Set. For more details, check out plans and pricing.

  4. Select a storage engine (3.0+ and 3.2+ only).

    You can select WiredTiger or MMAPv1 for your storage engine when deploying MongoDB 3.0. If you choose our WiredTiger engine you’ll have a plan size minimum of 20GB.

  5. Select encryption.

    You can choose to encrypt your data at rest and any backups for this instance.

_images/createmongo2.png

Click on ACLs to continue.

ACLs

Access Control Lists (ACL) limit what IPs connect to your instance.

Note

ObjectRocket denies access by default so you need to add any appropriate ACL’s for servers that are connecting to ObjectRocket.

  1. Enter an IP address/CIDR block and a description.

    Only the IP address is mandatory, but descriptions can help when maintaining larger lists.

Note

You can click the Add My IP or Allow Any IP to have our system automatically add those options.

  1. Click Add ACL.
_images/createmongo3.png
  1. Once you’ve added at least one ACL, or deferred to add one later, you can click Create Instance to finish.

2. Add a database

Instances you create appear under the Instances heading. Click the instance name to view its details and available operations. Many operations are available; to begin, let’s create a database. After selecting the desired instance, scrolldown to the Databases section.

  1. Click on Add Database.

    Enter a name, username, and password, then click Add Database to confirm.

Note

Database users by default have full privileges to the specified database. You are able to create collections and indexes, as well as, read and write documents. However, by default, they cannot perform administrative commands or interact with databases outside of itself.

You can also add collections or more users with this interface by selecting the database name, as well as by using the ObjectRocket API or MongoDB shell.

_images/adddatabase.png

3. Connect!

HTTP

After you’ve created a database with user authentication and added an ACL, you’re ready to test basic connectivity in a terminal session with the MongoDB shell:

$ mongo iad-mongos0.objectrocket.com:<PORT>/<DATABASE> -u <USER> -p <PASSWORD>
MongoDB shell version: 2.6.11
connecting to: iad-mongos0.objectrocket.com:<PORT>/<DATABASE>

HTTPS

Note

Prior to 3.0+, the Mongo shell does not support SSL connections unless you compile it manually with SSL support.

Using the SSL compiled binaries run the following in a terminal session

$ mongo iad-mongos0.objectrocket.com:<PORT>/<DATABASE>?ssl=true -u <USER> -p <PASSWORD>
MongoDB shell version: 2.6.11
connecting to: iad-mongos0.objectrocket.com:<PORT>/<DATABASE>

View Collections

mongos> show collections
example_collection
system.indexes
system.users

mongos>

If you see something similar after running show collections, you’re connected to the instance and can perform database operations. Success!

If you encounter any issues or just want some guidance, please reach out to our support team!