Overview
When configuring a data migration task, you can test the database connection. This topic describes the causes of failures and provides corresponding solutions based on different instance types.
Description
When a DTS test connection failure occurs, you need to first connect to the database from the database client, verify the database activity and database connection information. If the database is alive and the connection information is correct, you can use the following method to diagnose the problem.
- User-created database with a public IP address
- User-created database hosted on ECS
- Local database connected through a leased line
- Cloud instance
User-created database with a public IP address
Perform required operations based on the following test results:
Test result 1
Symptom
When you test the connection, use the ping command to test whether the network is disconnected, use the telnet command to test whether the port is disconnected, and whether the JDBC connection is disconnected.
Causes
The database may have access source restrictions, for example, iptables restrictions on the database.
Troubleshooting
Log on to the server where the database is stored and run the iptables- L
command to check whether iptables is set. If you have set iptables, select the DTS IP address segment, open the access restriction of DTS in iptables.
Test result 2
Symptom
When testing the connection, use the ping command to test the network status. Use the telnet command to test whether the port is disconnected and whether the JDBC connection is disconnected.
Causes
SOURCE restrictions may have been imposed on the database port, such as iptables or ACL restrictions on the database port.
Troubleshooting
Based on the region where the destination instance of the migration task is located. DTS IP address segment, in iptables or ACL, remove the restrictions for DTS to access the database.
Test result 3
Symptom
When testing the connection, use the ping command to test that the network is normal, and use the telnet command to test that the port is normal, but the JDBC is disconnected.
Causes
- The possible cause is that the password for the database account or the IP address and Port number of the database are invalid.
- The possible reason is that the database account authorization restricts the connection address.
Troubleshooting
- Check and modify the database connection information.
- Please open all connection addresses.
User-created database hosted on ECS
Perform required operations based on the following test results:
Test result 1
Symptom
When you test the connection, use the ping command to test whether the network is disconnected, use the telnet command to test whether the port is disconnected, and whether the JDBC connection is disconnected.
Causes
iptables may be configured on the ECS instance, which restricts the source of access to the database. Log on to the ECS instance and run the following command to check whether iptables is configured: If the limit entries of iptables are returned, select the DTS IP address segment, release the DTS access restriction in iptables.
iptables -L
Test result 2
Symptom
When testing the connection, use the ping command to test the network status. Use the telnet command to test whether the port is disconnected and whether the JDBC connection is disconnected.
Causes
This problem may occur when ECS instances are associated with security groups.
Troubleshooting
Based on the region where the destination instance of the migration task is located. DTS IP address segment. Log on to the ECS console and check whether the security group blocks the CIDR block of DTS.
Test result 3
Symptom
When testing the connection, use the ping command to test that the network is normal, and use the telnet command to test that the port is normal, but the JDBC is disconnected.
Causes
- The possible cause is that the password for the database account or the IP address and Port number of the database are invalid.
- The possible reason is that the database account authorization restricts the connection address.
Troubleshooting
- Check and modify the database connection information.
- Please open all connection addresses.
Local database connected through a leased line
For physical access, you need to configure static routes on the access device of the on-premises data center and the route table on the VBR. For more information, see leased Line Access User Manual to check whether the route configurations are correct.
Cloud instance
The password of the database account may be incorrect.
Application scope
- Data Transmission Service (DTS)