Halaman ini belum tersedia dalam bahasa lokal Anda. Kami berusaha keras untuk menambahkan lebih banyak versi bahasa. Terima kasih atas dukungan Anda.

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
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/ GeminiDB/ GeminiDB Mongo API/ Best Practices/ Buying and Connecting to a GeminiDB Mongo Instance

Buying and Connecting to a GeminiDB Mongo Instance

Updated on 2024-08-03 GMT+08:00

This section describes how to buy a GeminiDB Mongo instance and uses a Linux ECS as an example to describe how to connect to the instance over a private network.

Step 1: Buy a GeminiDB Mongo Instance

  1. Log in to the management console.
  2. In the service list, choose Databases > GeminiDB Mongo API.
  3. On the Instances page, click Buy DB Instance.
  4. Click Buy DB Instance, select a billing mode, and configure instance parameters. Then, click Next and complete subsequent operations.

    Figure 1 Basic information

    Figure 2 Selecting specifications

    Figure 3 Setting a password

  5. View the purchased GeminiDB Mongo instance.

    Figure 4 Successful purchase

Step 2: Buy an Instance

  1. Log in to the management console.
  2. In the service list, choose Compute > Elastic Cloud Server. On the Elastic Cloud Server console, click Buy ECS.

  3. Configure basic settings and click Next: Configure Network. Make sure that the ECS is in the same region, AZ, VPC, and security group as the GeminiDB Mongo instance you created.

    Figure 5 Basic settings
    Figure 6 Selecting specifications
    Figure 7 Selecting an image

  4. Configure the ECS network and click Next: Configure Advanced Settings. Make sure that the ECS is in the same VPC and security group as the GeminiDB Mongo instance.

    • If security group rules allow access from the ECS, you can connect to the instance using the ECS.
    • If the security group rules do not allow access from the ECS, add an inbound rule to the security group.
    Figure 8 Network settings
    Figure 9 Selecting an EIP

  5. Configure a password for the ECS and click Next: Confirm.

    Figure 10 Advanced settings

  6. Confirm the configurations and click Submit.

    Figure 11 Confirming the configurations

  7. View the purchased ECS.

Step 3: Connect to the GeminiDB Mongo Instance

  1. On the ECS console, log in to the ECS using the remote login option.

    Figure 12 Remote login

  2. Enter the username and password of the ECS.

    Figure 13 Entering the username and password

  3. Install the MongoDB client by referring to How Can I Install a MongoDB Client?
  4. Connect to the instance in the directory where the MongoDB client is located.

    • Connect to a replica set using its connection address (recommended).

      GeminiDB Mongo provides a connection address for each instance on the console. The address includes IP addresses of the primary, standby and hidden nodes and their port numbers. Connecting to a replica set with this method allows access to the primary, standby, and hidden nodes at the same time, so write errors can be avoided after a primary/standby switchover.

      Command format:

      ./mongo "<Connection address>"

      The following is an example command:

      ./mongo "mongodb://rwuser:****@192.168.0.196:8635,192.168.0.67:8635,192.168.0.32:8635/test?authSource=admin&replicaSet=replica"

      Table 1 Required description

      Parameter

      Description

      <Connection address>

      Connection address of the replica set. You can obtain the connection address in either of the following ways:

      In the instance list, locate the replica set and click its name. On the Basic Information page, in the Network Information area, view the connection address beside the Address field.

      Alternatively, click the instance name to go to the Basic Information page. In the navigation pane on the left, choose Connections to obtain the address of the instance.

      • In the preceding command, ***** needs to be replaced with the password of the instance administrator.

        If the password contains at signs (@),exclamation marks (!), or percent signs (%), replace them with hexadecimal URL codes %40, %21, and %25 respectively.

        For example, if the password is ****@%***!, enter URL code is ****%40%25***%21.

      • replica in replicaSet=replica indicates the name of a replica set. All Huawei Cloud GeminiDB Mongo replica sets are named replica here and cannot be changed.
      If information similar to the following is displayed, the connection was successful.
      replica:PRIMARY>
    • Connect to a node of the replica set.

      You can also access a specified node of the replica set using the node private IP address.

      Command format:

      ./mongo --host <DB_HOST> --port <DB_PORT> -u <DB_USER> -p --authenticationDatabase admin

      Example:

      ./mongo --host 192.168.1.6 --port 8635 -u rwuser -p --authenticationDatabase admin

      Table 2 Required description

      Parameter

      Description

      <DB_HOST>

      Private IP address of the primary or standby node of the replica set to be connected.

      • If the primary node is accessed, you can read and write data from and to the replica set.
      • If the standby node is accessed, you can only read data from the replica set.

      You can locate the replica set and click its name to switch to the Basic Information page, and then view the private IP address of the required replica set node in the node list.

      Alternatively, click the instance name to go to the Basic Information page. In the navigation pane on the left, choose Connections and view the private IP address of the node.

      <DB_PORT>

      Database port.

      <DB_USER>

      Username of the instance administrator. The default value is rwuser.

      Enter the password of the database account if the following information is displayed:

      Enter password:

      If information similar to the following is displayed, the connection was successful.

      Connection results if the primary node is connected:

      replica:PRIMARY>

      Connection results if the standby node is connected:

      replica:SECONDARY>

Kami menggunakan cookie untuk meningkatkan kualitas situs kami dan pengalaman Anda. Dengan melanjutkan penelusuran di situs kami berarti Anda menerima kebijakan cookie kami. Cari tahu selengkapnya

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback