Score:0

Ubuntu 20.04 mysql-server 8 replication does not start

th flag

I am building a master-master replication with two servers which are talking to each other by local lan.

I have:

Server 1:

mysql -uroot -p
change replication source to source_host='192.168.1.3',
source_user='repl_user', SOURCE_PASSWORD='xxxxxxxxxxx',
source_log_file='mysql-bin.xxxxxx', source_log_pos=xxx, source_ssl=0;
start replica;

The user exists with correct privileges and log file + log pos are from the Server 2

Server 2:

mysql -u root -p
change replication source to source_host='192.168.1.2',
source_user='repl_user', SOURCE_PASSWORD='xxxx', 
source_log_file='mysql-bin.xxxx', source_log_pos=xxxx,  
source_ssl=0;
start replica;

But when I do "show replica status \G;", I get:

Server 1:

Replica_IO_State: Connecting to source
Source_Host: 192.168.1.3
Source_User: repl_user
Source_Port: 3306
....
Last_IO_Errno: 2003
Last_IO_Error: error connecting to master '[email protected]:3306' - re
try-time: 60 retries: 1 message: Can't connect to MySQL server on '192.168.1.3:3306' 
(111)

Server2:

Replica_IO_State: Waiting for source to send event
Source_Host: 192.168.1.2
Source_User: repl_user
Source_Port: 3306
Connect_Retry: 60
Replica_IO_State: Waiting for source to send event
Source_Host: 192.168.1.2
Source_User: repl_user
Source_Port: 3306
Connect_Retry: 60
....
Last_Errno: 1008
Last_Error: Coordinator stopped because there were error(s) in the worker(s). T
he most recent failure being: Worker 1 failed executing transaction 'ANONYMOUS' at 
master log mysql-bin.005240, end_log_pos 349. See error log and/or 
performance_schema.replication_applier_status_
by_worker table for more details about this failure or others, if any.

bind-address for both is 0.0.0.0 and ufw allows 3306.

Much appreciate for any clues of what is going on here.

th flag
Weird thing is, that if I connect from Server1 to Server2, with repl_user, it works. mysql -u repl_user -h 192.168.1.3 -p I get to mysql prompt on the server2
Lars avatar
de flag
Did you found a solution, because I ran into a similar/same problem and don't know how to proceed
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.