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
- Step 2: Using Robo 3T to Connect to an Instance For details about other connection methods, see Connecting to an Instance.
Step 1: Buying an Instance
- Log in to the Huawei Cloud console.
- In the service list, choose Databases > GeminiDB Mongo API.
- On the Instances page, click Buy DB Instance.
- On the displayed page, select a billing mode, configure parameters about instance specifications. Then, click Next
- 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.



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

- If you connect to an instance over an unencrypted connection, disable SSL first. Otherwise, an error is reported. For details about how to disable SSL, see Configuring an SSL Connection.
- Bind an EIP to the replica set instance and configure security group rules. For details, see Binding and Unbinding an EIP and Configuring Security Group Rules. Ensure that the EIP is accessible using Robo 3T.
- 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
- 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.
- Run Robo 3T. On the displayed dialog box, click Create. For details, see How Do I Install Robo 3T?
Figure 6 Connection information
- In the Connection Settings dialog box, set the parameters of the new connection.
- 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
- 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
- Click Save.
- 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.
- On the MongoDB Connections page, click Connect to connect to the replica set instance.
Figure 9 Connection information
- If the replica set instance is successfully connected, the following page is displayed.
Figure 10 Connection succeeded
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot