Updated on 2024-01-10 GMT+08:00

Connecting to a DDS Instance Through an EIP

This section uses a DDS replica set instance and Windows operating system as an example to describe how to buy a DDS instance, bind an EIP, set a security group, and connect to the DDS instance using the Robo 3T tool in your local environment. The procedures are as follows:

Step 1: Buy a DB Instance

  1. Go to the Custom Config page.
  2. On the displayed page, select a billing mode and configure information about your DB instance. Then, click Next.
    Figure 1 Basic configurations
    Figure 2 Administrator settings
    Figure 3 Network, Required Duration, and Quantity
    Figure 4 Advanced settings
  3. On the displayed page, confirm the instance details.
    • For yearly/monthly instances
      • If you need to modify the specifications, click Previous to return to the previous page.
      • If you do not need to modify the specifications, read and agree to the service agreement and click Pay Now to go to the payment page and complete payment.
    • For pay-per-use instances
      • If you need to modify the specifications, click Previous to return to the previous page.
      • If you do not need to modify the specifications, read and agree to the service agreement and click Submit to start creating the instance.
  4. Click Back to Instance List. After a DDS instance is created, you can view and manage it on the Instances page.
    • When an instance is being created, the status displayed in the Status column is Creating. This process takes about 15 minutes. After the creation is complete, the status changes to Available.
    • Yearly/Monthly instances that were purchased in batches have the same specifications except for the instance name and ID.

Step 2: Bind an EIP

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Document Database Service.
  4. On the Instances page, click the instance. The Basic Information page is displayed.
  5. In the Node Information area, locate the row that contains the primary node and click Bind EIP.
  6. In the displayed dialog box, select the purchased EIP and click OK.
  7. After the binding is successful, view the EIP in the Node Information area.

Step 3: Configure a Security Group

  1. In the Network Information area on the Basic Information page, check the database port of the DB instance.
  2. In the Network Information area, click the security group name.
  3. On the Security Groups page, click the security group name.
  4. Click the Inbound Rules tab and click Add Rule. In the displayed dialog box, add an inbound rule for the database port.

Step 4: Connect to a DDS Instance

  1. Access the Robo 3T download address https://robomongo.org/download and click Download Studio 3T Free Today.
    Figure 5 Downloading page
  2. In the displayed dialog box, enter required information and click Download Studio 3T for Windows to download studio-3t-x64.zip.
    Figure 6 Downloading Robo 3T
  3. Decompress the downloaded package and double-click the studio-3t-x64.exe file in the decompressed directory to start the installation.
  4. After the installation is complete, start the tool, as shown in Figure 7.
    Figure 7 Main window
  5. On the Connection Manager page, click New Connection.
    Figure 8 Connection manager
  6. Connect to a DB instance automatically or manually.
    • Method 1: Connect to a DB instance automatically.
      1. In the dialog box that is displayed, enter the URI, replace <password>, and click Next.

        How to obtain the URI:

        On the Instances page, click the target DB instance name. On the Basic Information page, click Connections. In the Public Connection area, obtain the public connection address from Address.

        Figure 9 Entering the URI
      2. On the Server tab, click OK in the displayed dialog box.
        Figure 10 Server
      3. Click the Authentication tab.
        Figure 11 Authentication
      4. Click Test Connection to check whether the connection is successful.
        Figure 12 Test Connection
      5. Click the SSL tab and select Use SSL protocol to connect.

        If SSL data encryption is disabled, skip this step and go to 6.h.

        Figure 13 SSL
      6. Select Use own Root CA file (--sslCAFile), import the certificate, and select Allow invalid hostnames.

        Download the SSL certificate and verify the certificate before connecting to databases.

        On the Instances page, click the target DB instance name. In the DB Information area on the Basic Information page, click in the SSL field to download the root certificate or certificate bundle.

        Figure 14 Entering SSL information
      7. Click Test Connection to check whether the connection is successful.
        Figure 15 Checking the SSL connection
      8. After the check is successful, click Save.
        Figure 16 Connection information
      9. On the connection information page, click Connect to connect to the replica set instance. After the replica set instance is successfully connected, Figure 17 is displayed.
        Figure 17 Connection succeeded
    • Method 2: Manually connect to a DB instance.
      1. In the displayed dialog box, select Manually configure my connection settings and click Next.
        Figure 18 Manual connection mode
      2. On the Server tab, set Server and Port.

        Server: EIP.

        Port: database port.

        Figure 19 Server
      3. Click the Authentication tab and select Legacy(SCRAM-SHA-1).
        Figure 20 Authentication
      4. Set User name, Password, and Authentication DB.
        Figure 21 Authentication
      5. Click Test Connection to check whether the connection is successful.
        Figure 22 Test Connection
      6. Click the SSL tab and select Use SSL protocol to connect.

        If SSL data encryption is disabled, skip this step and go to 6.i.

        Figure 23 SSL
      7. Select Use own Root CA file (--sslCAFile), import the certificate, and select Allow invalid hostnames.

        Download the SSL certificate and verify the certificate before connecting to databases.

        On the Instances page, click the target DB instance name. In the DB Information area on the Basic Information page, click in the SSL field to download the root certificate or certificate bundle.

        Figure 24 Entering SSL information
      8. Click Test Connection to check whether the connection is successful.
        Figure 25 Checking the SSL connection
      9. After the check is successful, click Save.
        Figure 26 Connection information
      10. On the connection information page, click Connect to connect to the replica set instance. After the replica set instance is successfully connected, Figure 27 is displayed.
        Figure 27 Connection succeeded