服务器环境
| 系统 | 主机名 | IP |
|---|---|---|
| centos7.9 | mha-master | 192.168.200.41、192.168.200.45(vip) |
| centos7.9 | mha-slave01 | 192.168.200.42 |
| centos7.9 | mha-slave02 | 192.168.200.43 |
| centos7.9 | mha-monitor | 192.168.200.40 |
SSH互信
mha-master、mha-slave01、mha-slave02、mha-monitor四台机器之间设置免密互信
mysql安装
-
mha-master、mha-slave01、mha-slave02安装mysql8
tar zxvf mysql-8.0.19-1.el7.x86_64.rpm-bundle.tar.gz rpm -e --nodeps mariadb-libs-5.5.68-1.el7.x86_64 rpm -ivh mysql-community-common-8.0.19-1.el7.x86_64.rpm --nodeps --force rpm -ivh mysql-community-libs-8.0.19-1.el7.x86_64.rpm --nodeps --force rpm -ivh mysql-community-client-8.0.19-1.el7.x86_64.rpm --nodeps --force rpm -ivh mysql-community-server-8.0.19-1.el7.x86_64.rpm --nodeps --force # yum 安装perl-DBD-MySQL依赖 rpm -ivh mysql-community-libs-compat-8.0.19-1.el7.x86_64.rpm --nodeps --forcemkdir -p /data/mysql/data /data/mysql/mysql-files /data/mysql/mysql-keyring chown -R mysql:mysql /data/mysql rm -rf /var/lib/mysql rm -rf /var/lib/mysql-files rm -rf /var/lib/mysql-keyring ln -s /data/mysql/data /var/lib/mysql ln -s /data/mysql/mysql-files /var/lib/mysql-files ln -s /data/mysql/mysql-keyring /var/lib/mysql-keyring -
修改my.cnf
[mysqld] port=3308 default-time-zone='+08:00' server-id=41 # server的唯一标识 log-bin=mysql-bin binlog_format=row binlog-ignore-db=mysql #要忽略的数据库 binlog-ignore-db=information_schema binlog-ignore-db=performance_schema binlog-ignore-db=sys replicate_ignore_db=mysql replicate_ignore_db=information_schema replicate_ignore_db=performance_schema replicate_ignore_db=sys log-slave-updates=1 # 允许从服

最低0.47元/天 解锁文章
1787

被折叠的 条评论
为什么被折叠?



