mysql-router-MIC-8.0.26集群部署
1、具体部署详情请看视频
https://space.bilibili.com/677825194
2、mysql主要配置如下
cat > /etc/my.cnf <<EOF
[client]
socket=/tmp/mysql.sock
[mysqld]
user=mysql
port=3306
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
log_bin=/usr/local/mysql/binlog
log_error=/usr/local/mysql/data/err.log
server_id=100
socket=/tmp/mysql.sock
gtid_mode=ON
enforce_gtid_consistency=ON
master_info_repository=TABLE
relay_log_info_repository=TABLE
log_slave_updates=ON
tmpdir = /tmp
default-storage-engine=INNODB
disabled_storage_engines =MyISAM,BLACKHOLE,FEDERATED,CSV,ARCHIVE
max_connections=500
max_allowed_packet=32M
default_authentication_plugin=mysql_native_password
binlog_checksum=NONE
binlog_transaction_dependency_tracking = WRITESET
transaction_write_set_extraction=XXHASH64
loose-group_replication_group_name="fe6a56f8-1ba4-4a6e-a6ac-81148224101a"
loose-group_replication_start_on_boot=OFF
loose-group_replication_local_address= "master:33061"
loose-group_replication_group_seeds="master:33061,slave1:33062,slave2:33063"
loose-group_replication_bootstrap_group=OFF
#loose-group_replication_ip_whitelist="master,slave1,slave2,manager"
[mysql]
socket=/tmp/mysql.sock
prompt=master [\\d]>
EOF
slav1节点
cat > /etc/my.cnf <<EOF
[client]
socket=/tmp/mysql.sock
[mysqld]
user=mysql
port=3306
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
log_bin=/usr/local/mysql/binlog
log_error=/usr/local/mysql/data/err.log
server_id=101
socket=/tmp/mysql.sock
gtid_mode=ON
enforce_gtid_consistency=ON
master_info_repository=TABLE
relay_log_info_repository=TABLE
log_slave_updates=ON
tmpdir = /tmp
default-storage-engine=INNODB
disabled_storage_engines =MyISAM,BLACKHOLE,FEDERATED,CSV,ARCHIVE
max_connections=500
max_allowed_packet=32M
default_authentication_plugin=mysql_native_password
binlog_checksum=NONE
binlog_transaction_dependency_tracking = WRITESET
transaction_write_set_extraction=XXHASH64
loose-group_replication_group_name="fe6a56f8-1ba4-4a6e-a6ac-81148224101a"
loose-group_replication_start_on_boot=OFF
loose-group_replication_local_address= "slave1:33061"
loose-group_replication_group_seeds="master:33061,slave1:33062,slave2:33063"
loose-group_replication_bootstrap_group=OFF
#loose-group_replication_ip_whitelist="master,slave1,slave2,manager"
[mysql]
socket=/tmp/mysql.sock
prompt=slave1 [\\d]>
EOF
slav2节点
cat > /etc/my.cnf <<EOF
[client]
socket=/tmp/mysql.sock
[mysqld]
user=mysql
port=3306
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
log_bin=/usr/local/mysql/binlog
log_error=/usr/local/mysql/data/err.log
server_id=102
socket=/tmp/mysql.sock
gtid_mode=ON
enforce_gtid_consistency=ON
master_info_repository=TABLE
relay_log_info_repository=TABLE
log_slave_updates=ON
tmpdir = /tmp
default-storage-engine=INNODB
disabled_storage_engines =MyISAM,BLACKHOLE,FEDERATED,CSV,ARCHIVE
max_connections=500
max_allowed_packet=32M
default_authentication_plugin=mysql_native_password
binlog_checksum=NONE
binlog_transaction_dependency_tracking = WRITESET
transaction_write_set_extraction=XXHASH64
loose-group_replication_group_name="fe6a56f8-1ba4-4a6e-a6ac-81148224101a"
loose-group_replication_start_on_boot=OFF
loose-group_replication_local_address= "slave2:33061"
loose-group_replication_group_seeds="master:33061,slave1:33062,slave2:33063"
loose-group_replication_bootstrap_group=OFF
#loose-group_replication_ip_whitelist="master,slave1,slave2,manager"
[mysql]
socket=/tmp/mysql.sock
prompt=slave2 [\\d]>
EOF
本文来自博客园,作者:!!雪莲花!!,转载请注明原文链接:https://www.cnblogs.com/zhj5418/p/15245910.html
浙公网安备 33010602011771号