edit-icon download-icon

MongoDB data source config

Last Updated: Apr 03, 2018

MongoDB, as a NoSQL database, is one of the world’s most popular document‑based databases, next only to Oracle and MySQL. MongoDB data source allows both reading data from and writing data to MongoDB, and supports configuring synchronization in script mode.

Note:

To add MongoDB data sources, go to the Whitelist in the MongoDB Console, and enter the addresses as follows (separated by commas) in the IP whitelist:

11.192.97.82,11.192.98.76,10.152.69.0/24,10.153.136.0/24,10.143.32.0/24,120.27.160.26,10.46.67.156,120.27.160.81,10.46.64.81,121.43.110.160,10.117.39.238,121.43.112.137,10.117.28.203,118.178.84.74,10.27.63.41,118.178.56.228,10.27.63.60,118.178.59.233,10.27.63.38,118.178.142.154,10.27.63.15,100.64.0.0/88

Procedure

  1. Log on to the DataWorks console as a developer, and click Enter Project, as shown in the following figure.

    EnterProject

  2. Click Data Integration from the upper menu and navigate to the Data Sources page.

    DataSources

  3. Click New Source.

  4. In the dialog box, select MongoDB as the data source type.

  5. Complete the configuration items for the MongoDB data source.

    Note: If your network environment is VPC, please select the Public IP type, and ignore the Test Connectivity operation, because in the VPC environment, the Test Connectivity is invaild.

    2

    • ali-cloud database: The database generally uses classic networks. The connectivity is established between the classic networks within the same region, but may not between those in different regions.

    • public IPs: These databases generally use public networks, which may cause a certain cost.

    Note:

    You have not granted permissions of Data Integration system default role. Go to RAM to grant role permissions by using the primary account.

    Alibaba cloud database

    2

    • Type: The selected data source type “MongoDB: Alibaba Cloud database”.

    • Name: A combination of letters, numbers, and underscores (). It must begin with a letter or an underscore (), and must not exceed 60 characters.

    • Description: A brief description of the data source, which must not exceed 80 characters.

    • area: The region selected when you purchase MongoDB.

    • Examples of ID: This can be found in the MongoDB console.

    • Database Name: You can set the database name, username, and password when creating a database in the MongoDB console.

    • Username/Password: The username and password of the database.

    Public IP

    3

    • Type: The selected data source type.

    • Name: A combination of letters, numbers, and underscores (). It must begin with a letter or an underscore (), and must not exceed 60 characters.

    • Description: A brief description of the data source, which must not exceed 80 characters.

    • visit the address: The address takes the format of host:port.

    • Database Name: The database name of the data source.

    • Username/Password: The username and password of the database.

  6. Click Test Connectivity.

  7. When the connectivity test is passed, click Complete.

What to do next

Now you have learned how to configure the MongoDB data source. The article explains how to configure the MongoDB Writer plug‑in later. For more information, see Configure MongoDB Writer.

Thank you! We've received your feedback.