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/ GaussDB/ FAQs/ Database Connections/ What Should I Do If I Can't Connect to My GaussDB Instance?

What Should I Do If I Can't Connect to My GaussDB Instance?

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

Problem Analysis

Locate the fault by considering the following aspects:

  1. Check whether the DB instance is available.

    For example, the system is faulty, the DB instance is abnormal, or the DB instance or a table is locked.

  2. (Common) Check whether the client connection is correct.
    • If you connect to an instance over a private network, ensure that the instance and ECS are in the same region and VPC.
    • If you connect to an instance over a public network, bind an EIP to the instance and then connect to the instance through the EIP. If no EIP is available, buy one first.
  3. Check whether the parameters in the connection command are correct.

    Check whether the following parameters are configured correctly: connection address, port number, username, and password.

  4. (Common) Check whether the network connectivity is normal.
    For a private network connection:
    1. Ensure that the ECS and GaussDB instance are in the same region and VPC.
    2. Check security group rules.

      To access GaussDB instances in a security group from a public network, add an inbound rule.

    3. On the ECS, check whether the GaussDB instance port can be connected.
    For a public network connection:
    1. Check security group rules.

      To access GaussDB instances in a security group from a public network, add an inbound rule.

    2. Check network ACL rules.
    3. Ping the ECS to the instance in the same region.
  5. (Common) Check whether the DB instance is in the Storage full state.

    If the DB instance is in the Storage full state, data read and write performance is affected.

  6. View common connection error messages.

    Find corresponding solutions based on connection error messages.

Troubleshooting Process

Figure 1 Locating instance connection failures
  1. Check whether the DB instance is available.

    Check method: Check whether the DB instance is in the Available state.

    Possible cause: If the system is faulty, the DB instance is abnormal, or the DB instance or a table is locked.

    Solution: If the DB instance is abnormal, reboot it.

    Figure 2 Checking DB instance status
  2. Check whether the client connection is correct.

    For details about how to connect to a DB instance over a private or public network, see Can an External Server Access GaussDB Instances?

    Table 1 Connection methods

    Connect Through

    Description

    Example

    Private network

    A private IP address is provided by default.

    If your applications are deployed on an ECS that is in the same region and VPC as your DB instance, use a private IP address to connect to the ECS and the DB instance.

    For example, to connect to the postgres database, run the following command:

    gsql -d postgres -h 10.0.0.0 -U root -p 8000

    NOTE:

    postgres indicates the database name, 10.0.0.0 indicates the CN IP address of a distributed DB instance or the primary DN IP address of a centralized DB instance, root is the username for logging in to the database, and 8000 is the port number of the CN.

    Public network

    If you cannot access a GaussDB instance over a private IP address, bind an EIP to the GaussDB instance and connect it to the ECS (or a host from the public network) over the EIP.

    For example, to connect to the postgres database, run the following command:

    gsql -d postgres -h 10.0.0.0 -U root -p 8000

    NOTE:

    postgres is the name of the database to be connected; 10.0.0.0 is the EIP bound to the DB instance; root is the username for logging in to the database; 8000 is the port number of the DB instance.

  3. Check whether the parameters in the connection command are correct.

    Ensure that the connection address, port, username, and password are correct, and try to connect to the instance again.

    Connection through a private network
    1. Connection address

      Private IP Address in the Node List area of the Basic Information page of the target instance

    2. Database port

      Database Port of the target instance

    3. Username and password

      User root and its password

    Connection through a public network
    1. Connection address

      EIP in the Node List area of the Basic Information page of the target instance

    2. Database port

      Database Port of the target instance

    3. Username and password

      User root and its password

  4. Check the network connection.
    Private network connection
    1. Check whether the ECS and GaussDB instance are in the same region and VPC.
      • The ECSs and instances in different regions cannot communicate with each other. To reduce network latency, deploy your DB instance in the region nearest to your workloads.
      • Perform the following operations in different VPCs:
        • Change the VPC hosting the ECS to the same as that hosting the GaussDB instance.
        • Create a VPC peering connection to set up a network connection between the two VPCs.
      Figure 3 Viewing the VPC of an ECS
      Figure 4 Viewing the VPC of a GaussDB instance

    2. Check security group rules.
      • If Destination is not 0.0.0.0/0 and Protocol & Port is not All on the Outbound Rules page of the ECS, add the private IP address and port of the GaussDB instance to the outbound rules.
      • If Source is not 0.0.0.0/0 and Protocol & Port is not All on the Inbound Rules page of the GaussDB instance, add the IP address and port of the ECS to the inbound rules.
    3. On the ECS, check whether the GaussDB instance port can be connected.
      telnet <IP address> <port number>
      • If the ECS can connect to the DB instance, the network between them is normal.
      • If the ECS cannot connect to the DB instance, choose Service Tickets > Create Service Ticket in the upper right corner of the management console to submit a service ticket for help.
    Public network connection
    1. Check security group rules.
      • If Destination is not 0.0.0.0/0 and Protocol & Port is not All on the Outbound Rules page of the ECS, add the public IP address and port of the GaussDB instance to the outbound rules.
      • If Source is not 0.0.0.0/0 and Protocol & Port is not All on the Inbound Rules page of the GaussDB instance, add the IP address and port of the ECS to the inbound rules.
    2. Check network ACL rules.
      1. Go to the Network ACLs page.
      2. Check whether the NIC bound to the EIP is in the subnet associated with the network ACL.
      3. Check whether the network ACL is enabled.

        If it is enabled, add an ICMP rule to allow traffic.

      The default network ACL rule denies all inbound and outbound packets. This default rule is still applied even if the network ACL is disabled.

    3. Ping the ECS to the instance in the same region.

      If you cannot ping the EIP on the original ECS, select another ECS in the same region and ping the EIP again. If the ping is successful, the virtual network is functional. In this case, choose Service Tickets > Create Service Ticket in the upper right corner of the management console to submit a service ticket for help.

  5. Check whether the DB instance is in the Storage full state.

    Check method: View the storage space usage on the console or Cloud Eye.

    • On the management console

      Locate the target instance and click its name to go to the Basic Information page. In the Storage & Backup area, view the storage space usage.

    • On Cloud Eye

      Locate the target instance and click View Metric in the Operation column. On the displayed page, view the storage space usage.

      Possible cause: If the kernel system detects that the disk usage exceeds the specified threshold, the instance is set to read-only and no data can be written to the DB instance.

      Solution: See Scaling Up Storage Space.

  6. View common connection error messages.

    When you run commands to connect to a DB instance, the possible error and solution are provided in the following:

    gsql: ERROR: dn_6001_6002_6003: Invalid username/password,login denied.

    If this error message is displayed when you attempt to connect to a GaussDB instance, check whether the username or password is correct.

  7. If the problem persists, create a service ticket to contact customer service for help.

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