0

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 'repl_user@192.168.1.3: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.

Foxina
  • 1
  • 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 – Foxina Dec 11 '21 at 12:58

0 Answers0