Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.
- What's New
- Function Overview
-
Product Bulletin
- Vulnerability Notice
-
Product Notices
- [Notice] Starting OBT for DDS Cluster 5.0 on Nov 5, 2024
- [Notice] Huawei Cloud DDS Replica Set 5.0 Will Be Released Commercially on Oct 11, 2024
- [Notice] Huawei Cloud DDS 3.4 Will Be Discontinued on Oct 11, 2024
- [Notice] Starting OBT for DDS 5.0 on July 24, 2024
- [Notice] Specifications with CPU-Memory Ratio of 1:8 Will Be Available for x86-Powered Enhanced II Replica Set Instances and Cluster Shards on February 15, 2023
- [Notice] DDS 4.4 OBT Invitation
- [Product Discontinuation Notice] Huawei Cloud Document Database Service (DDS) Single Node Instances Will Be Discontinued on July 15, 2023
- [Notice] Huawei Cloud DDS 4.4 Will Be Released Commercially on Oct 08, 2023
- Version Description
- Product Release Notes
-
Service Overview
- Infographics
- What Is DDS?
- Advantages
- Comparison Between DDS and On-Premises Databases
- Typical Application Scenarios
- Functions and Features
- System Architecture
- Instances
- Notes and Constraints
- Pricing Details
- Basic Concepts
- Compatibility
- Security
- Permissions
- Related Services
- Mapping Between DDS Versions and Community Versions
- Billing
-
Getting Started
- Overview
- Getting Started with Clusters
-
Getting Started with Replica Sets
- Buying a Replica Set Instance
- Connecting to a Replica Set Instance
- Getting Started with Single Nodes
- Logging In to and Logging Out of the DDS Console
- Example: Buying and Connecting to a DDS Instance
- Getting Started with Common Practices
-
User Guide
- Data Migration
- Performance Tuning
- Permissions Management
- Instance Lifecycle Management
-
Instance Modifications
- Changing an Instance Name
- Changing an Instance Description
- Modifying an Instance Tag
- Changing the Name of the Replica Set in the Connection Address
- Upgrading a Minor Engine Version
- Upgrading a Major Engine Version
- Scaling Up Storage Space
- Changing an Instance Class
- Changing Cluster Instance Nodes
- Changing Replica Set Instance Nodes
- Configuring the Maintenance Window
- Changing an AZ
- Updating the OS of a DB Instance
-
Data Backups
- Backup Principles and Solutions
- Configuring an Automated Backup Policy
- Configuring an Incremental Backup Policy
- Configuring the Cross-Region Backup Policy
- Setting Backup Method for a DB Instance
- Creating a Manual Backup
- Deleting a Manual Backup
- Deleting an Automated Backup
- Stopping a Backup
- Downloading a Backup File
-
Data Restorations
- Solutions
- Restoring Data to a New Instance
- Restoring Data to the Original Instance
- Restoring Data to a Point in Time
- Restoring Data to an On-Premises Database
- Restoring Data of Enhanced Edition
-
Parameter Template Management
- Overview
- Creating a Parameter Template
- Modifying DDS DB Instance Parameters
- Viewing Parameter Change History
- Exporting a Parameter Template
- Comparing Parameter Templates
- Replicating a Parameter Template
- Resetting a Parameter Template
- Applying a Parameter Template
- Viewing Application Records of a Parameter Template
- Modifying the Description of a Parameter Template
- Deleting a Parameter Template
- Connection Management
- Database Usage
- Data Security
- Monitoring and Alarm Reporting
- Auditing
- Logs
- Task Center
- DBA Assistant
- SQL Execution Control
- Cross-AZ Disaster Recovery
- Billing
- Tags
- Quotas
- DDS Usage Suggestions
- Developer Guide
-
Best Practices
- Overview
- Security Best Practices
- Common Methods for Connecting to a DDS Instance
- From Other Cloud MongoDB to DDS
- From On-Premises MongoDB to DDS
- From ECS-hosted MongoDB to DDS
- How Do Replica Sets Achieve High Availability and Read/Write Splitting?
- Sharding
- How Do I Improve DDS Performance by Optimizing SQL Statements?
- How Do I Prevent the dds mongos Cache Problem?
- How Do I Solve the High CPU Usage Issue?
- How Do I Troubleshoot High Memory Usage of DDS DB Instances?
- What Can I Do If the Number of Connections of an Instance Reaches Its Maximum?
- Creating a User and Granting the Read-Only Permission to the User
- Proper Use of Data Definition Languages (DDL) Statements
- How Is a DDS Node Going to Be Disconnected and What Can I Do?
- Security White Paper
- Performance White Paper
-
API Reference
- Before You Start
- API Overview
- Calling APIs
- Getting Started
-
APIs V3.0 (Recommended)
- Querying the API Version
- Querying Database Version Information
- Querying Database Specifications
- Querying the Database Disk Type
-
DB Instance Management
- Creating a DB Instance
- Restarting a DB Instance
- Deleting a DB Instance
- Querying Instances and Details
- Scaling Up Storage Space
- Adding Nodes for a Cluster Instance
- Modifying DB Instance Specifications
- Performing a Primary/Secondary Switchover in a Replica Set Instance
- Enabling or Disabling SSL
- Modifying a DB Instance Name
- Changing an Instance Description
- Changing a Database Port
- Changing a Security Group
- Binding an EIP
- Unbinding an EIP
- Changing a Private IP Address
- Creating Shard or Config IP Addresses of a Cluster Instance
- Configuring Cross-CIDR Access for a Replica Set
- Querying AZs to Which an Instance Can Be Migrated
- Migrating a DB Instance to Another AZ
- Setting the Recycle Bin Policy
- Adding Nodes to a Replica Set Instance
- Adding a Read Replica to an Instance
- Upgrading the Database Patch
- Enabling or Disabling Monitoring by Seconds
- Querying Second-Level Monitoring Configurations
- Configuring the Maintenance Window
- Querying the Recycling Policy of a DB Instance
- Querying DB Instances in the Recycle Bin
- Checking for Weak Passwords
- Querying the Estimated Database Patch Upgrade Duration
- Querying Instance Disk Information
- Obtaining the SSL Certificate Download Address
- Querying the Name of the Replica Set in the Connection Address
- Changing the Name of the Replica Set in the Connection Address
- Deleting Instance Nodes
- Deleting a Read Replica of an Instance
- Querying Access Across CIDR Blocks for a Replica Set Instance
- Querying LTS Log Configurations
- Associating an Instance with an LTS Log Stream
- Disassociating an Instance from an LTS Log Stream
- Configuring an Autoscaling Policy for Storage Space
- Querying the Autoscaling Policy of Storage Space
- Upgrading the Minor Versions of DB Instances in Batches
- Connection Management
-
Backup and Restoration
- Creating a Manual Backup
- Deleting a Manual Backup
- Querying the Backup List
- Querying an Automated Backup Policy
- Setting an Automated Backup Policy
- Restoring Data to a New DB Instance
- Obtaining the Link for Downloading a Backup File
- Querying the Restoration Time Ranges
- Obtaining the List of Databases That Can Be Restored
- Obtaining the List of Database Collections That Can Be Restored
- Restoring Data to the Original DB Instance
- Restoring Databases and Tables to a Point in Time
- Stopping a Backup
- Deleting Manual Backups in Batches
-
Parameter Configuration
- Obtaining Parameter Templates
- Creating a Parameter Template
- Deleting a Parameter Template
- Obtaining Details About a Parameter Template
- Modifying a Parameter Template
- Applying a Parameter Template
- Obtaining Parameters of a Specified DB Instance
- Modifying Parameters of a Specified DB Instance
- Querying Available DB Instances
- Viewing Application Records of a Parameter Template
- Viewing Parameter Change History
- Comparing Parameter Templates
- Replicating a Parameter Template
- Resetting a Parameter Template
- Checking Whether a Parameter Template Name Is Unique
- Viewing Parameter Change History of an Instance
-
Log Information Queries
- Querying Database Slow Logs (New)
- Obtaining Links for Downloading Slow Query Logs
- Showing Original Slow Logs
- Querying Database Error Logs (New)
- Obtaining Links for Downloading Error Logs
- Configuring SQL Audit
- Querying SQL Audit Policy
- Obtaining the Audit Log List
- Obtaining Links for Downloading Audit Logs
- Querying the Switch of Show Original Log
- Deleting Audit Logs
- Tag Management
-
Managing Databases and Users
- Creating a Database User
- Creating a Database Role
- Querying Details About Database Users
- Querying the Database Role List
- Changing the Password of a Database User
- Checking the Password for Logging In to a Database
- Querying Cluster Balancing Settings
- Enabling or Disabling Cluster Balancing
- Setting the Activity Time Window for Cluster Balancing
- Deleting a Database User
- Deleting a Database Role
- Querying Databases
- Quota Management
- Database O&M
- Task Management
- API V3 (Unavailable Soon)
- Examples
- Permissions Policies and Supported Actions
- Appendix
- SDK Reference
-
FAQs
-
Product Consulting
- What Is the Relationship Between DDS and MongoDB Community Edition?
- Q&A About Switching Storage Engine to RocksDB for DDS 4.2 and Later Versions
- What Are the Differences Between DDS and GeminiDB Mongo?
- What Precautions Should Be Taken When Using DDS?
- What Is the Availability of DDS DB Instances?
- Will My DDS DB Instances Be Affected by Other Users' DDS DB Instances?
- Does DDS Support Multi-AZ Deployment?
- Can I Change the VPC for a Created Instance?
- Can I Change the Region for a Created Instance?
- What Is Hidden Node?
- What Are Logical Sessions?
- Database Versions
- Resource Freezing, Release, Deletion, and Unsubscription
-
Resource and Disk Management
- Which Items Occupy the Storage Space of DDS Instances?
- Which Types of Logs and Files Occupy DDS DB Instance Storage Space?
- Why Is the Storage Space Usage Displayed on the GUI Smaller Than the Actual Usage?
- Why Does Available Disk Space Not Increase After Data Is Deleted?
- Why Is the Resident Memory of a 4 vCPUs/8 GB Memory Replica Set Instance Only 4 GB?
- Capacity Expansion and Specification Changes
-
Database Performance
- When Will a Primary/Standby Switchover Be Triggered for a Cluster or Replica Set?
- High Storage Usage
- What Is the Time Delay for Primary/Secondary Synchronization in a Replica Set?
- How Is Data Transferred Between the Primary and Secondary Nodes of a Replica Set?
- How Do I Clear an Alarm Saying the Shard Memory Usage Exceeds 90%?
- What Can I Do If a Query Error Is Reported After Data Is Written Into the DDS Cluster?
- Database Permissions
-
Creation and Deletion
- How Do I Select Instance Specifications and Nodes?
- Why Is an Instance Not Displayed on the Console After It Is Created?
- Can I Use a Template to Create DDS DB Instances?
- Why Is Data Missing from My Database?
- Will My Backups Be Deleted If I Delete My Cloud Account?
- What Are the Differences Between Instance Deletion and Unsubscription?
-
Database Connection
- What Should I Do If I Fail to Connect to a DDS Instance?
- What Can I Do If the Number of Connections of an Instance Reaches Its Maximum?
- How Do I Query and Limit the Number of Connections?
- What Should I Do If the ECS and DDS Are Deployed in Different VPCs and They Cannot Communicate with Each Other?
- Do Applications Need to Support Automatic Reconnecting to the DDS Database?
- How Do I Create and Log In to an ECS?
- Installing a Client
- Database Usage
- Database Migration
- Database Storage
- Database Parameters
- Backup and Restoration
- Network Security
- Monitoring and Alarm
-
Product Consulting
-
Troubleshooting
- Overview
- DDS Instance Node Fault Handling Mechanism
- Connection Failure Message: network error while attempting to run command 'isMaster'
- Connection Failure Messages: No route to host and connection attempt failed
- Connection Failure Message: Authentication failed
- Connection Failure Message: couldn't connect to server
- Connection Failure Message: cannot list multiple servers in URL without 'replicaSet' option
- Connection Failure Message: Timeout while receiving message
- Connection Failure Message: exception: login failed and U_STRINGPREP_PROHIBITED_ERROR
- Change History
- Videos
- Glossary
-
More Documents
-
User Guide (ME-Abu Dhabi Region)
- Introduction
- Logging In to the DDS Console
- Getting Started with Clusters
- Getting Started with Replica Sets
- Connection Management
- Migrating Data
- Account Management
-
Instance Management
- Changing a DB Instance Name
- Adding Cluster Instance Nodes
- Reverting Cluster Instance Nodes
- Scaling Up Storage Space
- Changing the CPU or Memory of a Cluster DB Instance
- Changing the CPU or Memory of a Replica Set DB Instance
- Manually Switching the Primary and Secondary Nodes of a Replica Set
- Exporting DB Instance Information
- Restarting a DB Instance or a Node
- Deleting a DB Instance
- Recycling a DB Instance
- Backup and Restore
- Parameter Group Settings
- Task Center
- Monitoring and Alarm Reporting
- Auditing
- Log Management
- Tag
-
FAQs
- Product Consulting
- Database Performance
- Creation and Deletion
-
Database Connection
- Can an External Server Access the DDS DB Instance?
- What Is the Number of DDS Database Connections?
- What Should I Do If an ECS Cannot Connect to a DDS DB Instance?
- What Should I Do If a Database Client Problem Causes a Connection Failure?
- What Should I Do If a DDS Server Problem Causes a Connection Failure?
- How Can My Applications Access a DDS DB Instance in a VPC?
- Do Applications Need to Support Automatic Reconnecting to the DDS Database?
- How Do I Create and Log In to an ECS?
- How Can I Install a MongoDB Client?
- How Do I Install Robo 3T?
- Database Usage
- Database Storage
- Database Parameter Modification
- Backup and Restoration
- Network Security
- Resource Monitoring
- Log Management
- Which Commands are Supported or Restricted by DDS?
- Change History
-
API Reference (ME-Abu Dhabi Region)
- Before You Start
- API Overview
- Calling APIs
- Getting Started
-
API Description
- Querying the API Version
- Querying Database Version Information
- Querying All DB Instance Specifications
-
DB Instance Management
- Creating a DB Instance
- Restarting a DB Instance
- Deleting a DB Instance
- Querying DB Instances
- Scaling Up Storage Space
- Adding Nodes for a Cluster Instance
- Modifying DB Instance Specifications
- Performing a Primary/Secondary Switchover in a Replica Set Instance
- Enabling or Disabling SSL
- Modifying a DB Instance Name
- Changing a Database Port
- Changing a Security Group
- Binding an EIP
- Unbinding an EIP
- Changing a Private IP Address
- Backup and Restoration
- Tag Management
- Permissions Policies and Supported Actions
- Appendix
- Change History
-
User Guide (Paris Region)
- Introduction
- Logging In to the DDS Console
- Getting Started with Clusters
- Getting Started with Replica Sets
- Connection Management
- Migrating Data
- Account Management
-
Instance Management
- Changing a DB Instance Name
- Adding Cluster Instance Nodes
- Reverting Cluster Instance Nodes
- Scaling Up Storage Space
- Changing the CPU or Memory of a Cluster DB Instance
- Changing the CPU or Memory of a Replica Set DB Instance
- Manually Switching the Primary and Secondary Nodes of a Replica Set
- Exporting DB Instance Information
- Restarting a DB Instance or a Node
- Deleting a DB Instance
- Backup and Restore
- Parameter Group Settings
- Task Center
- Monitoring and Alarm Reporting
- Auditing
- Log Management
- Tag
-
FAQs
- Product Consulting
- Database Performance
- Creation and Deletion
-
Database Connection
- Can an External Server Access the DDS DB Instance?
- What Is the Number of DDS Database Connections?
- What Should I Do If an ECS Cannot Connect to a DDS DB Instance?
- What Should I Do If a Database Client Problem Causes a Connection Failure?
- What Should I Do If a DDS Server Problem Causes a Connection Failure?
- How Can My Applications Access a DDS DB Instance in a VPC?
- Do Applications Need to Support Automatic Reconnecting to the DDS Database?
- How Do I Create and Log In to an ECS?
- How Can I Install a MongoDB Client?
- How Do I Install Robo 3T?
- Database Usage
- Database Storage
- Database Parameter Modification
- Backup and Restoration
- Network Security
- Log Management
- Which Commands are Supported or Restricted by DDS?
- Change History
-
API Reference (Paris Region)
- Before You Start
- API Overview
- Calling APIs
- Getting Started
-
API Description
- Querying the API Version
- Querying Database Version Information
- Querying All DB Instance Specifications
-
DB Instance Management
- Creating a DB Instance
- Restarting a DB Instance
- Deleting a DB Instance
- Querying DB Instances
- Scaling Up Storage Space
- Adding Nodes for a Cluster Instance
- Modifying DB Instance Specifications
- Performing a Primary/Secondary Switchover in a Replica Set Instance
- Enabling or Disabling SSL
- Modifying a DB Instance Name
- Changing a Database Port
- Changing a Security Group
- Binding an EIP
- Unbinding an EIP
- Changing a Private IP Address
- Backup and Restoration
- Appendix
- Change History
-
User Guide (Kuala Lumpur Region)
- Introduction
- Logging In to the DDS Console
- Getting Started with Clusters
- Getting Started with Replica Sets
- Connection Management
- Migrating Data
- Account Management
-
Instance Management
- Changing a DB Instance Name
- Adding Cluster Instance Nodes
- Reverting Cluster Instance Nodes
- Scaling Up Storage Space
- Changing the CPU or Memory of a Cluster DB Instance
- Changing the CPU or Memory of a Replica Set DB Instance
- Manually Switching the Primary and Secondary Nodes of a Replica Set
- Exporting DB Instance Information
- Restarting a DB Instance or a Node
- Deleting a DB Instance
- Recycling a DB Instance
- Backup and Restore
- Parameter Group Settings
- Task Center
- Monitoring and Alarm Reporting
- Auditing
- Log Management
- Tag
-
FAQs
- Product Consulting
- Database Performance
- Creation and Deletion
-
Database Connection
- Can an External Server Access the DDS DB Instance?
- What Is the Number of DDS Database Connections?
- What Should I Do If an ECS Cannot Connect to a DDS DB Instance?
- What Should I Do If a Database Client Problem Causes a Connection Failure?
- What Should I Do If a DDS Server Problem Causes a Connection Failure?
- How Can My Applications Access a DDS DB Instance in a VPC?
- Do Applications Need to Support Automatic Reconnecting to the DDS Database?
- How Do I Create and Log In to an ECS?
- How Can I Install a MongoDB Client?
- How Do I Install Robo 3T?
- Database Usage
- Database Storage
- Database Parameter Modification
- Backup and Restoration
- Network Security
- Resource Monitoring
- Log Management
- Which Commands are Supported or Restricted by DDS?
- Change History
-
API Reference (Kuala Lumpur Region)
- Before You Start
- API Overview
- Calling APIs
- Getting Started
-
API Description
- Querying the API Version
- Querying Database Version Information
- Querying All DB Instance Specifications
-
DB Instance Management
- Creating a DB Instance
- Restarting a DB Instance
- Deleting a DB Instance
- Querying DB Instances
- Scaling Up Storage Space
- Adding Nodes for a Cluster Instance
- Modifying DB Instance Specifications
- Performing a Primary/Secondary Switchover in a Replica Set Instance
- Enabling or Disabling SSL
- Changing the Administrator Password
- Modifying a DB Instance Name
- Changing a Database Port
- Changing a Security Group
- Binding an EIP
- Unbinding an EIP
- Changing a Private IP Address
- Backup and Restoration
- Tag Management
- Permissions Policies and Supported Actions
- Appendix
- Change History
-
User Guide (ME-Abu Dhabi Region)
- General Reference
Copied.
Connecting to a Replica Set Instance Over Public Networks
Scenarios
This section describes how to connect to a replica set instance using the MongoDB client and Robo 3T over public networks.
You can directly perform operations on the primary and secondary nodes. Primary nodes are used for processing read and write requests. Secondary nodes replicate data from the primary and are used for processing read requests only.
The MongoDB client and Robo 3T can connect to a DB instance with a common connection or an encrypted connection (SSL). To improve data transmission security, you are advised to connect to DB instances using the SSL connection.
Different OS scenarios: The following uses Linux ECS and Window client as an example.
Prerequisites
- Bind an EIP to the cluster instance and set security group rules to ensure that the EIP can be accessed through the ECS or Robo 3T.
- Install the MongoDB client or Robo 3T.
- For details on how to create and log in to an ECS, see "Creating and Logging In to a Windows ECS" or "Creating and Logging In to a Linux ECS" in the Elastic Cloud Server User Guide.
- Install the MongoDB client on the ECS.
For details on how to install a MongoDB client, see How Can I Install a MongoDB Client?
Robo 3T
For details on how to install Robo 3T, see How Do I Install Robo 3T?
- If you select SSL mode, download the SSL certificate on the DDS console.
- On the Instance Management page, click the target DB instance.
- In the navigation pane on the left, choose Connections.
- In the Basic Information area, click next to the SSL field.
Connecting to a DB Instance Using Robo 3T (SSL)
- Run the installed Robo 3T. On the displayed dialog box, click Create.
Figure 1 Connections
- In the Connection Settings dialog box, set the parameters of the new connection.
- On the Connection tab, enter the name of the new connection in the Name text box and enter the EIP and database port that are bound to the replica set instance in the Address text box.
Figure 2 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 3 Authentication
- On the SSL tab, upload the SSL certificate and select Allowed for Invalid Hostnames.
Figure 4 SSL
- Click Save.
- On the Connection tab, enter the name of the new connection in the Name text box and enter the EIP and database port that are bound to the replica set instance in the Address text box.
- On the MongoDB Connections page, click Connect to connect to the replica set instance.
Figure 5 Connections
- If the replica set instance is successfully connected, the page shown in Figure 6 is displayed.
Connecting to a DB Instance Using Robo 3T (Non-SSL)
If you connect to a DB instance using this method, you need to disable the SSL connection. For details, see section Disabling SSL.
- Run the installed Robo 3T. On the displayed dialog box, click Create.
Figure 7 Connections
- In the Connection Settings dialog box, set the parameters of the new connection.
- On the Connection tab, enter the name of the new connection in the Name text box and enter the EIP and database port that are bound to the replica set instance in the Address text box.
Figure 8 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 9 Authentication
- Click Save.
- On the Connection tab, enter the name of the new connection in the Name text box and enter the EIP and database port that are bound to the replica set instance in the Address text box.
- On the MongoDB Connections page, click Connect to connect to the replica set instance.
Figure 10 Connections
- If the replica set instance is successfully connected, the page shown in Figure 11 is displayed.
Connecting to a DB Instance Using the MongoDB Client (SSL)
- On the Instance Management page, click the target DB instance.
- In the navigation pane on the left, choose Connections.
- In the Basic Information area, click next to the SSL field.
- Upload the root certificate to the ECS to be connected to the DB instance.
The following describes how to upload the certificate to a Linux and Window ECS:
- In Linux, run the following command:
scp <IDENTITY_FILE> <REMOTE_USER>@<REMOTE_ADDRESS>:<REMOTE_DIR>NOTE:
- IDENTITY_FILE indicates the directory where the root certificate locates. The file access permission is 600.
- REMOTE_USER indicates the ECS OS user.
- REMOTE_ADDRESS indicates the ECS address.
- REMOTE_DIR indicates the directory of the ECS to which the root certificate is uploaded.
- In Windows, upload the root certificate using the remote connection tool.
- In Linux, run the following command:
- Connect to the DB instance in the directory where the MongoDB client is located.
- Method 1: Using Linux commands
./mongo --host <DB_HOST> --port <DB_PORT> -u <DB_USER> -p --authenticationDatabase admin --ssl --sslCAFile <FILE_PATH> --sslAllowInvalidHostnames
Enter the database account password when prompted:
Enter password:
- Method 2: Using the public connection address
./mongo "mongodb://rwuser:****@<DB_HOST>:<DB_PORT>/test?authSource=admin&replicaSet=replica" --ssl --sslCAFile <FILE_PATH> --sslAllowInvalidHostnames
To obtain the public connection address, click the instance name and choose Connections. The address is displayed in Public Network Connection Address field on the Public Connection tab.
NOTE:- A replica set instance uses the management IP address to generate SSL certificate. --sslAllowInvalidHostnames is needed for the SSL connection through a public network.
- DB_HOST indicates the IP address of the remotely connected DB instance. Obtain the value from the EIP column in the node list on the Connections page.
- DB_PORT indicates the port number. Obtain the value from Database Port in the Basic Information area on the Connections page.
- DB_USER indicates the database account name. The default value is rwuser.
- **** indicates the password of the database account. If you use the connection address to connect to a DB instance:
- If the password contains the at sign (@), change @ to %40.
- If the password contains the exclamation mark (!), add an escape character (\) before the exclamation mark (!).
- FILE_PATH indicates the path where the root certificate is stored.
- Connect to the instance using Linux commands. The following is an example command:
./mongo --host 192.168.1.6 --port 8635 -u rwuser -p --authenticationDatabase admin --ssl --sslCAFile /tmp/ca.crt --sslAllowInvalidHostnames
- Connect to the DB instance using the public connection address. The following is an example command:
./mongo "mongodb://rwuser:****@192.168.1.80:8635/test?authSource=admin&replicaSet=replica" --ssl --sslCAFile /tmp/ca.crt --sslAllowInvalidHostnames
- Method 1: Using Linux commands
- Check the connection result. If the following information is displayed, the connection is successful.
- Result from connecting the primary node in a replica set:
replica:PRIMARY>
- Result from connecting the secondary node in a replica set:
replica:SECONDARY>
- Result from connecting the primary node in a replica set:
Connecting to a DB Instance Using the MongoDB Client (Non-SSL)
If you connect to a DB instance using this method, you need to disable the SSL connection. For details, see section Disabling SSL.
- Connect to the ECS.
- Connect to a DDS DB instance.
- Method 1: Using Linux commands
./mongo --host <DB_HOST> --port <DB_PORT> -u <DB_USER> -p --authenticationDatabase admin
Enter the database account password when prompted:
Enter password:
- Method 2: Using the public connection address
./mongo "mongodb://rwuser:****@<DB_HOST>:<DB_PORT>/test?authSource=admin&replicaSet=replica"
To obtain the public connection address, click the instance name and choose Connections. The address is displayed in Public Network Connection Address field on the Public Connection tab.
NOTE:- DB_HOST indicates the IP address of the remotely connected DB instance. Obtain the value from the EIP column in the node list on the Connections page.
- DB_PORT indicates the port number. Obtain the value from Database Port in the Basic Information area on the Connections page.
- DB_USER indicates the database account name. The default value is rwuser.
- **** indicates the password of the database account. If you use the connection address to connect to a DB instance:
- If the password contains the at sign (@), change @ to %40.
- If the password contains the exclamation mark (!), add an escape character (\) before the exclamation mark (!).
- Connect to the instance using Linux commands. The following is an example command:
./mongo --host 192.168.1.6 --port 8635 -u rwuser -p --authenticationDatabase admin
- Connect to the DB instance using the public connection address. The following is an example command:
./mongo "mongodb://rwuser:****@192.168.1.80:8635/test?authSource=admin&replicaSet=replica"
- Method 1: Using Linux commands
- Check the connection result. If the following information is displayed, the connection is successful.
- Result from connecting the primary node in a replica set:
replica:PRIMARY>
- Result from connecting the secondary node in a replica set:
replica:SECONDARY>
- Result from connecting the primary node in a replica set:
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