我正在尝试设置mysql集群。我有几个数字海洋(DO)实例运行centos 7。
我已经在DO实例上安装了Mysql 8.0.21 for Linuxonx86_64 (MySQL ),仅使用Mysql 8.0.21。
我能够配置所有实例(dba.configureInstance('instance')),可以将其添加到集群中。我在一个节点(dba.createCluster('cluster_name'))上创建了一个集群。我收到关于cluster.status()的以下消息
> cluster.status()
{
"clusterName": "myCluster",
"defaultReplicaSet": {
"name": "default",
"primary": "139.59.1.215:3306",
"ssl": "REQUIRED",
"status": "OK_NO_TOLERANCE",
"statusText": "Cluster is NOT tolerant to any failures.",
"topology": {
"139.59.1.215:3306": {
"address": "139.59.1.215:3306",
"mode": "R/W",
"readReplicas": {},
"replicationLag": null,
"role": "HA",
"status": "ONLINE",
"version": "8.0.21"
}
},
"topologyMode": "Single-Primary"
},
"groupInformationSourceMember": "139.59.1.215:3306"}
现在,当我尝试向这个集群添加其他实例(dba.addInstance('other_instance'))并选择默认的克隆选项时,我将从主节点shell中获得以下错误。
ERROR: Unable to start Group Replication for instance '139.59.21.251:3306'. Please check the MySQL server error log for more information.
Cluster.addInstance: Group Replication failed to start: MySQL Error 3092 (HY000): 139.59.21.251:3306:
The server is not configured properly to be an active member of the group.
Please see more details on error log. (RuntimeError)当我检查我要添加的辅助节点的日志文件时,我会看到以下错误消息
[System] [MY-010597] [Repl] 'CHANGE MASTER TO FOR CHANNEL 'group_replication_recovery' executed'. Previous state master_host='', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''. New state master_host='', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''.
[System] [MY-013587] [Repl] Plugin group_replication reported: 'Plugin 'group_replication' is starting.'
[Warning] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Automatically adding IPv4 localhost address to the whitelist. It is mandatory that it is added.'
[System] [MY-010597] [Repl] 'CHANGE MASTER TO FOR CHANNEL 'group_replication_applier' executed'. Previous state master_host='<NULL>', master_port= 0, master_log_file='', master_log_pos= 4, master_bind=''. New state master_host='<NULL>', master_port= 0, master_log_file='', master_log_pos= 4, master_bind=''.
[ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Error connecting to the local group communication engine instance.'
[ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 33061'
[ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Error connecting to the local group communication engine instance.'
[ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 33061'
[ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Error connecting to the local group communication engine instance.'
[ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 33061'
[ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Error connecting to the local group communication engine instance.'
[ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 33061'
[ERROR] [MY-011640] [Repl] Plugin group_replication reported: 'Timeout on wait for view after joining group'
[ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] The member is leaving a group without being on one.'我已经确保使用命令(dba.checkInstanceConfiguration(' instance '))正确地配置了次要实例,并且我正在获取状态: ok消息
> dba.checkInstanceConfiguration('admin@139.59.21.251:3306')
Validating MySQL instance at 139.59.21.251:3306 for use in an InnoDB cluster...
This instance reports its own address as 139.59.21.251:3306
Checking whether existing tables comply with Group Replication requirements...
No incompatible tables detected
Checking instance configuration...
Instance configuration is compatible with InnoDB cluster
The instance '139.59.21.251:3306' is valid to be used in an InnoDB cluster.
{
"status": "ok"
}我有点困在这一点上,希望能在这个问题上提供任何帮助。谢谢您:)
编辑:我还修改了my.cnf文件。对于主节点,我添加了-
report_host=139.59.1.215
group_replication_ip_whitelist=139.59.1.215,139.59.21.251
skip-name-resolve发布于 2021-01-07 17:16:52
造成此问题的原因是启用了SELinux,阻塞了XCom和GCS之间所需的连接,这是8.0.14中新引入的特性的一部分。基本上,SELinux需要在回送接口中允许与MySQL的所有连接。
setsebool -P mysql_connect_any 1https://dba.stackexchange.com/questions/273847
复制相似问题