- MySQL> show slave status\G
- *************************** 1. row ***************************
- Slave_IO_State: Waiting for master to send event
- Master_Host: 192.168.80.144
- Master_User: repluser
- Master_Port: 3306
- Connect_Retry: 60
- Master_Log_File: mysql-bin.000011
- Read_Master_Log_Pos: 107
- Relay_Log_File: mysql-relay.000002
- Relay_Log_Pos: 557
- Relay_Master_Log_File: mysql-bin.000011
- Slave_IO_Running: No
- Slave_SQL_Running: No
- 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: 411
- Relay_Log_Space: 709
- Until_Condition: None
- Until_Log_File:
- Until_Log_Pos: 0
- Master_SSL_Allowed: Yes
- Master_SSL_CA_File: /usr/local/mysql/ssl/cacert.pem
- Master_SSL_CA_Path:
- Master_SSL_Cert: /usr/local/mysql/ssl/master2slave.crt
- Master_SSL_Cipher:
- Master_SSL_Key: /usr/local/mysql/ssl/master2slave.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: 2
- 1 row in set (0.00 sec)
确认无误后启动slave :
- mysql> start slave;
- mysql> show slave status\G
- ...
- Slave_IO_Running: Yes
- Slave_SQL_Running: Yes
- ...
四、测试:
在Master1上建立数据库:
mysql> create database tb;
在Master2上查看已经有了:
在Master2上建立表:
- mysql> use tb
- mysql> create table aa (name varchar(10));
- mysql> insert into aa ('CentOS'),('jin');
在Master1上查看:
至于验证SSL的话,可以用SSL连接试验,如下:
可以看到已经有SSL
SSL: Cipher in use is DHE-RSA-AES256-SHA
至此myslq主-主复制 + ssl认证 就已经OK了,如有错误请指出,非常感谢!



