linux版本:CentOS Linux release 7.8.2003 (Core)
mysql版本:Ver 8.0.18 for el7 on x86_64 (MySQL Community Server - GPL)
前提:
1、服務(wù)器規(guī)劃,都關(guān)閉防火墻,中控機能ssh到各個安裝節(jié)點
192.168.17.170 linuxsinglemysql 中控機
192.168.17.132 mgr01? ? ?mysql主節(jié)點
192.168.17.133 mgr02? ? ?mysql從節(jié)點1
192.168.17.135 mgr03? ? ?mysql從節(jié)點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
腳本執(zhí)行:
中控機/shell/installmgr執(zhí)行??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