linux版本:CentOS Linux release 7.8.2003 (Core)
mysql版本:Ver 8.0.18 for el7 on x86_64 (MySQL Community Server - GPL)
前提:
1、服务器规划,都关闭防火墙,中控机能ssh到各个安装节点
192.168.17.170 linuxsinglemysql 中控机
192.168.17.132 mgr01 mysql主节点
192.168.17.133 mgr02 mysql从节点1
192.168.17.135 mgr03 mysql从节点1
2、中控机 /shell/installmgr下文件
hostnameimport.txt hostnameip.txt installmgr.sh mgrmastercreate.sh mgrslavecreate.sh my.cnf mysqld mysqlinstall.sh mysql.local
/soft下如下文件 mysql-8.0.18-el7-x86_64.tar.gz
脚本执行:
中控机/shell/installmgr执行 sh installmgr.sh
等待3-5分钟,搭建完毕!
脚本如下
1、vim installmgr.sh
2、vim mysqlinstall.sh
3、vim mgrmastercreate.sh
4、vim mgrslavecreate.sh
5、vim hostnameimport.txt
192.168.17.132 mgr01
192.168.17.133 mgr02
192.168.17.135 mgr03
192.168.17.170 linuxsinglemysql
6、vim hostnameip.txt
192.168.17.132 mgr01 1
192.168.17.133 mgr02 0
192.168.17.135 mgr03 0