[MySQL] MySQL 5.6 Replication and Failover

Preparation :
1.準備四台CentOS 6.x 64bit的VM
2.在上面先裝好MySQL在每個VM裡

1.安裝MySQL UtilitiesMySQL Connector/Python
// for utilties
#python setup.py install
// for connector/python
#rpm -ivh mysql-connector-python-1.0.12-1.el6.noarch.rpm

2.設定my.cnf在每台MySQL上
[mysqld]
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
binlog-format=ROW
gtid-mode=on
enforce-gtid-consistency=true
master-info-repository=TABLE
relay-log-info-repository=TABLE
sync-master-info=1
server-id=1  #每台機器都要不一樣