Practice case – Pt OSC tool failed to connect to RDS for MySQL database

Time:2021-9-15

This article is shared from Huawei cloud community《PT OSC tool failed to connect to RDS for MySQL database》Original author: cloud technology porter.

[phenomenon]

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
Practice case - Pt OSC tool failed to connect to RDS for MySQL database

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.
Practice case - Pt OSC tool failed to connect to RDS for MySQL database

[troubleshooting]

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.
Practice case - Pt OSC tool failed to connect to RDS for MySQL database

[solution]

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:

processlist:show processlist;

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.

[summary]

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.

Click focus to learn about Huawei cloud’s new technologies for the first time~

Recommended Today

Beautify your code VB (VBS) code formatting implementation code

However, vb.net does have many new functions that VB6 does not have. The automatic typesetting of code is one, which is the function we want to realize today – VB code formatting.Let’s look at the effect: Before formatting: Copy codeThe code is as follows: For i = 0 To WebBrowser1.Document.All.length – 1 If WebBrowser1.Document.All(i).tagName = […]