650) this. width = 650; "border =" 0 "alt =" "src =" http://www.bkjia.com/uploads/allimg/131227/0255553945-0.jpg "/>
After the network is configured and the heartbeat Nic is disconnected, the application will not switch. At one time, the application thought it was a problem with its own configuration. However, the problem is solved when vnet3 is switched to a direct bridge with the NIC. This is most likely because there are some problems with the packet sending between vnet3.
- Prerequisite deployment:
- 1. Environment Configuration
- 2. Host Name, yum, ssh
-
- 1. Install heartbeat.
- # Yum install-y heartbeat * # Run the command twice. Otherwise, some packages are not installed.
-
- # Rpm-qa | grep heartbeat *
- Heartbeat-gui-2.1.3-3.el5.centos
- Heartbeat-2.1.3-3.el5.centos
- Heartbeat-stonith-2.1.3-3.el5.centos
- Heartbeat-devel-2.1.3-3.el5.centos
- Heartbeat-ldirectord-2.1.3-3.el5.centos
- Heartbeat-pils-2.1.3-3.el5.centos
-
- Copy related configuration files:
- # Cp/usr/share/doc/heartbeat-2.1.3/ha. cf/etc/ha. d/# configuration file of ha. cf HA
- # Cp/usr/share/doc/heartbeat-2.1.3/haresources/etc/ha. d/# haresources resource file
- # Cp/usr/share/doc/heartbeat-2.1.3/authkeys/etc/ha. d/# authentication file between HA nodes
-
- # Yum install-y httpd
-
- # Vim/etc/ha. d/ha. cf
- Debugfile/var/log/ha-debug
- Logfile/var/log/ha-log
- Logfacility local0
- Keepalive 2
- Deadtime 30
- Warntime 10
- Initdead 120
- Udpport 694
- Ucast eth1 1.1.1.2 # Heartbeat
- Auto_failback on
- Node ha1
- Node ha2
- Ping 172.16.1.1 172.16.1.11 # IP address of the gateway and another node
- Respawn hacluster/usr/lib/heartbeat/ipfail
- Deadping 30
- Apiauth ipfail uid = hacluster
- Use_logd yes
- Conn_logd_time 60
-
- # Cat authkeys # define the authenticated keys
- Auth 1
- 1 crc
- ======================
- Heartbeat [8404]: 2011/07/26 _ 05:02:48 ERROR: Bad permissions on keyfile [/etc/ha. d/authkeys], 600 recommended.
- Heartbeat [8404]: _ 05:02:48 ERROR: Authentication configuration error.
- Heartbeat [8404]: 2011/07/26 _ 05:02:48 ERROR: Configuration error, heartbeat not started.
-
- # Chmod 600/etc/ha. d/authkeys
- ========================
- # Cat/etc/ha. d/haresources # configure HA Resources
- Ha1 IPaddr: 172.16.1.100/24/eth0: 0 httpd
-
- #/Etc/init. d/heartbeat start
- Logd is already running
- Starting High-Availability services:
- 05:05:15 INFO: Resource is stopped
- [OK]
-
- # The difference between ha1 and ha2 is that the ucast value and the IP address to be pinged.
- # ++ ++
- #
- # ++ ++
- The following are the process logs of breaking the happy jumper and re-inserting the heartbeat line:
- #Disconnect the heartbeat of one party
Heartbeat [7043]: 2011/07/26 _ 13:53:40 WARN: node ha2.example.com: is dead
Heartbeat [7043]: 2011/07/26 _ 13:53:40 info: Dead node ha2.example.com gave up resources.
Heartbeat [7043]: 2011/07/26 _ 13:53:40 info: Link ha2.example.com: eth1 dead.
Ipfail [7069]: 2011/07/26 _ 13:53:40 info: Status update: Node ha2.example.com now has status dead
Ipfail [7069]: 2011/07/26 _ 13:53:42 info: NS: We are still alive!
Ipfail [7069]: 2011/07/26 _ 13:53:42 info: Link Status update: Link ha2.example.com/eth1 now has status dead
Ipfail [7069]: 2011/07/26 _ 13:53:44 info: Asking other side for ping node count.
Ipfail [7069]: 2011/07/26 _ 13:53:44 info: Checking remote count of ping nodes.
- At this time, please use ip addr to observe the ip addresses of both parties, and we will find that the VIP address appears on two machines. Split-brain!
# The second node is active again
Heartbeat [7043]: 2011/07/26 _ 13:56:09 CRIT: Cluster node ha2.example.com returning after partition.
Heartbeat [7043]: 2011/07/26 _ 13:56:09 info: For information on cluster partitions, See URL: http://linux-ha.org/SplitBrain
Heartbeat [7043]: 2011/07/26 _ 13:56:09 WARN: Deadtime value may be too small.
Heartbeat [7043]: 2011/07/26 _ 13:56:09 info: See FAQ for information on tuning deadtime.
Heartbeat [7043]: 2011/07/26 _ 13:56:09 info: URL: http://linux-ha.org/FAQ#heavy_load
Heartbeat [7043]: 2011/07/26 _ 13:56:09 info: Link ha2.example.com: eth1 up.
- Heartbeat [7043]: 2011/07/26 _ 13:56:09 WARN: Late heartbeat: Node ha2.example.com: interval 104930 MS
Ipfail [7069]: 2011/07/26 _ 13:56:09 info: Link Status update: Link ha2.example.com/eth1 now has status up
Heartbeat [7043]: 2011/07/26 _ 13:56:09 info: Status update for node ha2.example.com: status active
Ipfail [7069]: 2011/07/26 _ 13:56:09 info: Status update: Node ha2.example.com now has status active
Harc [7916]: 2011/07/26 _ 13:56:09 info: Running/etc/ha. d/rc. d/status
Heartbeat [7043]: 2011/07/26 _ 13:56:12 info: Heartbeat shutdown in progress. (7043)
# It is found that the heartbeat Nic of Node 2 is active again and heartbeat is restarted.
- Heartbeat [7932]: 2011/07/26 _ 13:56:13 info: Giving up all HA resources.
ResourceManager [7945]: 2011/07/26 _ 13:56:13 info: Releasing resource group: ha1.example.com IPaddr: 172.16.1.100/24/eth0: 0 httpd
ResourceManager [7945]: 2011/07/26 _ 13:56:13 info: Running/etc/init. d/httpd stop
# The resource manager closes the previous application.
- ResourceManager [7945]: 2011/07/26 _ 13:56:13 info: Running/etc/ha. d/resource. d/IPaddr 172.16.1.100/24/eth0: 0 stop
IPaddr [8037]: 2011/07/26 _ 13:56:13 INFO: ifconfig eth0: 0 down
IPaddr [8008]: 2011/07/26 _ 13:56:13 INFO: Success
# The corresponding VIP is also disabled.
- ResourceManager [8067]: 2011/07/26 _ 13:56:13 info: Releasing resource group: ha2.example.com IPaddr: 172.16.1.101/24/eth0: 1 vsftpd
# Release the original ftp service ha2.example.com
- ResourceManager [8067]: 2011/07/26 _ 13:56:13 info: Running/etc/init. d/vsftpd stop
ResourceManager [8067]: 2011/07/26 _ 13:56:14 info: Running/etc/ha. d/resource. d/IPaddr 172.16.1.101/24/eth0: 1 stop
IPaddr [8161]: 2011/07/26 _ 13:56:14 INFO: ifconfig eth0: 1 down
# Stop the service and stop the NIC.
- IPaddr [8132]: 2011/07/26 _ 13:56:14 INFO: Success
Heartbeat [7932]: 2011/07/26 _ 13:56:14 info: All HA resources relinquished.
Heartbeat [7043]: 2011/07/26 _ 13:56:16 info: killing/usr/lib/heartbeat/ipfail process group 7069 with signal 15
Heartbeat [7043]: 2011/07/26 _ 13:56:17 info: stored ed shutdown notice from 'ha2 .example.com '.
Heartbeat [7043]: 2011/07/26 _ 13:56:17 info: Resource takeover canceled-shutdown in progress.
Heartbeat [7043]: 2011/07/26 _ 13:56:19 info: killing HBFIFO process 7045 with signal 15
Heartbeat [7043]: 2011/07/26 _ 13:56:19 info: killing HBWRITE process 7046 with signal 15
Heartbeat [7043]: 2011/07/26 _ 13:56:19 info: killing HBREAD process 7047 with signal 15
Heartbeat [7043]: 2011/07/26 _ 13:56:19 info: killing HBWRITE process 7048 with signal 15
Heartbeat [7043]: 2011/07/26 _ 13:56:19 info: killing HBREAD process 7049 with signal 15
Heartbeat [7043]: 2011/07/26 _ 13:56:19 info: Core process 7049 exited. 5 remaining
Heartbeat [7043]: 2011/07/26 _ 13:56:19 info: Core process 7047 exited. 4 remaining
Heartbeat [7043]: 2011/07/26 _ 13:56:19 info: Core process 7046 exited. 3 remaining
Heartbeat [7043]: 2011/07/26 _ 13:56:19 info: Core process 7048 exited. 2 remaining
Heartbeat [7043]: 2011/07/26 _ 13:56:19 info: Core process 7045 exited. 1 remaining
Heartbeat [7043]: 2011/07/26 _ 13:56:19 info: ha1.example.com Heartbeat shutdown complete.
# Turn off the heartbeat Service
- Heartbeat [7043]: 2011/07/26 _ 13:56:19 info: Heartbeat restart triggered.
Heartbeat [7043]: 2011/07/26 _ 13:56:19 info: Restarting heartbeat.
Heartbeat [7043]: 2011/07/26 _ 13:56:19 info: Refreshing heartbeat restart exec.
Heartbeat [7043]: 2011/07/26 _ 13:56:30 info: Version 2 support: false
Heartbeat [7043]: 2011/07/26 _ 13:56:30 WARN: Logging daemon is disabled -- enabling logging daemon is recommended
Heartbeat [7043]: _ 13:56:30 info :**************************
Heartbeat [7043]: 2011/07/26 _ 13:56:30 info: Configuration validated. Starting heartbeat 2.1.3
Heartbeat [8191]: 2011/07/26 _ 13:56:30 info: heartbeat: version 2.1.3
Heartbeat [8191]: 2011/07/26 _ 13:56:30 info: Heartbeat generation: 1311635912
Heartbeat [8191]: 2011/07/26 _ 13:56:30 info: glib: ucast: write socket priority set to IPTOS_LOWDELAY on eth1
Heartbeat [8191]: 2011/07/26 _ 13:56:30 info: glib: ucast: bound send socket to device: eth1
Heartbeat [8191]: 2011/07/26 _ 13:56:30 info: glib: ucast: bound receive socket to device: eth1
Heartbeat [8191]: 2011/07/26 _ 13:56:30 info: glib: ucast: started on port 694 interface eth1 to 10.1.1.2
Heartbeat [8191]: 2011/07/26 _ 13:56:30 info: glib: ping group heartbeat started.
- Heartbeat [8191]: 2011/07/26 _ 13:56:30 info: G_main_add_TriggerHandler: Added signal manual handler
Heartbeat [8191]: 2011/07/26 _ 13:56:30 info: G_main_add_TriggerHandler: Added signal manual handler
Heartbeat [8191]: 2011/07/26 _ 13:56:30 info: G_main_add_SignalHandler: Added signal handler for signal 17
Heartbeat [8191]: 2011/07/26 _ 13:56:30 info: Local status now set to: 'up'
Heartbeat [8191]: 2011/07/26 _ 13:56:32 info: Link group1: group1 up.
Heartbeat [8191]: 2011/07/26 _ 13:56:32 info: Status update for node group1: status ping
Heartbeat [8191]: 2011/07/26 _ 13:56:33 info: Link ha2.example.com: eth1 up.
Heartbeat [8191]: 2011/07/26 _ 13:56:33 info: Status update for node ha2.example.com: status up
- Harc [8199]: 2011/07/26 _ 13:56:33 info: Running/etc/ha. d/rc. d/status
Heartbeat [8191]: 2011/07/26 _ 13:56:33 info: Comm_now_up (): updating status to active
Heartbeat [8191]: 2011/07/26 _ 13:56:33 info: Local status now set to: 'active'
Heartbeat [8191]: 2011/07/26 _ 13:56:33 info: Starting child client "/usr/lib/heartbeat/ipfail" (498,496)
Heartbeat [8216]: 2011/07/26 _ 13:56:33 info: Starting "/usr/lib/heartbeat/ipfail" as uid 498 gid 496 (pid 8216)
Heartbeat [8191]: 2011/07/26 _ 13:56:34 info: Status update for node ha2.example.com: status active
Harc [8219]: 2011/07/26 _ 13:56:34 info: Running/etc/ha. d/rc. d/status
Ipfail [8216]: 2011/07/26 _ 13:56:40 info: Status update: Node ha2.example.com now has status active
# Check the status of another node
Ipfail [8216]: 2011/07/26 _ 13:56:43 info: Asking other side for ping node count.
Ipfail [8216]: 2011/07/26 _ 13:56:46 info: No giveup timer to abort.
Heartbeat [8191]: 2011/07/26 _ 13:56:50 info: local resource transition completed.
Heartbeat [8191]: 2011/07/26 _ 13:56:50 info: Initial resource acquisition complete (T_RESOURCES (us ))
Heartbeat [8191]: 2011/07/26 _ 13:56:50 info: remote resource transition completed.
IPaddr [8271]: 2011/07/26 _ 13:56:51 INFO: Resource is stopped
Heartbeat [8235]: 2011/07/26 _ 13:56:51 info: Local Resource acquisition completed.
Harc [8324]: 2011/07/26 _ 13:56:51 info: Running/etc/ha. d/rc. d/ip-request-resp
Ip-request-resp [8324]: 2011/07/26 _ 13:56:51 received ed ip-request-resp IPaddr: 172.16.1.100/24/eth0: 0 OK yes
ResourceManager [8345]: 2011/07/26 _ 13:56:51 info: Acquiring resource group: ha1.example.com IPaddr: 172.16.1.100/24/eth0: 0 httpd
IPaddr [8372]: 2011/07/26 _ 13:56:52 INFO: Resource is stopped
# Obtain Resource Information
ResourceManager [8345]: 2011/07/26 _ 13:56:53 info: Running/etc/ha. d/resource. d/IPaddr 172.16.1.100/24/eth0: 0 start
IPaddr [8470]: 2011/07/26 _ 13:56:54 INFO: Using calculated netmask for 172.16.1.100: 255.255.255.0
IPaddr [8470]: 2011/07/26 _ 13:56:54 INFO: eval ifconfig eth0: 0 172.16.1.100 netmask 255.255.255.0 broadcast 172.16.1.255
IPaddr [8441]: 2011/07/26 _ 13:56:54 INFO: Success
# Obtaining VIP addresses and IP addresses
ResourceManager [8345]: 2011/07/26 _ 13:56:54 info: Running/etc/init. d/httpd start
- The service is normal! This log is a complete log!
Dual heartbeat and HA personal understanding http://myhat.blog.51cto.com/391263/623546
This article from the "diving into the ocean of technology" blog, please be sure to keep this source http://myhat.blog.51cto.com/391263/623559