Dealing with Database Instance connectivity issues
Public accessLink to this anchor
ProblemLink to this anchor
I cannot connect to my Database Instance through the public network.
Possible causesLink to this anchor
- The Database Instance TLS certificate is outdated
- Your allowed IPs are not properly configured
- You have reached the maximum number of connections
- The Database Instance is experiencing instabilities due to a high load
SolutionLink to this anchor
You can check the following points to identify and act on what might be causing the issue:
-
If TLS is enabled on the Database Instance, make sure the certificate is up to date, and that your client application is properly configured.
-
Make sure your ACLs are properly configured.
-
Make sure your Database Instance has not reached the maximum number of connections stipulated in the advanced settings of the Database Instance. You can monitor the number of connections on Cockpit. You can also adjust the advanced settings to accept a higher number of connections.
-
Monitor other usage metrics on Cockpit to:
- Check if the memory usage is nominal. High memory usage could trigger OOM Kills and cause disconnection
- Check Database Instance logs and look for anything else that could explain the issue
Private accessLink to this anchor
ProblemLink to this anchor
I cannot connect to my Database Instance through a Private Network.
Possible causesLink to this anchor
- The Database Instance TLS certificate is outdated
- Client network issue
- You have reached the maximum number of connections
- The Database Instance is experiencing instabilities due to a high load
SolutionLink to this anchor
You can carry out the following actions:
-
Try to connect to the Database Instance from the public endpoint, if one is available, to identify the possible origin (network or instance). This information can help you or the support team to identify the issue.
-
Use Cockpit to check database logs and look for any activity or behavior that could explain the issue.
-
Create a support ticket if the first two steps do not help troubleshoot the issue. In the body of the ticket, make sure you provide:
- The resource ID of resource from which the connection was attempted
- The output of the
rdb_troubleshoot.sh
script, indicated below. Make sure you execute the script on the machine from which the connection was attempted.
Database Instance connectivity check script
rdb_troubleshoot.sh
:
#!/bin/bashset -o nounsetif [ -z "$INSTANCE_IP" ]; thenecho "INSTANCE_IP is a mandatory environment variable."echo "e.g. export INSTANCE_IP=<xxx.xxx.xxx.xxx>"exit 1fiif [ -z "$INSTANCE_PORT" ]; thenecho "INSTANCE_PORT is a mandatory environment variable."echo "e.g. export INSTANCE_PORT=<xxxxx>"exit 1fifunction header() {echo -e "\n # ${1}"echo -e "---------------------------------\n"}echo -e "\nRDB troubleshooting script\nThis script will run for several minutes to get enough information."header "Host information"if ! [ -x "$(command -v uname)" ]; thenecho 'Skipped: uname command is not availabe.'elseuname -afiheader "Host connectivity check"if ! [ -x "$(command -v ping)" ]; thenecho 'Skipped: ping command is not availabe.'elseping -c 5 ${INSTANCE_IP}fiheader "Database connectivity check"if ! [ -x "$(command -v telnet)" ]; then# try to fallback on curl telnetif ! [ -x "$(command -v curl)" ]; thenecho "Skipped: neither telnet nor curl command are availabe."elseecho "(using curl)"timeout 2 curl -v telnet://$INSTANCE_IP:$INSTANCE_PORTfielseecho "(using telnet)"echo -n | telnet ${INSTANCE_IP} ${INSTANCE_PORT}fiheader "Ip configuration check"if ! [ -x "$(command -v ip)" ]; thenecho 'Skipped: ip command is not availabe.'elseecho -e "Interfaces:\n- \n"ip aecho -e "\nNeighbour:\n- \n"TEST_ITERATION=30TEST_INTERVAL=10 # seconds# Iterate a few times to try to catch relevant infofor ((i=1;i<=$TEST_ITERATION;i++)); doecho -e "\nIteration $i:\n"ip neighbour showecho -e "\nWaiting ${TEST_INTERVAL}s...\n"sleep $TEST_INTERVALdoneecho -e "\nRoute:\n-\n"ip routefi
Run the script in a terminal:
export INSTANCE_IP=<xxx.xxx.xxx.xxx>export INSTANCE_PORT=<xxxxx>./troubleshoot.sh