Help Center/ GeminiDB/ GeminiDB Mongo API/ Getting Started with GeminiDB Mongo API/ Buying and Connecting to a Replica Set Instance
Updated on 2025-03-04 GMT+08:00

Buying and Connecting to a Replica Set Instance

You can buy a replica set instance compatible with MongoDB on the GeminiDB console. You can customize your replica set instance with appropriate computing capability and storage space.

Step 1: Buying an Instance

  1. Log in to the Huawei Cloud console.
  2. In the service list, choose Databases > GeminiDB Mongo API.
  3. On the Instances page, click Buy DB Instance.
  4. On the displayed page, select a billing mode, configure parameters about instance specifications. Then, click Next
The following parameters are for reference only. Buying an Instance lists details about the instance parameters.
  • Billing Mode: Select Pay-per-use.
  • Region: Select CN-Hong Kong.
  • DB Instance Name: Enter a custom name.
  • Compatible API: Select MongoDB.
  • DB Instance Type: Select Replica set.
  • DB Engine Version: Select 4.0.
  • AZ: Select az1.
  • Data Node Specifications: Select 2 vCPUs | 8 GB.
  • Storage Space: Select 100.
  • Network information: Set VPC, Subnet, and Security Group
  • Access Across CIDR Blocks: Select Skip.
  • Administrator Password: Set a password based on the password policy.
  • Enterprise Project: Select default.
  • Retain the default values for other parameters.
Figure 1 Billing mode and basic information
Figure 2 Specifications and storage
Figure 3 Network and database configurations

Step 2: Using Robo 3T to Connect to an Instance

You can use a MongoDB client to connect to a replica set instance over a non-SSL connection.

A Linux ECS is used as an example.

Non-SSL Connection

  1. Obtain the EIP and port of the replica set instance.

    Primary node: You can read and write data on it.

    Secondary node: You can only read data from it.

    • You can click the instance name to go to the Basic Information page. In the Network Information area, the port is displayed in the Database Port field and the node EIPs are displayed in Node Information area.
      Figure 4 Obtaining connection information

    • Alternatively, click the target instance. On the displayed Basic Information page, click Connections in the navigation pane on the left. Obtain the port and EIP on the Connections page.
      Figure 5 Viewing an EIP

  2. Run Robo 3T. On the displayed dialog box, click Create. For details, see How Do I Install Robo 3T?

    Figure 6 Connection information

  3. In the Connection Settings dialog box, set the parameters of the new connection.

    1. On the Connection tab, specify the connection name in Name and enter the EIP and port of the replica set instance obtained in 1 in Address.
      Figure 7 Connection
    2. On the Authentication tab, set Database to admin, User Name to rwuser, and Password to the administrator password you set during the creation of the replica set instance.
      Figure 8 Authentication
    3. Click Save.

  4. On the MongoDB Connections page, click Connect to connect to the replica set instance.

    Figure 9 Connection information

  5. If the replica set instance is successfully connected, the following page is displayed.

    Figure 10 Connection succeeded