[Mysql] Can't start group replication on secondary member with single primary-mode while asynchronous replication channels are running


本文总阅读量

0、mysql-mgr双节点集群,节点信息如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
select * from performance_schema.replication_group_members;
+---------------------------+--------------------------------------+------------------+-------------+--------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
+---------------------------+--------------------------------------+------------------+-------------+--------------+
| group_replication_applier | bddd9c32-8fee-11e8-ac79-525400edbe8d | dax-mysql-slave | 3306 | ONLINE |
| group_replication_applier | d5bd8edd-9a1d-11e8-993e-525400578639 | dax-mysql-master | 3306 | ONLINE |
+---------------------------+--------------------------------------+------------------+-------------+--------------+
2 rows in set (0.00 sec)
dax-mysql-master为主节点:
SHOW STATUS LIKE 'group_replication_primary_member';
+----------------------------------+--------------------------------------+
| Variable_name | Value |
+----------------------------------+--------------------------------------+
| group_replication_primary_member | d5bd8edd-9a1d-11e8-993e-525400578639 |
+----------------------------------+--------------------------------------+

1、因某种需要需要重启数据库,先后停止从节点group_replication;

1
2
3
stop group_replication;
停止数据库:
/etc/init.d/mysql stop

停止主节点group_replication;

1
2
3
4
5
stop group_replication;
重启数据库
/etc/init.d/mysql restart
启动组复制:
start group_replication;
1
ERROR 3092 (HY000): The server is not configured properly to be an active member of the group. Please see more details on error log.

error.log日志报错:

1
2
3
4
5
6
7
8
9
10
11
12
2018-11-01T06:57:09.766303Z 6 [Note] Plugin group_replication reported: 'Group communication SSL configuration: group_replication_ssl_mode: "DISABLED"'
2018-11-01T06:57:09.768075Z 6 [Note] Plugin group_replication reported: '[GCS] Added automatically IP ranges 127.0.0.1/8,192.168.168.178/24 to the whitelist'
2018-11-01T06:57:09.769536Z 6 [Note] Plugin group_replication reported: '[GCS] Translated 'dax-mysql-master' to 192.168.168.178'
2018-11-01T06:57:09.770000Z 6 [Warning] Plugin group_replication reported: '[GCS] Automatically adding IPv4 localhost address to the whitelist. It is mandatory that it is added.'
2018-11-01T06:57:09.770200Z 6 [Note] Plugin group_replication reported: '[GCS] SSL was not enabled'
2018-11-01T06:57:09.770253Z 6 [Note] Plugin group_replication reported: 'Initialized group communication with configuration: group_replication_group_name: "740442c0-cc67-11e8-993e-525400578639"; group_replication_local_address: "dax-mysql-master:24901"; group_replication_group_seeds: "dax-mysql-master:24901,dax-mysql-slave:24901"; group_replication_bootstrap_group: false; group_replication_poll_spin_loops: 0; group_replication_compression_threshold: 1000000; group_replication_ip_whitelist: "AUTOMATIC"'
2018-11-01T06:57:09.770341Z 6 [Note] Plugin group_replication reported: '[GCS] Configured number of attempts to join: 0'
2018-11-01T06:57:09.770356Z 6 [Note] Plugin group_replication reported: '[GCS] Configured time between attempts to join: 5 seconds'
2018-11-01T06:57:09.770494Z 6 [Note] Plugin group_replication reported: 'Member configuration: member_id: 3306103; member_uuid: "d5bd8edd-9a1d-11e8-993e-525400578639"; single-primary mode: "true"; group_replication_auto_increment_increment: 7; '
2018-11-01T06:57:09.770589Z 6 [ERROR] Plugin group_replication reported: 'Can't start group replication on secondary member with single primary-mode while asynchronous replication channels are running.'
2018-11-01T06:57:09.770682Z 6 [Note] Plugin group_replication reported: 'Requesting to leave the group despite of not being a member'
2018-11-01T06:57:09.770696Z 6 [ERROR] Plugin group_replication reported: '[GCS] The member is leaving a group without being on one.'

尝试重启dax-mysql-slave节点组复制:

1
2
 start group_replication;
ERROR 3092 (HY000): The server is not configured properly to be an active member of the group. Please see more details on error log.

error.log日志报错:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
2018-11-01T06:59:20.617005Z 114 [Note] 'CHANGE MASTER TO FOR CHANNEL 'group_replication_applier' executed'. Previous state master_host='<NULL>', master_port= 0, master_log_file='', master_log_pos= 128090715, master_bind=''. New state master_host='<NULL>', master_port= 0, master_log_file='', master_log_pos= 4, master_bind=''.
2018-11-01T06:59:21.516164Z 111 [Note] Plugin group_replication reported: 'Group Replication applier module successfully initialized!'
2018-11-01T06:59:21.516264Z 117 [Note] Slave SQL thread for channel 'group_replication_applier' initialized, starting replication in log 'FIRST' at position 0, relay log './relay-log-group_replication_applier.000002' position: 4
2018-11-01T06:59:21.516277Z 111 [Note] Plugin group_replication reported: 'auto_increment_increment is set to 7'
2018-11-01T06:59:21.516298Z 111 [Note] Plugin group_replication reported: 'auto_increment_offset is set to 3306102'
2018-11-01T06:59:21.553616Z 0 [Note] Plugin group_replication reported: 'XCom protocol version: 3'
2018-11-01T06:59:21.553718Z 0 [Note] Plugin group_replication reported: 'XCom initialized and ready to accept incoming connections on port 24901'
2018-11-01T06:59:21.620998Z 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to dax-mysql-master:24901 on local port: 24901.'
2018-11-01T06:59:21.621468Z 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to dax-mysql-master:24901 on local port: 24901.'
2018-11-01T06:59:21.621794Z 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to dax-mysql-master:24901 on local port: 24901.'
2018-11-01T06:59:21.621988Z 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to dax-mysql-master:24901 on local port: 24901.'
2018-11-01T06:59:21.622185Z 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to dax-mysql-master:24901 on local port: 24901.'
2018-11-01T06:59:21.622379Z 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to dax-mysql-master:24901 on local port: 24901.'
2018-11-01T06:59:21.622658Z 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to dax-mysql-master:24901 on local port: 24901.'
2018-11-01T06:59:21.622875Z 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to dax-mysql-master:24901 on local port: 24901.'
2018-11-01T06:59:21.623043Z 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to dax-mysql-master:24901 on local port: 24901.'
2018-11-01T06:59:21.623201Z 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to dax-mysql-master:24901 on local port: 24901.'
2018-11-01T06:59:21.623220Z 0 [ERROR] Plugin group_replication reported: '[GCS] Error connecting to all peers. Member join failed. Local port: 24901'
2018-11-01T06:59:21.624544Z 0 [Warning] Plugin group_replication reported: 'read failed'
2018-11-01T06:59:21.656139Z 0 [ERROR] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 24901'
2018-11-01T07:00:21.516998Z 111 [ERROR] Plugin group_replication reported: 'Timeout on wait for view after joining group'
2018-11-01T07:00:21.517630Z 111 [Note] Plugin group_replication reported: 'Requesting to leave the group despite of not being a member'
2018-11-01T07:00:21.517820Z 111 [ERROR] Plugin group_replication reported: '[GCS] The member is leaving a group without being on one.'
2018-11-01T07:00:21.519413Z 111 [Note] Plugin group_replication reported: 'auto_increment_increment is reset to 1'
2018-11-01T07:00:21.519442Z 111 [Note] Plugin group_replication reported: 'auto_increment_offset is reset to 1'
2018-11-01T07:00:21.521022Z 117 [Note] Error reading relay log event for channel 'group_replication_applier': slave SQL thread was killed
2018-11-01T07:00:21.595775Z 114 [Note] Plugin group_replication reported: 'The group replication applier thread was killed'
2018-11-01T07:10:22.699429Z 111 [Note] Aborted connection 111 to db: 'unconnected' user: 'root' host: 'localhost' (Got timeout reading communication packets)

使用mysql-shell查看集群信息:

1
/data/soft/mysql-shell/bin/mysqlsh --uri repl@dax-mysql-master:3306

尝试查看集群信息:

1
2
cluster = dba.getCluster("prodCluster")
Dba.getCluster: This function is not available through a session to a standalone instance (metadata exists, but GR is not active) (RuntimeError)

提示集群系统没有激活,尝试重启集群系统:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
dba.rebootClusterFromCompleteOutage('prodCluster')
Reconfiguring the cluster 'prodCluster' from complete outage...
The instance 'dax-mysql-slave:3306' was part of the cluster configuration.
Would you like to rejoin it to the cluster? [y/N]: y
WARNING: On instance 'dax-mysql-master:3306' membership change cannot be persisted since MySQL version 5.7.22 does not support the SET PERSIST command (MySQL version >= 8.0.5 required). Please use the <Dba>.configureLocalInstance command locally to persist the changes.
The cluster was successfully rebooted.
<Cluster:prodCluster>
MySQL dax-mysql-master:3306 JS > cluster = dba.getCluster("prodCluster")
<Cluster:prodCluster>
MySQL dax-mysql-master:3306 JS > cluster.status()
{
"clusterName": "prodCluster",
"defaultReplicaSet": {
"name": "default",
"primary": "dax-mysql-master:3306",
"ssl": "DISABLED",
"status": "OK_NO_TOLERANCE",
"statusText": "Cluster is NOT tolerant to any failures.",
"topology": {
"dax-mysql-master:3306": {
"address": "dax-mysql-master:3306",
"mode": "R/W",
"readReplicas": {},
"role": "HA",
"status": "ONLINE"
},
"dax-mysql-slave:3306": {
"address": "dax-mysql-slave:3306",
"mode": "R/O",
"readReplicas": {},
"role": "HA",
"status": "ONLINE"
}
}
},
"groupInformationSourceMember": "mysql://repl@dax-mysql-master:3306"
}

集群状态恢复正常。

目录
  1. 1. 0、mysql-mgr双节点集群,节点信息如下:
  2. 2. 1、因某种需要需要重启数据库,先后停止从节点group_replication;

Proudly powered by Hexo and Theme by Lap
本站访客数人次
© 2020 zeven0707's blog