mysql组从家庭复制到Amazon EC2

我已经成功使用this article在住宅防火墙后面的3个ubuntu 16.04容器中为mysql(5.7)设置了组复制。

效果很好,没问题。

我现在想在aws ec2实例上设置组复制的成员。

我已经将aws安全组开放到我的家庭ip,以处理所有流量。 ec2是ubuntu 16.04,与上面引用的mysql设置相同。

问题在于ec2实例将无法“看到”我的家用计算机。为了解决这个问题,我建立了一个反向ssh隧道,并试图在/etc/mysq/my.cnf文件中设置该组的成员以引用打开的隧道:

server_id=4
gtid_mode=ON
enforce_gtid_consistency=ON
master_info_repository=TABLE
relay_log_info_repository=TABLE
binlog_checksum=NONE
log_slave_updates=ON
log_bin=binlog
binlog_format=ROW

# Group configuration

transaction_write_set_extraction=XXHASH64
loose-group_replication_group_name="xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
loose-group_replication_start_on_boot=off
loose-group_replication_local_address= "127.0.0.1:33061"
loose-group_replication_group_seeds= "127.0.0.1:33061,127.0.0.1:3307,127.0.0.1:3308"
loose-group_replication_bootstrap_group=off
bind-address = "0.0.0.0"
report_host = "127.0.0.1"

在上面,我尝试将隧道指向其他成员(家庭服务器)端口3306和33061。

“ START GROUP_REPLICATION;”之后的错误日志说:

[Note] Plugin group_replication reported: 'Group Replication applier module successfully initialized!'
[Note] Slave SQL thread for channel 'group_replication_applier' initialized,starting replication in log 'FIRST' at position 0,relay log './ip-##############-relay-bin-group_replication_applier.000001' position: 4
[Note] Plugin group_replication reported: 'auto_increment_increment is set to 7'
[Note] Plugin group_replication reported: 'auto_increment_offset is set to 4'
[Note] Plugin group_replication reported: 'state 0 action xa_init'
[Note] Plugin group_replication reported: 'Successfully bound to 0.0.0.0:33061 (socket=49).'
[Note] Plugin group_replication reported: 'Successfully set listen backlog to 32 (socket=49)!'
[Note] Plugin group_replication reported: 'Successfully unblocked socket (socket=49)!'
[Note] Plugin group_replication reported: 'Ready to accept incoming connections on 0.0.0.0:33061 (socket=49)!'
[Note] Plugin group_replication reported: 'connecting to 127.0.0.1 33061'
[Note] Plugin group_replication reported: 'client connected to 127.0.0.1 33061 fd 50'
[Note] Plugin group_replication reported: 'connecting to 127.0.0.1 33061'
[Note] Plugin group_replication reported: 'client connected to 127.0.0.1 33061 fd 58'
[Note] Plugin group_replication reported: 'connecting to 127.0.0.1 33061'
[Note] Plugin group_replication reported: 'client connected to 127.0.0.1 33061 fd 60'
[Note] Plugin group_replication reported: 'connecting to 127.0.0.1 33061'
[Note] Plugin group_replication reported: 'client connected to 127.0.0.1 33061 fd 62'
[Note] Plugin group_replication reported: 'connecting to 127.0.0.1 33061'
[Note] Plugin group_replication reported: 'client connected to 127.0.0.1 33061 fd 64'
[Note] Plugin group_replication reported: 'connecting to 127.0.0.1 33061'
[Note] Plugin group_replication reported: 'client connected to 127.0.0.1 33061 fd 66'
[Note] Plugin group_replication reported: 'connecting to 127.0.0.1 3307'
[Note] Plugin group_replication reported: 'client connected to 127.0.0.1 3307 fd 68'
[ERROR] Plugin group_replication reported: '[GCS] Timeout while waiting for the group communication engine to be ready!'
[ERROR] Plugin group_replication reported: '[GCS] The group communication engine is not ready for the member to join. Local port: 33061'
Plugin group_replication reported: 'state 4337 action xa_terminate'
[Note] Plugin group_replication reported: 'new state x_start'
[Note] Plugin group_replication reported: 'state 4337 action xa_exit'
[Note] Plugin group_replication reported: 'Exiting xcom thread'
[Note] Plugin group_replication reported: 'new state x_start'
[Warning] Plugin group_replication reported: 'read failed'
[ERROR] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 33061'
[ERROR] Plugin group_replication reported: 'Timeout on wait for view after joining group'
[Note] Plugin group_replication reported: 'Requesting to leave the group despite of not being a member'
[ERROR] Plugin group_replication reported: '[GCS] The member is leaving a group without being on one.'
[Note] Plugin group_replication reported: 'auto_increment_increment is reset to 1'
[Note] Plugin group_replication reported: 'auto_increment_offset is reset to 1'
[Note] Error reading relay log event for channel 'group_replication_applier': slave SQL thread was killed
[Note] Plugin group_replication reported: 'The group replication applier thread was killed'

所以,问题在于ec2实例看不到我的主服务器,我试图通过设置它可以“看到”的隧道来解决这个问题。我是在正确的轨道上吗,还是有其他解决方法?我正在考虑的另一种方法是以某种方式设置127.0.0.1:3307的别名,而家用服务器在端口3306上的端点说“ 1.1.1.1”,以便可以在my.cnf中放入“ 1.1.1.1:33061”文件作为成员,因为据我了解,端口33061是内部端口,不一定需要直接访问。

x357904377 回答:mysql组从家庭复制到Amazon EC2

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3087548.html

大家都在问