首先配置主服务器 #!/bin/bash echo 关闭防火墙 systemctl stop firewalld.service setenforce 0 yum -y install mariadb mariadb-server &> /dev/null if [ $? -eq 0 ];then echo mysql安装成功 else echo mysql安装失败,请重新安装 yum -y install mariadb mariadb-server &> /dev/null fi sed -i '10aserver-id=1' /etc/my.cnf sed -i '11