Not the answer you need?
Register and ask your own question!

pt-table-sync error The server specified as a master has no connected slaves

dokhebidokhebi EntrantInactive User Role Beginner
I have four MySQL databases in a sandbox for testing set up as follows:

M -> S1
M -> S2
S1 -> S3

(Master localhost:5999 , Slave1 localhost:5998, Slave2 localhost:5997, Slave3 localhost:5996)

I deleted 1,000 rows from a table in Slave3 so I can test pt-table-sync to restore the rows from Slave1. I execute the command as follows:
pt-table-sync --execute --sync-to-master localhost --port=5996 --user=<username> --ask-pass --socket=/tmp/mysql_sandbox5996.sock --verbose

But I get the error message
The server specified as a master has no connected slaves at /usr/local/bin/pt-table-sync line 6213, <STDIN> line 1.

Reading the documentation it looks like if I use --sync-to-master then I specify the slave connection information. I tried it by specifying the master information with the options and the slave as a DSN and it doesn't look at the slave at all.

Is there a way to explicitly declare --master=<connection info> --slave=<connection info> and still have it ask for the password?

Thanks in advance,

Edward Hooper

Comments

  • dim0dim0 Percona Percona Staff Role
    Hi Edward,

    I tried replicating your issue to no avail for the moment. What version are you currently using of the percona toolkit. Could you give me the full output of the command? Does the user in place have the right to the see the replication status (replication_client)?
  • dokhebidokhebi Entrant Inactive User Role Beginner
    It couldn't connect to the other host because Perl::DBI needs the socket when the hostname is localhost. I only knew how to pass the socket for one of the connections and not both so it defaulted to /var/lib/mysql/mysql.sock (or what ever the default is) and it doesn't exist.

    When I started using the actual hostname of the server for the connection information the problem went away. But I had to set the hostname everywhere to make it work.

    If there are any devs reading, I'd like to request an update to the tools with the following options:

    --master-socket=<socket filename>
    --slave-socket=<socket filename>[,<socket filename> ...]
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.