Configuring a data source is a prerequisite for creating a data migration task. This topic describes how to create a MongoDB data source in OceanBase Migration Service (OMS) Community Edition.
Procedure
Log in to the OMS Community Edition console.
In the left-side navigation pane, click Data Source Management.
On the Data Source Management page, click New Data Source in the upper-right corner.
In the New Data Source dialog box, set Data Source Type to MongoDB.
Specify the parameters.
Parameter Description Data Source Identifier We recommend that you use Chinese, English, and numbers to name the data source. It must not contain any spaces and cannot exceed 32 characters in length. Notice
The data source name is globally unique in OMS Community Edition.
Region Select the region where the data source resides from the drop-down list. The region is the value that you set for the cm_regionparameter when you deployed OMS Community Edition.Notice
- This parameter is displayed only when multiple regions are available.
- Make sure that the mappings between the data source and the region are consistent. Otherwise, the migration and synchronization performance can be poor.
MongoDB Address The address of the MongoDB database in the IP address:portformat.
You can configure multiple addresses for a MongoDB data source. Separate the addresses with commas (,). For example,xxx.xxx.xxx.1:2883,xxx.xxx.xxx.2:2883.Database User Name (Optional) The username of the database user for data migration. Database Password (Optional) The password of the database user for data migration. Authentication Database (Optional) The database to which the user belongs. Database Properties/Values You can add database properties and property values as needed. When TLS is enabled for a MongoDB data source, you must add the corresponding configuration items. For more information, see the "Configure TLS for a MongoDB data source" section. Remarks (Optional) The remarks of the data source. Click Test Connection to verify the network connection between OMS Community Edition and the database, as well as the validity of the username and password.
After the test succeeds, click OK.
Configure TLS for a MongoDB data source
If TLS is enabled for a MongoDB data source, you must upload the CA file and the client certificate and key file to the OMS Community Edition container and then configure the related parameters.
Log in to the host of the OMS Community Edition container, and copy the CA file and client certificate and key file to the OMS Community Edition container.
# Enter the OMS Community Edition container and create a directory to store the certificate files. sudo docker exec -it <OMS Community Edition container ID> bash mkdir -p /home/ds/tls # Copy the CA file from the host to the OMS Community Edition container. sudo docker cp /path/to/ca.crt <OMS Community Edition container ID>:/home/ds/tls/ # Copy the client certificate and key file from the host to the OMS Community Edition container. sudo docker cp /path/to/client.p12 <OMS Community Edition container ID>:/home/ds/tls/client.p12 # Enter the OMS Community Edition container and set the file permissions. sudo docker exec -it <OMS Community Edition container ID> bash chmod 777 /home/ds/tls/ca.crt chmod 777 /home/ds/tls/client.p12Create a MongoDB data source and add the following database properties and values.
Database property Value Description tlsCAFile STRING The path of the CA file in the OMS Community Edition container. tlsCertificateKeyFile STRING The path of the PKCS#12 container file that contains the client certificate and private key in the OMS Community Edition container. tlsCertificateKeyFilePassword STRING The password of the client certificate and key file. This parameter is required if the client certificate and key file is encrypted. tlsAllowInvalidHostnames BOOLEAN Specifies whether to disable hostname verification in the TLS certificate. authenticationMechanism STRING The authentication mechanism of the MongoDB data source. If x509 authentication is enabled, set the value to MONGODB-X509.