Getting Started with MongoDB¶
1. Create an instance¶
If you need help deciding what kind of instance to create, take a look at our MongoDB Overview!
Click the Instance heading, then click on Add Instance.
Enter a name for your instance.
This can be almost anything, as any alpha numeric string is valid.
Select MongoDB for the service.
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.
Click on Configuration to continue.
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.
Select a zone that suits your needs.
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.
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.
You can choose to encrypt your data at rest and any backups for this instance.
Click on ACLs to continue.
Access Control Lists (ACL) limit what IPs connect to your instance.
ObjectRocket denies access by default so you need to add any appropriate ACL’s for servers that are connecting to ObjectRocket.
Enter an IP address/CIDR block and a description.
Only the IP address is mandatory, but descriptions can help when maintaining larger lists.
You can click the Add My IP or Allow Any IP to have our system automatically add those options.
- Click Add ACL.
- 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.
Click on Add Database.
Enter a name, username, and password, then click Add Database to confirm.
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.
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>
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>
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!