This article is shared from Huawei cloud community《PT OSC tool failed to connect to RDS for MySQL database》Original author: cloud technology porter.
The host can connect to RDS port via telent, and the connection is normal using MySQL client;
As shown in the following figure: when connecting with Pt OSC tool, there is no response and the card is stuck
After waiting for about 4-5 minutes, there will be a response, as shown in the figure below: prompt that you cannot connect to x.x.x.x, and the IP address is the IP of the standby node.
View the task flow on the RDS side as shown in the following figure: it is found that PT OSC first connected to the show full processlist, and then stuck for about 4-5 minutes. Combined with the client’s return after 4-5 minutes in the screenshot above, Pt OSC tool first shows full processlist to get the IP of the standby database, and then connects to the standby database. However, the standby database does not directly provide external services because it is a backup for high availability.
PT OSC has one parameter: – recurrence method
[type: array; default value: processlist, host
It is used to judge whether there is a slave library. The possible methods are:
hosts：show slave hosts
dsn=DSN：DSNs from a table
None: do not search from library]
When Pt OSC is connected, adding — recurrence method = none means that the slave library is not searched, and it is normal. The specific commands are #pt online schema change — user = root — password = xxxxx — host = xx.xx.xx, P = 3306, d = XX, t = XX — charset = utf8 — alter = “configure = InnoDB” — nocheck replication files — alter foreign keys method = auto — recurrence method = none — execute.
When Pt OSC tool connects to the database, it will first get the IP of the standby database through SQL, and then connect to the standby database. However, our RDS standby database cannot be connected, so it will get stuck. Connecting RDS for MySQL of stand-alone type is normal.