标签:主从复制 ash not run mys server $2 second not run
思路是通过show slave status这条命令来查看主从复制的状态,然后根据状态字段的值进行判断。
show slave status\G; #显示slave状态; slave_IO_Running #---IO线程是否有连接到主服务器上 Seconds_Behind_Master #---主从同步的延时时间.
mysql_check.sh mysql -urep -pimooc -e "show slave status\G;" | grep "Slave_IO_Running"|awk "{if($2!="Yes"){print "Slave theard not running!";exit 1}}" if [ $? -eq 0 ];then mysql -urep -pimooc -e "show slave status\G;" | grep "Slave_IO_Running"|awk "{if($2!="Yes"){print "Seconds_Behind_Master";exit 1}}" else echo "Connect MySQL server not succeeded!" fi
创建一个用户的命令
标签:主从复制 ash not run mys server $2 second not run
原文地址:https://www.cnblogs.com/shanghai1918/p/12842864.html