Integrate.io can integrate various data sources. One of the services it can integrate with is mLab, a MongoDB-as-a-service. This post will demonstrate how to connect them together and enjoy the advantage of working with MongoDB and Hadoop on the cloud.
MongoLab Settings
-
Sign in into your mLab account or sign up if you don’t have one.
-
Click the relevant DB in the dashboard. If you don’t have a DB, you can create a free sandbox by clicking Create New, Single-node (development), and choosing the Sandbox plan. For more details, please see mLab’s documentation.
-
Create a collection for the DB if one isn’t available by clicking the Add Collection button.
-
A database user must be added. If there is no user, a yellow message will appear with a link to create one. Click it and follow the instructions. Keep a note with the database username and password on the side (note - they may be different than the username and password for the entire MongoLab account).
-
Back on the database screen, look for the line “To connect using a driver via the standard URI”. Check the line that appears below it and note down the host and port number. E.g., if the URI displayed is
mongodb://<dbuser>:<dbpassword>@ds045557.mongolab.com:45557/naftsen
, then the host is ds045557.mongolab.com and the port number is 45557. -
If you need to migrate data into your MongoLab database, please refer to the documentation.
Integrate.io Settings
-
Login to your Integrate.io account. If you don’t have one, create a free account.
-
In your account, click the user image on the top right and choose Account settings.
-
Click the Connections menu on the left, click New Database Connection, and choose MongoDB.
-
Enter any name that you want for the connection, and then insert the relevant MongoLab database details. Note that the username and password are for the specific database which you are trying to access, not the MongoLab account. Also make sure to disable the “Connect using SSL” checkbox since it isn’t supported for a MongoLab connection.
-
Click the Test Connection button at the bottom to make sure the connection works. If it fails, one of the details that you entered is incorrect. Go back to the MongoLab Settings section and make sure all the details are accurate.
-
Click the Create MongoDB Connection button.
-
Open an existing Integrate.io package or create a new one via My Packages, New Package.
-
Click the New Source button at the top and choose MongoDB.
-
Click the component that was just added. The MongoDB Source dialog should appear. Choose the MongoDB connection that you previously created in the MongoDB Connection dropdown, and click the green auto-detect schema button on the right. The schema should be filled automatically. Also make sure to enter the source collection name. For more info how to work with MongoDB source components, please refer to the help section.
-
Back on the package screen, add components to process the data as necessary.
-
To save the processed data back on mLab, add a MongoDB destination. Click the component to open the edit dialog. Choose the relevant MongoDB connection and enter the target collection.
All done! To run the job, you will need to setup a cluster. Please refer to the documentation for further details.
Read more about the power of data integration on the Integrate.io blog.