系统:centos 6.5(32bit)
glue版本:1.0.12
resource agents版本:3.9.6
heartbeat版本:3.0.6
一.准备工作(过程省略)
1.配置节点IP和VIP保证主机间能通信;
2.主机名和uname -e相同;
3.编辑/etc/hosts文件使节点间能通过主机名相互解析;
4.节点间免密码登录
5.时间同步
二.安装heartbeat(安装顺序为glue,resource-agents , Heartbeat)
1.安装依赖的插件
[root@node1 ~]# yum install bison bison-devel flex flex-devel OpenIPMI OpenIPMI-devel OpenIPMI net-snmp net-snmp-devel net-snmp-python net-snmp-libs net-snmp-utils OpenIPMI-libs autoconf automake libtool libtool-devel glib2-devel libxml2 libxml2-devel bzip2 bzip2-devel bzip2-libs libtool-ltdl libtool-ltdl-devel libxslt-devel libxslt docbook-style-xsl asciidoc e2fsprogs-devel libuuid-devel docbook-dtds
两篇文章安装的插件不同,为了避免出错,全安装了......全程没出错,看来还是有效果的!
2.添加用户和组
新建用户hacluster属于新建组haclient,用于配置respawn
[root@node1 ~]# groupadd haclient
[root@node1 ~]# useradd -g haclient hacluster -M -s /sbin/nologin
[root@node1 ~]# id hacluster
uid=501(hacluster) gid=501(haclient) groups=501(haclient)
3.安装glue
3.1解压至/usr/local/heartbeat下
[root@node1 ~]# tar xf clusterglue-1.0.12.tar.bz2 -C /usr/local/heartbeat
3.2进入到解压目录下执行./autogen.sh生成configure文件
[root@node1 ~]# cd /usr/local/heartbeat/Reusable-Cluster-Components-glue--0a7add1d9996/
[root@node1 Reusable-Cluster-Components-glue--0a7add1d9996]# ./autogen.sh
[root@node1 Reusable-Cluster-Components-glue--0a7add1d9996]# ./configure LIBS='/lib/libuuid.so.1'
glue的配置信息:
cluster-glue configuration:
Version = 1.0.12 (Build: 0a7add1d9996b6d869d441da6c82fb7b8abcef4f)
Features =
Prefix = /usr
Executables = /usr/sbin
Man pages = /usr/share/man
Libraries = /usr/lib
Header files = /usr/include
Arch-independent files = /usr/share
Documentation = /usr/share/doc/cluster-glue
State information = /usr/var
System configuration = /usr/etc
Use system LTDL = yes
HA group name = haclient
HA user name = hacluster
CFLAGS = -g -O2 -ggdb -fgnu89-inline -fstack-protector-all -Wall -Waggregate-return -Wbad-function-cast -Wcast-qual -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Wfloat-equal -Wformat=2 -Wformat-security -Wformat-nonliteral -Winline -Wmissing-prototypes -Wmissing-declarations -Wmissing-format-attribute -Wnested-externs -Wno-long-long -Wno-strict-aliasing -Wpointer-arith -Wstrict-prototypes -Wwrite-strings -ansi -D_GNU_SOURCE -DANSI_ONLY -Werror
Libraries = -lbz2 -lz -lxml2 -lc -luuid -lrt -ldl /lib/libuuid.so.1 -lglib-2.0 -lltdl
Stack Libraries =
3.3编译
[root@node1 Reusable-Cluster-Components-glue--0a7add1d9996]# make
3.4编译安装
[root@node1 Reusable-Cluster-Components-glue--0a7add1d9996]# make install
4.安装resource agents
4.1解压到/usr/local/heartbeat下
[root@node1 ~]# tar xf resource-agents-3.9.6.tar.gz -C /usr/local/heartbeat/
4.2进入到解压目录下执行./autogen.sh
[root@node1 ~]# cd /usr/local/heartbeat/resource-agents-3.9.6/
[root@node1 resource-agents-3.9.6]# ./autogen.sh
[root@node1 resource-agents-3.9.6]# ./configure LIBS='/lib/libuuid.so.1'
RA配置信息:
resource-agents configuration:
Version = UNKNOWN
Build Version = 02beac55c1da0ad99a5a19bd3b2333bcff7e916c
Features =
Prefix = /usr
Executables = /usr/sbin
Man pages = /usr/share/man
Libraries = /usr/lib
Header files = /usr/include
Arch-independent files = /usr/share
Documentation = /usr/share/doc/resource-agents
State information = /var
System configuration = /etc
HA_BIN directory prefix = /usr/libexec
RA state files = /var/run/resource-agents
AIS Plugins =
CFLAGS = -g -O2 -ggdb3 -fgnu89-inline -fstack-protector-all -Wall -Wbad-function-cast -Wcast-qual -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Wfloat-equal -Wformat=2 -Wformat-security -Wformat-nonliteral -Winline -Wmissing-prototypes -Wmissing-declarations -Wmissing-format-attribute -Wnested-externs -Wno-long-long -Wno-strict-aliasing -Wpointer-arith -Wstrict-prototypes -Wwrite-strings -ansi -D_GNU_SOURCE -DANSI_ONLY -Werror
Libraries = /lib/libuuid.so.1 -lglib-2.0
Stack Libraries =
4.3编译
[root@node1 resource-agents-3.9.6]# make
4.4编译安装
[root@node1 resource-agents-3.9.6]# make install
5.安装heartbeat
5.1解压到/usr/local/heartbeat下
[root@node1 ~]# tar xf heartbeat-3.0.6.tar.bz2 -C /usr/local/heartbeat/
5.2进入到解压目录下执行bootstrap文件
[root@node1 ~]# cd /usr/local/heartbeat/Heartbeat-3-0-958e11be8686/
[root@node1 Heartbeat-3-0-958e11be8686]# ./bootstrap
[root@node1 Heartbeat-3-0-958e11be8686]# ./ConfigureMe configure LIBS='/lib/libuuid.so.1'
heartbeat配置信息:
heartbeat configuration:
Version = "3.0.6"
Executables = "/usr/sbin"
Man pages = "/usr/share/man"
Libraries = "/usr/lib"
Header files = "/usr/include"
Arch-independent files = "/usr/share"
Documentation files = "/usr/share/doc/heartbeat"
State information = "/var"
System configuration = "/etc"
Init (rc) scripts = "/etc/rc.d/init.d"
Init (rc) defaults = "/etc/sysconfig"
Use system LTDL = "yes"
HA group name = "haclient"
HA group id = "501"
HA user name = "hacluster"
HA user user id = "501"
Build dopd plugin = "yes"
Enable times kludge = "yes"
CC_WARNINGS = " -Wall -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wdeclaration-after-statement -Wpointer-arith -Wwrite-strings -Wcast-qual -Wcast-align -Wbad-function-cast -Winline -Wmissing-format-attribute -Wformat=2 -Wformat-security -Wformat-nonliteral -Wno-long-long -Wno-strict-aliasing -Werror "
Mangled CFLAGS = "-g -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wdeclaration-after-statement -Wpointer-arith -Wwrite-strings -Wcast-qual -Wcast-align -Wbad-function-cast -Winline -Wmissing-format-attribute -Wformat=2 -Wformat-security -Wformat-nonliteral -Wno-long-long -Wno-strict-aliasing -Werror -ggdb3 -funsigned-char"
Libraries = "-lbz2 -lz -lc -luuid -lrt -ldl /lib/libuuid.so.1 -lltdl"
RPATH enabled = "no"
Distro-style RPMs = "no"
Note: If you use the 'make install' method for installation you
also need to adjust '/etc/passwd' and '/etc/group' manually.
5.3编译
[root@node1 Heartbeat-3-0-958e11be8686]# make
5.4编译安装
[root@node1 Heartbeat-3-0-958e11be8686]# make install
6.heartbeat的主配置文件位置
[root@node1 ~]# ll /etc/ha.d/
-rwxr-xr-x 1 root root 745 Nov 3 19:51 harc
drwxr-xr-x 2 root root 4096 Nov 3 19:51 rc.d
-rw-r--r-- 1 root root 692 Nov 3 19:51 README.config
drwxr-xr-x 2 root root 4096 Nov 3 19:51 resource.d
-rw-r--r-- 1 root root 2080 Nov 3 19:41 shellfuncs
[root@node1 ~]# ll /usr/share/ | egrep "heartbeat|agents|glue"
drwxr-xr-x 3 root root 4096 Nov 3 19:31 cluster-glue
drwxr-xr-x 3 root root 4096 Nov 3 19:51 heartbeat
drwxr-xr-x 3 root root 4096 Nov 3 19:41 resource-agents
参考资料:
http://blog.csdn.net/celeste7777/article/details/47808519