本文主要給大家簡單講講MySQL5.7安裝及配置MGR教程,相關(guān)專業(yè)術(shù)語大家可以上網(wǎng)查查或者找一些相關(guān)書籍補(bǔ)充一下,這里就不涉獵了,我們就直奔主題吧,希望MySQL5.7安裝及配置MGR教程這篇文章可以給大家?guī)硪恍?shí)際幫助。
創(chuàng)新互聯(lián)是專業(yè)的冊亨網(wǎng)站建設(shè)公司,冊亨接單;提供網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì),網(wǎng)頁設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行冊亨網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴(kuò)展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來合作!
一、云服務(wù)器規(guī)劃
mysql_mgr_01 192.168.10.223
mysql_mgr_02 192.168.10.224
mysql_mgr_03 192.168.10.225
二、配置文件
1. mysql_mgr_01
[root@mysql_mgr_01 tmp]# cat /etc/my.cnf
[mysqld]
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
server-id=330601
port = 3306
log_bin = /data/mysql/binlog/mysql_mgr01-bin
#expire_logs_days=10
explicit_defaults_for_timestamp=true
datadir=/data/mysql/data
socket=/data/mysql/run/mysql.sock
skip-external-locking
pid-file=/data/mysql/run/mysql.pid
innodb_file_per_table = on
#skip_name_resolve = on
character-set-server = utf8mb4
character-set-client-handshake = FALSE
collation-server = utf8mb4_unicode_ci
init_connect='SET NAMES utf8mb4'
slow_query_log = on
long_query_time = 2
slow_query_log_file = /data/mysql/slow_logs/mysql-slow.log
binlog_rows_query_log_events=ON
relay-log=/data/mysql/relaylog/mysql_mgr_01-relay-bin
#
# Replication configuration parameters
#
gtid_mode=ON
enforce_gtid_consistency=ON
master_info_repository=TABLE
relay_log_info_repository=TABLE
binlog_checksum=NONE
log_slave_updates=ON
binlog_format=ROW
#
# Group Replication configuration
#
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= "192.168.10.223:24901"
loose-group_replication_group_seeds= "192.168.10.223:24901,192.168.10.224:24902,192.168.10.225:24903"
loose-group_replication_bootstrap_group=off
group_replication_member_weight = 100
symbolic-links=0
[mysqld_safe]
log-error=/data/mysql/logs/mysql.log
pid-file=/data/mysql/run/mysql.pid
[mysql]
default-character-set = utf8mb4
socket=/data/mysql/run/mysql.sock
[client]
#default-character-set = utf8mb4
socket=/data/mysql/run/mysql.sock
2. mysql_mgr_02
[root@mysql_mgr_02 tmp]# cat /etc/my.cnf
[mysqld]
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
server-id=330602
port = 3306
log_bin = /data/mysql/binlog/mysql_mgr02-bin
#expire_logs_days=10
explicit_defaults_for_timestamp=true
datadir=/data/mysql/data
socket=/data/mysql/run/mysql.sock
skip-external-locking
pid-file=/data/mysql/run/mysql.pid
innodb_file_per_table = on
#skip_name_resolve = on
relay-log=/data/mysql/relaylog/mysql_mgr_02-relay-bin
character-set-server = utf8mb4
character-set-client-handshake = FALSE
collation-server = utf8mb4_unicode_ci
init_connect='SET NAMES utf8mb4'
slow_query_log = on
long_query_time = 2
slow_query_log_file = /data/mysql/slow_logs/mysql-slow.log
symbolic-links=0
#
# Replication configuration parameters
#
gtid_mode=ON
enforce_gtid_consistency=ON
master_info_repository=TABLE
relay_log_info_repository=TABLE
binlog_checksum=NONE
log_slave_updates=ON
binlog_format=ROW
#
# Group Replication configuration
#
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= "192.168.10.224:24902"
loose-group_replication_group_seeds= "192.168.10.223:24901,192.168.10.224:24902,192.168.10.225:24903"
loose-group_replication_bootstrap_group=off
group_replication_member_weight = 80
[mysqld_safe]
log-error=/data/mysql/logs/mysql.log
pid-file=/data/mysql/run/mysql.pid
[mysql]
default-character-set = utf8mb4
socket=/data/mysql/run/mysql.sock
[client]
#default-character-set = utf8mb4
socket=/data/mysql/run/mysql.sock
3. mysql_mgr_03
[root@mysql_mgr_03 tmp]# cat /etc/my.cnf
[mysqld]
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
server-id=330603
port = 3306
log_bin = /data/mysql/binlog/mysql_mgr03-bin
#expire_logs_days=10
explicit_defaults_for_timestamp=true
datadir=/data/mysql/data
socket=/data/mysql/run/mysql.sock
skip-external-locking
pid-file=/data/mysql/run/mysql.pid
innodb_file_per_table = on
#skip_name_resolve = on
relay-log=/data/mysql/relaylog/mysql_mgr_03-relay-bin
character-set-server = utf8mb4
character-set-client-handshake = FALSE
collation-server = utf8mb4_unicode_ci
init_connect='SET NAMES utf8mb4'
slow_query_log = on
long_query_time = 2
slow_query_log_file = /data/mysql/slow_logs/mysql-slow.log
symbolic-links=0
#
# Replication configuration parameters
#
gtid_mode=ON
enforce_gtid_consistency=ON
master_info_repository=TABLE
relay_log_info_repository=TABLE
binlog_checksum=NONE
log_slave_updates=ON
binlog_format=ROW
#
# Group Replication configuration
#
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= "192.168.10.225:24903"
loose-group_replication_group_seeds= "192.168.10.223:24901,192.168.10.224:24902,192.168.10.225:24903"
loose-group_replication_bootstrap_group=off
group_replication_member_weight = 90
[mysqld_safe]
log-error=/data/mysql/logs/mysql.log
pid-file=/data/mysql/run/mysql.pid
[mysql]
default-character-set = utf8mb4
socket=/data/mysql/run/mysql.sock
[client]
#default-character-set = utf8mb4
socket=/data/mysql/run/mysql.sock
三、MGR配置
1. mysql_mgr_01
[mysql_mgr_01]
#關(guān)閉SQL_LOG_BIN
SET SQL_LOG_BIN=0;
#創(chuàng)建組復(fù)制使用的帳號密碼
CREATE USER rpl_user@'%' IDENTIFIED BY 'password';
GRANT REPLICATION SLAVE ON *.* TO rpl_user@'%';
FLUSH PRIVILEGES;
#開啟SQL_LOG_BIN
SET SQL_LOG_BIN=1;
#安裝組復(fù)制插件group_replication.so
INSTALL PLUGIN group_replication SONAME 'group_replication.so';
CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='password' FOR CHANNEL 'group_replication_recovery';
#初始化主節(jié)點(diǎn)
SET GLOBAL group_replication_bootstrap_group=ON;
START GROUP_REPLICATION;
SET GLOBAL group_replication_bootstrap_group=OFF;
#查看組復(fù)制成員狀態(tài)
SELECT * FROM performance_schema.replication_group_members;
#備份
mysqldump -uroot -p --all-databases --master-data=2 --single-transaction>/tmp/all.sql
2. mysql_mgr_02
[mysql_mgr_02]
#恢復(fù)備份
#安裝組復(fù)制插件group_replication.so
INSTALL PLUGIN group_replication SONAME 'group_replication.so';
CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='password' FOR CHANNEL 'group_replication_recovery';
#啟動(dòng)組復(fù)制
START GROUP_REPLICATION;
3. mysql_mgr_03
[mysql_mgr_03]
#恢復(fù)備份
#安裝組復(fù)制插件group_replication.so
INSTALL PLUGIN group_replication SONAME 'group_replication.so';
CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='password' FOR CHANNEL 'group_replication_recovery';
#啟動(dòng)組復(fù)制
START GROUP_REPLICATION;
MySQL5.7安裝及配置MGR教程就先給大家講到這里,對于其它相關(guān)問題大家想要了解的可以持續(xù)關(guān)注我們的行業(yè)資訊。我們的板塊內(nèi)容每天都會捕捉一些行業(yè)新聞及專業(yè)知識分享給大家的。
本文名稱:MySQL5.7安裝及配置MGR教程
URL網(wǎng)址:http://jinyejixie.com/article8/gpepip.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供關(guān)鍵詞優(yōu)化、、全網(wǎng)營銷推廣、服務(wù)器托管、自適應(yīng)網(wǎng)站、營銷型網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)