|
安装步骤如下:
两个节点
web1 172.16.100.8
web2 172.16.100.9
VIP:172.16.100.100
web1的配置如下
[iyunv@web1 ~]# cat /etc/hosts
hosts hosts.allow hosts.deny
[iyunv@web1 ~]# cat /etc/hosts
hosts hosts.allow hosts.deny
[iyunv@web1 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.100.8 web1.sdzy.cn web1
172.16.100.9 web2.sdzy.cn web2
[iyunv@web1 ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=web1.sdzy.cn
[iyunv@web1 ~]# uname -n
web1.sdzy.cn
[iyunv@web1 ~]# ifconfig
eth1 Link encap:Ethernet HWaddr 00:50:56:2A:84:EB
inet addr:172.16.100.8 Bcast:172.16.100.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe2a:84eb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1884 errors:0 dropped:0 overruns:0 frame:0
TX packets:1534 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:341923 (333.9 KiB) TX bytes:292151 (285.3 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
web2的配置如下
[iyunv@web2 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.100.8 web1.sdzy.cn web1
172.16.100.9 web2.sdzy.cn web2
[iyunv@web2 ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=web2.sdzy.cn
[iyunv@web2 ~]# ifconfig
eth1 Link encap:Ethernet HWaddr 00:50:56:34:E7:9B
inet addr:172.16.100.9 Bcast:172.16.255.255 Mask:255.255.0.0
inet6 addr: fe80::250:56ff:fe34:e79b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2869 errors:0 dropped:0 overruns:0 frame:0
TX packets:2469 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:486685 (475.2 KiB) TX bytes:472672 (461.5 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:22 errors:0 dropped:0 overruns:0 frame:0
TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1166 (1.1 KiB) TX bytes:1166 (1.1 KiB)
所有节点安装的heartbeat的软件列表如下
-rw-r--r-- 1 root root 165292 Dec 3 2013 heartbeat-3.0.4-2.el6.x86_64.rpm
-rw-r--r-- 1 root root 269468 Dec 3 2013 heartbeat-libs-3.0.4-2.el6.x86_64.rpm
-rw-r--r-- 1 root root 114888 Sep 2 2014 heat-cfntools-1.2.6-4.el6.noarch.rpm
web1的ha的配置如下
[iyunv@web1 ha.d]# cat ha.cf | grep -v "^#.*"
logfacility local0
keepalive 1
bcast eth1
auto_failback on
node web1.sdzy.cn
node web2.sdzy.cn
ping 172.16.100.2
[iyunv@web1 ha.d]# cat haresources | grep -v "^#.*"
web1.sdzy.cn IPaddr2::172.16.100.4/24/eth1 httpd
[iyunv@web1 ha.d]# cat authkeys | grep -v "^#.*"
auth 1
1 md5 2a8559a2d3c8404fed986b16fbd49cb4
[iyunv@web1 ha.d]#
web2 的ha配置
[iyunv@web1 ha.d]# scp ha.cf authkeys haresources web2:/etc/ha.d/
ha.cf 100% 10KB 10.3KB/s 00:00
authkeys 100% 691 0.7KB/s 00:00
haresources
现在的问题为:
1。web2 经常dead
heartbeat的日志
Jan 5 08:49:13 web1 heartbeat: [2738]: info: Pacemaker support: false
Jan 5 08:49:13 web1 heartbeat: [2738]: WARN: Logging daemon is disabled --enabling logging daemon is recommended
Jan 5 08:49:13 web1 heartbeat: [2738]: info: **************************
Jan 5 08:49:13 web1 heartbeat: [2738]: info: Configuration validated. Starting heartbeat 3.0.4
Jan 5 08:49:13 web1 heartbeat: [2739]: info: heartbeat: version 3.0.4
Jan 5 08:49:13 web1 heartbeat: [2739]: info: Heartbeat generation: 1483526594
Jan 5 08:49:13 web1 heartbeat: [2739]: info: glib: UDP Broadcast heartbeat started on port 694 (694) interface eth1
Jan 5 08:49:13 web1 heartbeat: [2739]: info: glib: UDP Broadcast heartbeat closed on port 694 interface eth1 - Status: 1
Jan 5 08:49:13 web1 heartbeat: [2739]: info: glib: ping heartbeat started.
Jan 5 08:49:13 web1 heartbeat: [2739]: info: G_main_add_TriggerHandler: Added signal manual handler
Jan 5 08:49:13 web1 heartbeat: [2739]: info: G_main_add_TriggerHandler: Added signal manual handler
Jan 5 08:49:13 web1 heartbeat: [2739]: info: G_main_add_SignalHandler: Added signal handler for signal 17
Jan 5 08:49:13 web1 heartbeat: [2739]: info: Local status now set to: 'up'
Jan 5 08:49:13 web1 heartbeat: [2739]: info: Link 172.16.100.2:172.16.100.2 up.
Jan 5 08:49:13 web1 heartbeat: [2739]: info: Status update for node 172.16.100.2: status ping
Jan 5 08:49:13 web1 heartbeat: [2739]: info: Link web1.sdzy.cn:eth1 up.
Jan 5 08:49:44 web1 heartbeat: [2739]: WARN: node web2.sdzy.cn: is dead
Jan 5 08:49:44 web1 heartbeat: [2739]: info: Comm_now_up(): updating status to active
Jan 5 08:49:44 web1 heartbeat: [2739]: info: Local status now set to: 'active'
Jan 5 08:49:44 web1 heartbeat: [2739]: WARN: No STONITH device configured.
Jan 5 08:49:44 web1 heartbeat: [2739]: WARN: Shared disks are not protected.
Jan 5 08:49:44 web1 heartbeat: [2739]: info: Resources being acquired from web2.sdzy.cn.
Jan 5 08:49:44 web1 harc(default)[2750]: info: Running /etc/ha.d//rc.d/status status
Jan 5 08:49:44 web1 mach_down(default)[2782]: info: /usr/share/heartbeat/mach_down: nice_failback: foreign resources acquired
Jan 5 08:49:44 web1 mach_down(default)[2782]: info: mach_down takeover complete for node web2.sdzy.cn.
Jan 5 08:49:44 web1 heartbeat: [2739]: info: mach_down takeover complete.
Jan 5 08:49:44 web1 heartbeat: [2739]: info: Initial resource acquisition complete (mach_down)
Jan 5 08:49:45 web1 /usr/lib/ocf/resource.d//heartbeat/IPaddr2(IPaddr2_172.16.100.4)[2822]: INFO: Resource is stopped
Jan 5 08:49:45 web1 heartbeat: [2751]: info: Local Resource acquisition completed.
Jan 5 08:49:45 web1 harc(default)[2914]: info: Running /etc/ha.d//rc.d/ip-request-resp ip-request-resp
Jan 5 08:49:45 web1 ip-request-resp(default)[2914]: received ip-request-resp IPaddr2::172.16.100.4/24/eth1 OK yes
Jan 5 08:49:45 web1 ResourceManager(default)[2933]: info: Acquiring resource group: web1.sdzy.cn IPaddr2::172.16.100.4/24/eth1 httpd
Jan 5 08:49:45 web1 /usr/lib/ocf/resource.d//heartbeat/IPaddr2(IPaddr2_172.16.100.4)[2959]: INFO: Resource is stopped
Jan 5 08:49:45 web1 ResourceManager(default)[2933]: info: Running /etc/ha.d/resource.d/IPaddr2 172.16.100.4/24/eth1 start
Jan 5 08:49:45 web1 IPaddr2(IPaddr2_172.16.100.4)[3080]: INFO: Adding inet address 172.16.100.4/24 with broadcast address 172.16.100.255 to device eth1
Jan 5 08:49:45 web1 IPaddr2(IPaddr2_172.16.100.4)[3080]: INFO: Bringing device eth1 up
Jan 5 08:49:45 web1 IPaddr2(IPaddr2_172.16.100.4)[3080]: INFO: /usr/libexec/heartbeat/send_arp -i 200 -r 5 -p /var/run/resource-agents/send_arp-172.16.100.4 eth1 172.16.100.4 auto not_used not_used
Jan 5 08:49:45 web1 /usr/lib/ocf/resource.d//heartbeat/IPaddr2(IPaddr2_172.16.100.4)[3054]: INFO: Success
Jan 5 08:49:45 web1 ResourceManager(default)[2933]: info: Running /etc/init.d/httpd start
我在web1的ifconfig和ipaddr的信息
[iyunv@web1 ha.d]# ifconfig
eth1 Link encap:Ethernet HWaddr 00:50:56:2A:84:EB
inet addr:172.16.100.8 Bcast:172.16.100.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe2a:84eb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4712 errors:0 dropped:0 overruns:0 frame:0
TX packets:4110 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:836834 (817.2 KiB) TX bytes:902984 (881.8 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[iyunv@web1 ha.d]# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 00:50:56:3d:8c:d0 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:50:56:2a:84:eb brd ff:ff:ff:ff:ff:ff
inet 172.16.100.8/24 brd 172.16.100.255 scope global eth1
inet 172.16.100.4/24 brd 172.16.100.255 scope global secondary eth1
inet6 fe80::250:56ff:fe2a:84eb/64 scope link
valid_lft forever preferred_lft forever
[iyunv@web1 ha.d]#
web2的
为
[iyunv@web2 ~]# ifconfig
eth1 Link encap:Ethernet HWaddr 00:50:56:34:E7:9B
inet addr:172.16.100.9 Bcast:172.16.255.255 Mask:255.255.0.0
inet6 addr: fe80::250:56ff:fe34:e79b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4955 errors:0 dropped:0 overruns:0 frame:0
TX packets:4570 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:899479 (878.3 KiB) TX bytes:885811 (865.0 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:22 errors:0 dropped:0 overruns:0 frame:0
TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1166 (1.1 KiB) TX bytes:1166 (1.1 KiB)
[iyunv@web2 ~]# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 00:50:56:29:d6:a0 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:50:56:34:e7:9b brd ff:ff:ff:ff:ff:ff
inet 172.16.100.9/16 brd 172.16.255.255 scope global eth1
inet 172.16.100.4/24 brd 172.16.255.255 scope global eth1
inet6 fe80::250:56ff:fe34:e79b/64 scope link
valid_lft forever preferred_lft forever
[iyunv@web2 ~]#
请问,为什么web2老是dead
|
|
|