group_replication_bootstrap_group 用於什麼
MGR中group_replication_bootstrap_group引數 有什麼用途?何時使用?官方有解答:
What is the group_replication_bootstrap_group option used for?
The bootstrap flag instructs a member to create a group and act as the initial seed server.
The second member joining the group needs to ask the member that bootstrapped the group to dynamically change the configuration in order for it to be added to the group.
引導標誌指示成員建立組並充當初始seed server,加入組的第二個成員需要請求引導組的成員動態更改配置,以便將其新增到組中。
A member needs to bootstrap the group in two scenarios. When the group is originally created, or when shutting down and restarting the entire group.
需要在兩種情況下做設定:1.初始化建組時 2.關閉並重新啟動整個組時
測試關閉重啟整個MGR組(關閉所有成員):
在啟動mysql各節點,執行開啟MGR報錯:
mysql> 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. mysql> SELECT * FROM performance_schema.replication_GROUP_MEMBERS; +---------------------------+--------------------------------------+-------------+-------------+--------------+ | CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | +---------------------------+--------------------------------------+-------------+-------------+--------------+ | group_replication_applier | eba0fa52-5dfb-11ea-9b8c-2c44fd7aadfc | MGRDB01 | 3306 | OFFLINE | +---------------------------+--------------------------------------+-------------+-------------+--------------+ 1 row in set (0.00 sec)
檢查error log:
節點開始組複製後,會連線其他節點,獲取資訊,但是無法連線,因為此時叢集中其他節點尚未開始組複製,叢集中也沒有主節點。
2021-06-02T18:29:47.090922+08:00 9 [Note] Plugin group_replication reported: 'Group communication SSL configuration: group_replication_ssl_mode: "DISABLED"' 2021-06-02T18:29:47.091511+08:00 9 [Note] Plugin group_replication reported: '[GCS] Added automatically IP ranges 192.168.16.113/23,127.0.0.1/8 to the whitelist' 2021-06-02T18:29:47.091868+08:00 9 [Warning] Plugin group_replication reported: '[GCS] Automatically adding IPv4 localhost address to the whitelist. It is mandatory that it is added.' 2021-06-02T18:29:47.091960+08:00 9 [Note] Plugin group_replication reported: '[GCS] SSL was not enabled' 2021-06-02T18:29:47.092003+08:00 9 [Note] Plugin group_replication reported: 'Initialized group communication with configuration: group_replication_group_name: "c7bce2ea-c7db-11ea-96e9-0050568acad3"; group_replication_local_address: "192.168.16.113:33062"; group_replication_group_seeds: "192.168.17.56:33061,192.168.16.113:33062"; group_replication_bootstrap_group: false; group_replication_poll_spin_loops: 0; group_replication_compression_threshold: 1000000; group_replication_ip_whitelist: "AUTOMATIC"' 2021-06-02T18:29:47.092110+08:00 9 [Note] Plugin group_replication reported: 'Member configuration: member_id: 2; member_uuid: "eba0fa52-5dfb-11ea-9b8c-2c44fd7aadfc"; single-primary mode: "true"; group_replication_auto_increment_increment: 7; ' 2021-06-02T18:29:47.092943+08:00 11 [Note] '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=''. 2021-06-02T18:29:47.119909+08:00 9 [Note] Plugin group_replication reported: 'Group Replication applier module successfully initialized!' 2021-06-02T18:29:47.119944+08:00 14 [Note] Slave SQL thread for channel 'group_replication_applier' initialized, starting replication in log 'FIRST' at position 0, relay log './swhEPODB02-relay-bin-group_replication_applier.000010' position: 4 2021-06-02T18:29:47.119971+08:00 9 [Note] Plugin group_replication reported: 'auto_increment_increment is set to 7' 2021-06-02T18:29:47.119992+08:00 9 [Note] Plugin group_replication reported: 'auto_increment_offset is set to 2' 2021-06-02T18:29:47.120154+08:00 0 [Note] Plugin group_replication reported: 'state 4338 action xa_init' 2021-06-02T18:29:47.120582+08:00 0 [Note] Plugin group_replication reported: 'Successfully bound to 0.0.0.0:33062 (socket=58).' 2021-06-02T18:29:47.120630+08:00 0 [Note] Plugin group_replication reported: 'Successfully set listen backlog to 32 (socket=58)!' 2021-06-02T18:29:47.120649+08:00 0 [Note] Plugin group_replication reported: 'Successfully unblocked socket (socket=58)!' 2021-06-02T18:29:47.120758+08:00 0 [Note] Plugin group_replication reported: 'Ready to accept incoming connections on 0.0.0.0:33062 (socket=58)!' 2021-06-02T18:29:47.120763+08:00 0 [Note] Plugin group_replication reported: 'connecting to 192.168.16.113 33062' 2021-06-02T18:29:47.121005+08:00 0 [Note] Plugin group_replication reported: 'client connected to 192.168.16.113 33062 fd 59' 2021-06-02T18:29:47.121349+08:00 0 [Note] Plugin group_replication reported: 'connecting to 192.168.16.113 33062' 2021-06-02T18:29:47.121480+08:00 0 [Note] Plugin group_replication reported: 'client connected to 192.168.16.113 33062 fd 56' 2021-06-02T18:29:47.121763+08:00 0 [Note] Plugin group_replication reported: 'connecting to 192.168.16.113 33062' 2021-06-02T18:29:47.121944+08:00 0 [Note] Plugin group_replication reported: 'client connected to 192.168.16.113 33062 fd 62' 2021-06-02T18:29:47.122148+08:00 0 [Note] Plugin group_replication reported: 'connecting to 192.168.16.113 33062' 2021-06-02T18:29:47.122281+08:00 0 [Note] Plugin group_replication reported: 'client connected to 192.168.16.113 33062 fd 63' 2021-06-02T18:29:47.122491+08:00 0 [Note] Plugin group_replication reported: 'connecting to 192.168.16.113 33062' 2021-06-02T18:29:47.122633+08:00 0 [Note] Plugin group_replication reported: 'client connected to 192.168.16.113 33062 fd 66' 2021-06-02T18:29:47.122822+08:00 0 [Note] Plugin group_replication reported: 'connecting to 192.168.16.113 33062' 2021-06-02T18:29:47.122945+08:00 0 [Note] Plugin group_replication reported: 'client connected to 192.168.16.113 33062 fd 61' 2021-06-02T18:29:47.123146+08:00 0 [Note] Plugin group_replication reported: 'connecting to 192.168.17.56 33061' 2021-06-02T18:29:47.123620+08:00 0 [Note] Plugin group_replication reported: 'Getting the peer name failed while connecting to server 192.168.17.56 with error 111 -Connection refused.' 2021-06-02T18:29:47.123679+08:00 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to 192.168.17.56:33061 on local port: 33062.' 2021-06-02T18:29:47.123710+08:00 0 [Note] Plugin group_replication reported: 'connecting to 192.168.17.56 33061' 2021-06-02T18:29:47.124096+08:00 0 [Note] Plugin group_replication reported: 'Getting the peer name failed while connecting to server 192.168.17.56 with error 111 -Connection refused.' 2021-06-02T18:29:47.124150+08:00 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to 192.168.17.56:33061 on local port: 33062.' 2021-06-02T18:29:47.124175+08:00 0 [Note] Plugin group_replication reported: 'connecting to 192.168.17.56 33061' 2021-06-02T18:29:47.124509+08:00 0 [Note] Plugin group_replication reported: 'Getting the peer name failed while connecting to server 192.168.17.56 with error 111 -Connection refused.' 2021-06-02T18:29:47.124564+08:00 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to 192.168.17.56:33061 on local port: 33062.' 2021-06-02T18:29:47.124588+08:00 0 [Note] Plugin group_replication reported: 'connecting to 192.168.17.56 33061' 2021-06-02T18:29:47.124858+08:00 0 [Note] Plugin group_replication reported: 'Getting the peer name failed while connecting to server 192.168.17.56 with error 111 -Connection refused.' 2021-06-02T18:29:47.124891+08:00 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to 192.168.17.56:33061 on local port: 33062.' 2021-06-02T18:29:47.124912+08:00 0 [Note] Plugin group_replication reported: 'connecting to 192.168.17.56 33061' 2021-06-02T18:29:47.125157+08:00 0 [Note] Plugin group_replication reported: 'Getting the peer name failed while connecting to server 192.168.17.56 with error 111 -Connection refused.' 2021-06-02T18:29:47.125190+08:00 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to 192.168.17.56:33061 on local port: 33062.' 2021-06-02T18:29:47.125210+08:00 0 [Note] Plugin group_replication reported: 'connecting to 192.168.17.56 33061' 2021-06-02T18:29:47.125529+08:00 0 [Note] Plugin group_replication reported: 'Getting the peer name failed while connecting to server 192.168.17.56 with error 111 -Connection refused.' 2021-06-02T18:29:47.125565+08:00 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to 192.168.17.56:33061 on local port: 33062.' 2021-06-02T18:29:47.125585+08:00 0 [Note] Plugin group_replication reported: 'connecting to 192.168.17.56 33061' 2021-06-02T18:29:47.125909+08:00 0 [Note] Plugin group_replication reported: 'Getting the peer name failed while connecting to server 192.168.17.56 with error 111 -Connection refused.' 2021-06-02T18:29:47.125941+08:00 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to 192.168.17.56:33061 on local port: 33062.' 2021-06-02T18:29:47.125960+08:00 0 [Note] Plugin group_replication reported: 'connecting to 192.168.17.56 33061' 2021-06-02T18:29:47.126198+08:00 0 [Note] Plugin group_replication reported: 'Getting the peer name failed while connecting to server 192.168.17.56 with error 111 -Connection refused.' 2021-06-02T18:29:47.126231+08:00 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to 192.168.17.56:33061 on local port: 33062.' 2021-06-02T18:29:47.126250+08:00 0 [Note] Plugin group_replication reported: 'connecting to 192.168.17.56 33061' 2021-06-02T18:29:47.126536+08:00 0 [Note] Plugin group_replication reported: 'Getting the peer name failed while connecting to server 192.168.17.56 with error 111 -Connection refused.' 2021-06-02T18:29:47.126571+08:00 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to 192.168.17.56:33061 on local port: 33062.' 2021-06-02T18:29:47.126590+08:00 0 [Note] Plugin group_replication reported: 'connecting to 192.168.17.56 33061' 2021-06-02T18:29:47.126866+08:00 0 [Note] Plugin group_replication reported: 'Getting the peer name failed while connecting to server 192.168.17.56 with error 111 -Connection refused.' 2021-06-02T18:29:47.126898+08:00 0 [ERROR] Plugin group_replication reported: '[GCS] Error on opening a connection to 192.168.17.56:33061 on local port: 33062.' 2021-06-02T18:29:47.126920+08:00 0 [ERROR] Plugin group_replication reported: '[GCS] Error connecting to all peers. Member join failed. Local port: 33062' 2021-06-02T18:29:47.127085+08:00 0 [Note] Plugin group_replication reported: 'state 4338 action xa_terminate' 2021-06-02T18:29:47.127140+08:00 0 [Note] Plugin group_replication reported: 'new state x_start' 2021-06-02T18:29:47.127157+08:00 0 [Note] Plugin group_replication reported: 'state 4338 action xa_exit' 2021-06-02T18:29:47.127603+08:00 0 [Note] Plugin group_replication reported: 'Exiting xcom thread' 2021-06-02T18:29:47.127630+08:00 0 [Note] Plugin group_replication reported: 'new state x_start' 2021-06-02T18:29:47.127693+08:00 0 [Warning] Plugin group_replication reported: 'read failed' 2021-06-02T18:29:47.172424+08:00 0 [ERROR] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 33062' 2021-06-02T18:30:47.120129+08:00 9 [ERROR] Plugin group_replication reported: 'Timeout on wait for view after joining group' 2021-06-02T18:30:47.120214+08:00 9 [Note] Plugin group_replication reported: 'Requesting to leave the group despite of not being a member' 2021-06-02T18:30:47.120266+08:00 9 [ERROR] Plugin group_replication reported: '[GCS] The member is leaving a group without being on one.' 2021-06-02T18:30:47.120469+08:00 9 [Note] Plugin group_replication reported: 'auto_increment_increment is reset to 1' 2021-06-02T18:30:47.120493+08:00 9 [Note] Plugin group_replication reported: 'auto_increment_offset is reset to 1' 2021-06-02T18:30:47.121013+08:00 14 [Note] Error reading relay log event for channel 'group_replication_applier': slave SQL thread was killed 2021-06-02T18:30:47.121918+08:00 11 [Note] Plugin group_replication reported: 'The group replication applier thread was killed'
在節點上設定group_replication_bootstrap_group=on傳輸,再開啟可以成功:
mysql> set global group_replication_bootstrap_group=on; Query OK, 0 rows affected (0.00 sec) mysql> start group_replication; Query OK, 0 rows affected (2.06 sec) mysql> SELECT * FROM performance_schema.replication_group_members; +---------------------------+--------------------------------------+-----------------+-------------+--------------+ | CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | +---------------------------+--------------------------------------+-----------------+-------------+--------------+ | group_replication_applier | eba0fa52-5dfb-11ea-9b8c-2c44fd7aadfc | MGRDB01 | 3306 | ONLINE | +---------------------------+--------------------------------------+-----------------+-------------+--------------+ 1 row in set (0.00 sec)
以上,
參考:
MySQL :: MySQL 5.7 Reference Manual :: 17.8 Frequently Asked Questions
MySQL MGR 當機後如何開啟複製_小樓一夜聽春雨,深巷明朝賣杏花-CSDN部落格
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25583515/viewspace-2775541/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Java是什麼? Java適用於什麼工作?Java
- SID是什麼?用於什麼場景
- ClickHouse(01)什麼是ClickHouse,ClickHouse適用於什麼場景
- Oracle ASM有什麼用?為什麼用?OracleASM
- 什麼樣的代理適用於市場研究?
- NIO是什麼?適用於何種場景?
- css--BFC是什麼,有什麼用,怎麼用?CSS
- 除了用於銷售還能做什麼,CRM系統?
- NLA有什麼用?原理是什麼?
- 獲取的 Cookie 為什麼無法用於爬蟲Cookie爬蟲
- 為什麼免費OA不能深入應用於企業?
- 關於智慧合約的去中心化有什麼用?中心化
- 根證書是什麼?有什麼用?
- 關於什麼是框架框架
- 快應用是什麼軟體?快應用有什麼用?
- 為什麼用ReactReact
- FactoryBean有什麼用Bean
- [譯] 互聯汽車是什麼以及如何開發用於它的應用?
- httpdns是個什麼技術,有什麼用httpdDNS
- RFM是什麼?這個模型有什麼用?模型
- 蘋果Feedback是什麼?有什麼用?怎麼刪除?蘋果
- C++中什麼時候用move,什麼時候用forward?C++Forward
- 關於什麼是 DevOpsdev
- 為什麼 NaN 不等於自身?NaN
- webpack 為什麼這麼難用?Web
- 什麼是web前端?前端可以做什麼?html5有什麼用?Web前端HTML
- 區塊鏈應用開發究竟是什麼,有什麼用區塊鏈
- JSON是什麼,有什麼用,怎麼寫jsonJSON
- 請問getKey()方法是什麼,有什麼用
- Python是什麼意思?Python有什麼用?Python
- 什麼是電話機器人?有什麼用?機器人
- 影像採集卡是什麼,有什麼用處
- 什麼是eval()?eval是用來幹什麼的?
- 關於 iOS 上的 PWA 應用,你需要知道些什麼?iOS
- 對於重要的資料檔案,用什麼方法進行加密?加密
- 什麼是專用代理?
- 這個用什麼模式模式
- 運維審計是什麼意思?有什麼作用?用什麼軟體好?運維