Ubuntu 20.04 mysql-server 8 复制无法启动

Ubuntu 20.04 mysql-server 8 复制无法启动

我正在构建一个主-主复制系统,其中两个服务器通过本地局域网互相通信。

我有:

服务器 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;

用户存在且具有正确的权限,日志文件 + 日志位置来自服务器 2

服务器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;

但是当我执行“显示副本状态 \G;”时,我得到:

服务器 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)

服务器2:

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.

两者的绑定地址都是 0.0.0.0,并且 ufw 允许 3306。

非常感激任何关于这里发生的事情的线索。

相关内容