Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Document Database Service/ User Guide/ Connection Management/ Enabling IP Addresses of Shard and Config Nodes

Enabling IP Addresses of Shard and Config Nodes

Updated on 2025-02-13 GMT+08:00

A cluster instance for Community Edition consists of dds mongos, shard, and config nodes. When your services need to read and write data from and into databases, connect to the dds mongos node. In certain scenarios (for example, data migration and synchronization between clusters), you need to read data from the shard or config node and will need to obtain the IP address of the corresponding node.

This section describes how to obtain the IP addresses of the shard and config nodes.

Before You Start

  • DDS supports cluster instances of Community Edition 3.4, 4.0 and 4.2.
  • DDS creates two connection addresses for the primary and secondary nodes in a shard group or config group.
  • The network type of the connection address is the same as that of the current dds mongos node.
  • Once the connection addresses are assigned to your nodes, they cannot be changed or deleted.
  • If IPv6 is enabled in a subnet, you cannot enable IP addresses of the shard and config nodes for DB instances created using the subnet.
  • After the shard IP address is enabled, restart the corresponding shard node for the configuration to take effect.
  • After you enable the connection address, you can connect to an instance using Mongo Shell.

Enabling shard IP Address

NOTE:
  • The button for showing shard IP address can only be enabled. It cannot be disabled or modified.
  • Once the shard IP address is enabled, DDS automatically applies for connection addresses for all shard nodes in the current instance.
  • After the shard IP address is enabled and new shard nodes are added, you need to manually locate a newly added shard node and choose More > Show shard IP Address in the Operation column to show the shard IP address.
  • After the shard IP address is enabled, the database user sharduser is created. For details about how to reset the password, see Resetting the Password of User sharduser.
  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 name. The Basic Information page is displayed.
  5. In the Node Information area, click the shard tab.

    Figure 1 shard nodes

  6. Click Show shard IP Address. In the displayed dialog box, enter and confirm the password for connecting to the node.

    Figure 2 Enable shard IP Address

    After the shard IP address is enabled, restart the corresponding shard node for the configuration to take effect.

    In the Node Information area, locate the row that contains the shard node and click Restart in the Operation column to restart the shard node.

    Figure 3 Restarting a shard node

  7. View the private IP address of the shard node.

    After the shard IP address is enabled, you can click next to a shard node on the current page to expand the node drop-down list or click Connections in the navigation pane on the left, and then obtain the private IP address.
    Figure 4 Private IP addresses of shard nodes

    The connection address of the current shard node is as follows:

    mongodb://sharduser:<password>@192.168.xx.xx:8637,192.168.xx.xx:8637/test?authSource=admin&replicaSet=shard_?

    NOTE:
    • sharduser is the username of the current shard node.
    • **** is the password of the current node.
    • 192.168.xx.xx and 192.168.xx.xx are the private IP addresses of the primary and secondary shard nodes.
    • 8637 is the port of the shard node and cannot be changed.
    • shard_? is the name of the shard node to be connected, for example, shard_1.

Resetting the Password of User sharduser

NOTE:

This function is available only after the shard IP address is enabled.

  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 name. The Basic Information page is displayed.
  5. In the Node Information area, click the shard tab.

    Figure 5 shard nodes

  6. Click Reset Password.

    Figure 6 Resetting a password

  7. Enter the new password and click OK.

Enabling config IP Address

NOTE:
  • The button for showing config IP address can only be enabled. It cannot be disabled or modified.
  • Once the config IP address is enabled, DDS automatically applies for connection addresses for all config nodes in the current instance.
  • After the config IP address is enabled, the database user csuser is created. For details about how to reset the password, see Resetting the Password of User csuser.
  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. In the left navigation pane, choose Instances. In the instance list, click the instance name to go to the Basic Information page.
  5. In the Node Information area, click the config tab.

    Figure 7 config nodes

  6. Click Show config IP Address. In the displayed dialog box, enter and confirm the password for connecting to the node.

    Figure 8 Enable config IP Address

    After the config IP address is enabled, the corresponding config node needs to be restarted for the configuration to take effect.

    In the Node Information area, locate the row that contains the config node and click Restart in the Operation column to restart the config node.

    Figure 9 Restarting a config node

  7. View the private IP address of the config node.

    After the config IP address is enabled, you can click next to the node on the current page to expand the node drop-down list or click Connections in the navigation pane on the left, and then obtain the private IP address.
    Figure 10 Private IP addresses of config nodes

    The connection address of the current config node is as follows:

    mongodb://csuser:<password>@192.168.xx.xx:8636/test?authSource=admin

    NOTE:
    • csuser is the username of the current config node.
    • **** is the password of the current node.
    • 192.168.xx.xx is the private IP address of the primary config node.
    • 8636 is the port of the config node and cannot be changed.

Resetting the Password of User csuser

NOTE:

This function is available only after the config IP address is enabled.

  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 name. The Basic Information page is displayed.
  5. In the Node Information area, click the config tab.

    Figure 11 config nodes

  6. Click Reset Password.

    Figure 12 Resetting a password

  7. Enter the new password and click OK.

Follow-up Operations

After the connection addresses of the shard or config nodes are enabled, you can connect to the shard or config nodes using MongoShell. The procedure is similar to that for connecting to a dds mongos node.For details, see Connecting to a Cluster Instance Using Mongo Shell.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback