您好,登錄后才能下訂單哦!
本篇內容介紹了“MYSQL MGR的安裝步驟”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!
#############MGR 必選參數#######################
server_id=1
gtid_mode=ON
enforce_gtid_consistency=ON
master_info_repository=TABLE
relay_log_info_repository=TABLE
log_slave_updates=ON
log_bin=binlog
binlog_format=ROW
binlog_checksum=NONE
transaction_write_set_extraction=XXHASH64
loose-group_replication_group_name="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
loose-group_replication_start_on_boot=off
loose-group_replication_local_address= "10.10.203.147:24901"
loose-group_replication_group_seeds= "10.10.203.145:24901,10.10.203.146:24901,10.10.203.147:24901"
loose-group_replication_bootstrap_group= off
#### for performance_schema
performance_schema =on
performance_schema_consumer_events_stages_current=on
performance_schema_consumer_events_stages_history=on
performance_schema_consumer_events_stages_history_long=off
performance_schema_consumer_statements_digest=on
performance_schema_consumer_events_statements_current=on
performance_schema_consumer_events_statements_history=on
performance_schema_consumer_events_statements_history_long=off
performance_schema_consumer_events_waits_current=on
performance_schema_consumer_events_waits_history=on
performance_schema_consumer_events_waits_history_long=off
performance_schema_consumer_global_instrumentation=on
performance_schema_consumer_thread_instrumentation=on
#####MYSQL CMD#############################
SET SQL_LOG_BIN=0;
CREATE USER rpl_user@'%' IDENTIFIED BY '123456';
GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%';
FLUSH PRIVILEGES;
SET SQL_LOG_BIN=1;
CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='123456' FOR CHANNEL 'group_replication_recovery';
INSTALL PLUGIN group_replication SONAME 'group_replication.so'; --第一次安裝了之后就可以不用執行了
SET GLOBAL group_replication_bootstrap_group=ON; --只有作為SEED節點的機器才使用,否則所有的節點都默認為SEED節點了,坑
set global group_replication_allow_local_disjoint_gtids_join=1; --只在slave節點執行
START GROUP_REPLICATION;
SET GLOBAL group_replication_bootstrap_group=OFF;
SELECT * FROM performance_schema.replication_group_members;
select * from performance_schema.replication_connection_status\G
CREATE DATABASE test;
use test;
CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 TEXT NOT NULL);
INSERT INTO t1 VALUES (1, 'Luis');
SHOW BINLOG EVENTS;
show global status like '%group_replication_primary%';
MGR的限制
僅支持InnoDB表,并且每張表一定要有一個主鍵,用于做write set的沖突檢測;
必須打開GTID特性,二進制日志格式必須設置為ROW,用于選主與write set
COMMIT可能會導致失敗,類似于快照事務隔離級別的失敗場景
目前一個MGR集群最多支持9個節點
不支持外鍵于save point特性,無法做全局間的約束檢測與部分部分回滾
二進制日志不支持binlog event checksum
錯誤解決:
##2018-07-10T06:17:00.054571Z 41 [ERROR] Slave I/O for channel 'group_replication_recovery': error connecting to master 'rpl_user@mha-slave1:3307' - retry-time: 60 retries: 1, Error_code: 2005
/etc/hosts中的IP解析出問題,修改后正常
“MYSQL MGR的安裝步驟”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識可以關注億速云網站,小編將為大家輸出更多高質量的實用文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。