The source or target database connectivity test fails when you create a data migration, sync, or subscription task.
If the Telnet test fails, the causes may be:
If the Telnet test is passed, but the database connection fails, the causes may be:
A security group is similar to a firewall. It is a group of network security settings for databases in the cloud.
Check as follows based on the actual conditions:
If the source database is a self-built database, check whether the server where the source database resides is configured with firewall policies, and if so, disable the firewall.
iptables -L
command to check whether the server is configured with firewall policies.If the source database is a TencentDB database, check whether DTS IP range is blocked in the security group of the database, and if so, modify as follows:
When the connectivity test fails, the IP range that needs to be allowed for DTS will be displayed in the console as shown below:
bind-address
configuration in the database. If it is not 0.0.0.0
, the IP is blocked.root@10.0.0.0/8 // Authorize users to access through `10.0.0.0/8`, and other IPs will be blocked (incorrect configuration)
root@% // Authorize users to access all IPs, which should include the SNAT IPs (correct configuration)
You can verify as follows:
select host,user,authentication_string,password_expired,account_locked from
mysql.user WHERE user='[\$Username]'; // `[\$Username]` is the database account entered in the data migration task
Check whether there is an endpoint or trigger that blocks the access source IP address in the source database.
data
directory in the $PGDATA
directory, find the pg_hba.conf
file, and check whether the file contains a deny
policy or only allows access from certain IP addresses over the network.# cat pg_hba.conf
local replication all trust
host replication all 127.x.x.1/32 trust
host replication all ::1/128 trust
host all all 0.0.0.0/0 md5
host all all 172.x.x.0/20 md5
For self-built database, you need to check the bind
configuration in the database. If it is not 0.0.0.0
, the IP is blocked.
If the source database is MySQL, run the following SQL statement in it to authorize the user configured in the data migration task.
mysql> grant all privileges on . to '[\$UserName]'@'%'; // `[\$Username]` is the database account entered in the data migration task
mysql> flush privileges;
If the source database is a self-built database, you also need to check whether the bind-address
configuration is abnormal, and if so, modify it as instructed below.
2.1. Add the following content to the /etc/my.cnf
file:
Note:The default path of the
my.cnf
configuration file is/etc/my.cnf
, subject to the actual conditions.
bind-address=0.0.0.0 # All IP addresses or specified addresses
2.2. Restart the database.
service mysqld restart
2.3. Check whether the configuration takes effect.
netstat -tln
Run the verification task again.
Disable the firewall or trigger.
Add an access policy allowing the DTS IP range to the pg_hba.conf
file or temporarily open all IP ranges in the access policy during migration. For example, add the following line to the pg_hba.conf
file:
host all all 0.0.0.0/0 md5
After the modification is completed, you can restart the database instance to make the configuration take effect:
pg_ctl -D $PGDATA restart
Run the verification task again.
Configure bind-address
as instructed in MySQL.
bind
configuration in redis.conf
or change it to 0.0.0.0
.Below are the default ports for common databases. You need to check whether they are opened, and if not, open them based on the actual conditions:
If the source database is SQL Server, you need to open the file sharing service port 445 at the same time.
If you select the VPN/Direct Connect or CCN access method, you can refer to the documentation for troubleshooting.
Authorize the migration account again as instructed in the corresponding scenario in Migration from MySQL to TencentDB for MySQL and Sync from MySQL/MariaDB/Percona to TencentDB for MySQL.
Log in to the source database to check whether the account and password are correct.
For the same source and target databases, if an access type such as Public Network is selected and the connectivity verification is passed, you cannot switch to another access type such as Direct Connect; otherwise, an error will be reported during connectivity verification.
Was this page helpful?