标签:status art 通过 mys password word system alived /dev/null
[root@mariadb01 ~]# cat check_mysql.sh$MYSQL -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD -e "show status;" >/dev/null 2>&1
#$mysqlclient --host=$host --port=$port --user=$user --password=$password -e "show databases;" > /dev/null 2>&1
if [ $? == 0 ]
then
echo " $host mysql login successfully "
systemctl start keepalived
exit 0
else
echo " $host mysql login faild"
systemctl stop keepalived
exit 2
fi
通过脚本调用mysql来启动keepalived的配置的VIP
标签:status art 通过 mys password word system alived /dev/null
原文地址:http://blog.51cto.com/wsw26/2067195