ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Mysql 双主 + heartbeat + Mon 部署文档

Mysql 双主 + heartbeat + Mon 部署文档

原创 Linux操作系统 作者:season0891 时间:2010-05-12 13:43:46 0 删除 编辑
Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 1 mysql双主安装

版本 mysql-5.1.45-linux-x86_64-icc-glibc23.tar.gz

安装过程同mysql replication 。

安装过程略 。

 

2 部署 heartbeat

下载安装包在:http://www.centos.org

heartbeat-2.1.3-3.el4.centos.x86_64.rpm

heartbeat-stonith-2.1.3-3.el4.centos.x86_64.rpm

heartbeat-devel-2.1.3-3.el4.centos.x86_64.rpm

libnet-1.1.2.1-2.rf.x86_64.rpm

heartbeat-pils-2.1.3-3.el4.centos.x86_64.rpm  

perl-TimeDate-1.16-1.c4.noarch.rpm

 

rpm –ivh libnet-1.1.2.1-2.rf.x86_64.rpm

rpm –ivh heartbeat*

rpm –ivh perl-TimeDate-1.16-1.c4.noarch.rpm

 

heartbeat配置文件(两个节点操作完全相同,以其中一个节点为例,另一个节点略)

[root@IDC-D-1237 ~]# cp /usr/share/doc/heartbeat-2.1.3/ha.cf /etc/ha.d/

[root@IDC-D-1237 ~]# cp /usr/share/doc/heartbeat-2.1.3/authkeys /etc/ha.d/

[root@IDC-D-1237 ~]# cp /usr/share/doc/heartbeat-2.1.3/haresources /etc/ha.d/

 

要求 authkeys 权限为600

chmod 600 authkeys

配置完成后各个文件的内容如下 :

[root@IDC-D-1237 ha.d]# cat authkeys |grep "^[^#]"

auth 2

2 sha1 HI!

[root@IDC-D-1237 ha.d]# cat ha.cf |grep "^[^#]"

debugfile /var/log/ha-debug

logfile /var/log/ha-log

logfacility     local0

keepalive 2

deadtime 30

warntime 5

initdead 120

udpport 694

ucast eth0 123.100.1.9 (对方ip)

ucast eth1 10.2.23.27 (对方ip)

auto_failback on

node IDC-D-1229

node IDC-D-1237

[root@IDC-D-1237 ha.d]# cat haresources |grep "^[^#]"

IDC-D-1229  10.2.23.88

[root@IDC-D-1237 ha.d]# service heartbeat start

ifconfig (可查看vip 漂出情况)

 

以上配置文件在2个节点要求完全相同。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/90618/viewspace-662511/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 安装sysbench 方法
请登录后发表评论 登录
全部评论

注册时间:2008-06-10

  • 博文量
    790
  • 访问量
    2098099