9、主从服务器测试:
  主服务器Mysql,建立数据库,并在这个库中建表插入一条数据:
mysql> create database hi_db;
Query OK, 1 row affected (0.00 sec)
mysql> use hi_db;
Database changed
mysql>  create table hi_tb(id int(3),name char(10));
Query OK, 0 rows affected (0.00 sec)
mysql> insert into hi_tb values(001,'bobu');
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| hi_db              |
| mysql              |
| test               |
+--------------------+
4 rows in set (0.00 sec)
从服务器Mysql查询:
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| hi_db              |          //I'M here,大家看到了吧
| mysql              |
| test               |
+--------------------+
4 rows in set (0.00 sec)
mysql> use hi_db
Database changed
mysql> select * from hi_tb;    //可以看到在主服务器上新增的具体数据
+------+------+
| id   | name |
+------+------+
|    1 | bobu |
+------+------+
1 row in set (0.00 sec)
  10、完成:
  编写一shell脚本,用nagios监控slave的两个“yes”,如发现只有一个或零个“yes”,表明主从有问题了,发短信警报吧。