MySQL AB复制(四)

2014-11-24 17:00:06 · 作者: · 浏览: 4
_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 107
Relay_Log_Space: 107
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 0
1 row in set (0.00 sec)ERROR:
No query specifiedmysql> start slave;
Query OK, 0 rows affected (0.01 sec)
第六步,从服务器查看是否和主服务器通信成功。如果出现 Slave_IO_Running和Slave_SQL_Running都是yes,则证明配置成功
mysql> show slave status \G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.1.11
Master_User: larry
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000001
Read_Master_Log_Pos: 107
Relay_Log_File: serv08-relay-bin.000002
Relay_Log_Pos: 253
Relay_Master_Log_File: mysql-bin.000001
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 107
Relay_Log_Space: 410
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
1 row in set (0.00 sec)ERROR:
No query specified
第七步,从服务器查看数据文件的更改
[root@serv08 data]# ll
total 28724
-rw-rw----. 1 mysql mysql 18874368 Oct 5 19:45 ibdata1
-rw-rw----. 1 mysql mysql 5242880 Oct 5 19:45 ib_logfile0
-rw-rw----. 1 mysql mysql 5242880 Oct 5 18:16 ib_logfile1
-rw-rw----. 1 mysql mysql 78 Oct 5 19:49 master.info
drwxr-xr-x. 2 mysql mysql 4096 Oct 5 18:15 mysql
-rw-rw----. 1 mysql mysql 107 Oct 5 19:45 mysql-bin.000001
-rw-rw----. 1 mysql mysql 19 Oct 5 19:45 mysql-bin.index
drwx------. 2 mysql mysql 4096 Oct 5 18:15 performance_schema
-rw-rw----. 1 mysql mysql 51 Oct 5 19:49 relay-log.info
-rw-r-----. 1 mysql root 5589 Oct 5 19:49 serv08.host.com.err
-rw-rw----. 1 mysql mysql 5 Oct 5 19:45 serv08.host.com.pid
-rw-rw----. 1 mysql mysql 157 Oct 5 19:49 serv08-relay-bin.000001
-rw-rw----. 1 mysql mysql 253 Oct 5 19:49 serv08-relay-bin.000002
-rw-rw----. 1 mysql mysql 52 Oct 5 19:49 serv08-relay-bin.index
drwxr-xr-x. 2 mysql mysql 4096 Oct 5 18:12 test
[root@serv08 data]# cat relay-log.info
./serv08-relay-bin.000002
253
mysql-bin.000001
107
[root@serv08 data]# cat master.info
18
mysql-bin.000001
107
192.168.1.11
larry
larry
3306
第八步,测试
--serv08查看数据库
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.02 sec)--serv01创建数据库
mysql> create database larrydb;
Query OK, 1 row