MySQL> change master to
-> master_host='master.a.com',
-> master_user='rep',
-> master_password='RedHat',
-> master_ssl=1,
-> master_ssl_ca='/etc/mysql/certs/cacert.pem',
-> master_ssl_cert='/etc/mysql/certs/slave_cert.pem',
-> master_ssl_key='/etc/mysql/certs/slave_key.pem';
Query OK, 0 rows affected (0.02 sec)
mysql> start slave;
OK,此时主从服务器之间就可以使用SSL进行会话了。
层级复制:

配置一个中继服务器过程:
1 Configure the slave to forward any events executed by the slave thread by writing them to the binlog of the relay slave.
2 Change the storage engine for all tables on the relay slave to use the BLACKHOLE storage engine to preserve space and improve performance
3 Ensure that any new tables added to the relay also use the BLACKHOLE engine
mysql> SET GLOBAL STORAGE_ENGINE = 'BLACKHOLE';
relay> SHOW TABLES FROM mydb;
relay> SET SQL_LOG_BIN = 0;
relay> ALTER TABLE user_data ENGINE = 'BLACKHOLE';
…
…
relay> ALTER TABLE profile ENGINE = 'BLACKHOLE';
relay> SET SQL_BIN_LOG = 1;
