What Should I Do If I Can't Connect to My GaussDB Instance?
Problem Analysis
Locate the fault by considering the following aspects:
- 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.
- (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.
- 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.
- (Common) Check whether the network connectivity is normal.
For a private network connection:
- Ensure that the ECS and GaussDB instance are in the same region and VPC.
- Check security group rules.
To access GaussDB instances in a security group from a public network, add an inbound rule.
- On the ECS, check whether the GaussDB instance port can be connected.
For a public network connection:- Check security group rules.
To access GaussDB instances in a security group from a public network, add an inbound rule.
- Check network ACL rules.
- Ping the ECS to the instance in the same region.
- (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.
- View common connection error messages.
Find corresponding solutions based on connection error messages.
Troubleshooting Process
- 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
- 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.
- 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 - Check the network connection.
Private network connection
- 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
- 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.
- 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- 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.
- Check network ACL rules.
- Go to the Network ACLs page.
- Check whether the NIC bound to the EIP is in the subnet associated with the network ACL.
- 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.
- 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.
- Check whether the ECS and GaussDB instance are in the same region and VPC.
- 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.
- On the management console
- 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.
- If the problem persists, create a service ticket to contact customer service for help.
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