mysql8叢集搭建
叢集搭建參考mysql5.7的搭建
http://blog.itpub.net/70004783/viewspace-2838198/
環境:
mysql-8.0.26
centos7.9
主庫 dbserver01 10.8.98.102
從庫1 dbserver02 10.8.98.103
從庫2 dbserver03 10.8.98.104
mysql8叢集的搭建與5.7只有略微不同
在於主庫引數和備庫引數
主庫引數
[root@dbserver01 ~]# cat /etc/my.cnf [mysql] default-character-set=utf8mb4 socket=/u01/data/3306/mysql.sock [mysqld] #skip-name-resolve port = 3306 socket=/u01/data/3306/mysql.sock basedir=/u01/app/mysql datadir=/u01/data/3306/data character-set-server=utf8mb4 default-storage-engine=INNODB innodb_buffer_pool_size = 200M max_allowed_packet=16M explicit_defaults_for_timestamp=1 log-output=FILE general_log = 0 general_log_file=/u01/log/3306/3306db-general.err slow_query_log = ON slow_query_log_file=/u01/log/3306/3306db-query.err long_query_time=10 log-error=/u01/log/3306/3306db-error.err #mysql5.7的密碼策略,8.0很多客戶端不支援 default-authentication-plugin=mysql_native_password #mysql cluster master add bind-address=10.8.98.102 server_id=1023306 skip_name_resolve=ON expire_logs_days=7 #innodb_support_xa=1 binlog_cache_size=1M max_binlog_size=2048M log_bin_trust_function_creators=1 innodb_flush_log_at_trx_commit=1 sync_binlog=1 transaction-isolation=READ-COMMITTED gtid_mode=ON enforce_gtid_consistency=1 log-slave-updates=1 binlog_gtid_simple_recovery=1 log_bin=/u01/log/3306/binlog/dbserver-binlog log_bin_index=/u01/log/3306/binlog/dbserver-binlog.index binlog_format=ROW binlog_rows_query_log_events=on plugin_dir=/u01/app/mysql/lib/plugin/ plugin_load="rpl_semi_sync_source=semisync_source.so;rpl_semi_sync_replica=semisync_replica.so" loose_rpl_semi_sync_source_enabled=1 loose_rpl_semi_sync_replica_enabled=1 loose_rpl_semi_sync_source_timeout=5000 rpl_semi_sync_source_wait_point=AFTER_SYNC rpl_semi_sync_source_wait_for_replica_count=1 [root@dbserver01 ~]#
與原來5.7的區別只在於以下幾行
#innodb_support_xa=1 ###此行註釋掉,啟動會報錯unknown variable 'innodb_support_xa=1'
以下幾個8.0版本引數的名字改了,對應修改即可
plugin_load="rpl_semi_sync_source=semisync_source.so;rpl_semi_sync_replica=semisync_replica.so"
loose_rpl_semi_sync_source_enabled=1
loose_rpl_semi_sync_replica_enabled=1
loose_rpl_semi_sync_source_timeout=5000
rpl_semi_sync_source_wait_point=AFTER_SYNC
rpl_semi_sync_source_wait_for_replica_count=1
備庫引數參考
[root@dbserver02 ~]# cat /etc/my.cnf [mysql] default-character-set=utf8mb4 socket=/u01/data/3306/mysql.sock [mysqld] #skip-name-resolve port = 3306 socket=/u01/data/3306/mysql.sock basedir=/u01/app/mysql datadir=/u01/data/3306/data character-set-server=utf8mb4 default-storage-engine=INNODB innodb_buffer_pool_size = 200M max_allowed_packet=16M explicit_defaults_for_timestamp=1 log-output=FILE general_log = 0 general_log_file=/u01/log/3306/3306db-general.err slow_query_log = ON slow_query_log_file=/u01/log/3306/3306db-query.err long_query_time=10 log-error=/u01/log/3306/3306db-error.err #mysql5.7的密碼策略,8.0很多客戶端不支援 default-authentication-plugin=mysql_native_password #mysql cluster slave add bind-address=10.8.98.103 server_id=1033306 skip_name_resolve=ON expire_logs_days=7 #innodb_support_xa=1 binlog_cache_size=1M max_binlog_size=2048M log_bin_trust_function_creators=1 innodb_flush_log_at_trx_commit=1 sync_binlog=1 transaction-isolation=READ-COMMITTED gtid_mode=ON enforce_gtid_consistency=1 log-slave-updates=1 binlog_gtid_simple_recovery=1 log_bin=/u01/log/3306/binlog/dbserver-binlog log_bin_index=/u01/log/3306/binlog/dbserver-binlog.index binlog_format=ROW binlog_rows_query_log_events=on relay_log=/u01/log/3306/relaylog/dbserver-relay.log read_only=1 plugin_dir=/u01/app/mysql/lib/plugin/ plugin_load="rpl_semi_sync_source=semisync_source.so;rpl_semi_sync_replica=semisync_replica.so" loose_rpl_semi_sync_source_enabled=1 loose_rpl_semi_sync_replica_enabled=1 loose_rpl_semi_sync_source_timeout=5000 rpl_semi_sync_source_wait_point=AFTER_SYNC rpl_semi_sync_source_wait_for_replica_count=1 [root@dbserver02 ~]#
其餘可參考叢集mysql5.7的搭建
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70004783/viewspace-2838272/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 搭建zookeeper叢集(偽叢集)
- zookeeper叢集及kafka叢集搭建Kafka
- linux下搭建ZooKeeper叢集(偽叢集)Linux
- Redis系列:搭建Redis叢集(叢集模式)Redis模式
- 搭建ELK叢集
- Ambari叢集搭建
- kafka叢集搭建Kafka
- Hadoop搭建叢集Hadoop
- zookeeper 叢集搭建
- 搭建 Redis 叢集Redis
- nacos 叢集搭建
- mysql叢集搭建MySql
- redis叢集搭建Redis
- Hadoop叢集搭建Hadoop
- Zookeeper叢集搭建
- RabbitMQ叢集搭建MQ
- HBASE叢集搭建
- 【環境搭建】RocketMQ叢集搭建MQ
- 4.4 Hadoop叢集搭建Hadoop
- Redis(5.0) 叢集搭建Redis
- MySQL 5.7 叢集搭建MySql
- 搭建spark on yarn 叢集SparkYarn
- ZooKeeper 搭建 solr 叢集Solr
- 搭建Redis原生叢集Redis
- 搭建MongoDB分片叢集MongoDB
- MySQL MGR 叢集搭建MySql
- 【greenplum】greenplum叢集搭建
- Kubernetes 叢集搭建(上)
- Kubernetes 叢集搭建(下)
- MongoDB 分片叢集搭建MongoDB
- ElasticSearch 7.8.1叢集搭建Elasticsearch
- Redis--叢集搭建Redis
- Docker 搭建叢集 MongoDBDockerMongoDB
- zookeeper叢集的搭建
- Hadoop叢集搭建(一)Hadoop
- Kubernetes叢集搭建(vagrant)
- ONOS叢集的搭建
- 搭建redis cluster叢集Redis