双master+heartbeat实现自动切换

               

author:skate
time:2012/07/12

双master+heartbeat实现自动切换


heartbeat主要是主机故障切换,服务故障不切换,如要服务故障切换就需要自己写脚本检测服务的状态,如果服务异常则调用heartbeat切换脚本完成切换

环境:
os:rht5.2
mysql:percona5.5
heartbeat:2.1.3


1.首先在双机上安装mysql软件
参考:http://blog.csdn.net/wyzxg/article/details/7695663

master1.skate.com的my.cnf添加如下配置

server-id       = 1
log_bin=/data/mysql/binlog/master_binlog.log
binlog-do-db=skate
log_slave_updates=1
auto_increment_increment=2
auto_increment_offset=1
binlog_format=mixed
expire_logs_days=7


master2.skate.com的my.cnf添加如下配置

server-id       = 2
log_bin=/data/mysql/binlog/master_binlog.log
binlog-do-db=skate
log_slave_updates=1
auto_increment_increment=2
auto_increment_offset=1
binlog_format=mixed
expire_logs_days=7

创建复制帐户
mysql>GRANT REPLICATION SLAVE ON *.* TO

猜你喜欢

转载自blog.csdn.net/ffuygggh/article/details/87287990
今日推荐