shell腳本搭建mgr

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

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容