Linux-ha Open source software heartbeat test

Source: Internet
Author: User
Tags resource backup linux

How do you know if the HA cluster is working properly, and simulate environment testing is a good way to test the following five steps before putting the heartbeat high-availability cluster into the production environment to determine if HA is working properly.

First, normal shutdown and restart of the master node heartbeat

First on the main node node1 the "service heartbeat stop" normal shutdown of the main node of the heartbeat process, at this time through the ifconfig command to view the main node network card information, under normal circumstances, should be able to see the main node has freed the cluster's service IP address, It also frees the mounted shared partition, and then looks at the backup node, and now the backup node has taken over the service IP of the cluster and automatically mounts the shared disk partition.

In this process, use ping to test the Cluster service IP, you can see that the cluster IP is in a consistent state, and there is no delay and blocking phenomenon, that is, in the normal shutdown of the main node, the main standby node is seamless, ha external services can also be uninterrupted operation.

Then, the main node heartbeat normal boot, heartbeat boot, the backup node will automatically release the Cluster service IP, while unloading the shared disk partition, while the master node will take over the Cluster service IP and Mount shared partition, in fact, the backup node freed resources and the primary node binding resources are synchronized. Thus, this process is also a seamless switch.

Second, the main node to unplug the network cable

After unplugging the network cable from the primary node to connect to the public network, the Heartbeat plug-in ipfail the ping test to detect the failure of the connection immediately, then automatically frees the resource, and at this point the Ipfail plug-in of the standby node detects a network failure of the primary node. After waiting for the primary node to release the resource, the standby node immediately takes over the cluster resources, thus ensuring uninterrupted continuous operation of the network service.

Similarly, when the primary node network returns to normal, the cluster resource will automatically cut the primary node from the standby node because the "Auto_failback on" option is set.

After the main node unplug the network cable log information as follows, note the Italic section in the log:

Nov 09:04:09 node1 Heartbeat: [3689]: Info:link Node2:eth0, dead.

Nov 09:04:09 node1 Heartbeat: [3689]: Info:link 192.168.60.1:192.168.60.1, dead.

Nov 09:04:09 node1 ipfail: [3712]: Info:status update:node 192.168.60.1 now has Status dead

Nov 09:04:09 node1 harc[4279]: Info:running/etc/ha.d/rc.d/status status

Nov 09:04:10 node1 ipfail: [3712]: Info:NS:We are, dead. :<

Nov 09:04:10 node1 ipfail: [3712]: Info:link status Update:link Node2/eth0 now has status dead

...... The middle part is omitted ...

Nov 09:04:20 node1 Heartbeat: [3689]: Info:node1 wants to go standby [all]

Nov 09:04:20 node1 Heartbeat: [3689]: Info:standby:node2 can take we all

Nov 09:04:20 node1 Heartbeat: [4295]: info:give up all HA (standby).

Nov 09:04:21 node1 resourcemanager[4305]: info:releasing resource group:node1 192.168.60.200/24/eth0 Filesystem::/de V/sdb5::/webdata::ext3

Nov 09:04:21 node1 resourcemanager[4305]: info:running/etc/ha.d/resource.d/filesystem/dev/sdb5/webdata ext3 stop

Nov 09:04:21 node1 filesystem[4343]: info:running stop FOR/DEV/SDB5 On/webdata

Nov 09:04:21 node1 filesystem[4343]: info:trying to Unmount/webdata

Nov 09:04:21 node1 filesystem[4343]: Info:unmounted/webdata successfully

Nov 09:04:21 node1 filesystem[4340]: info:success

Nov 09:04:22 node1 resourcemanager[4305]: info:running/etc/ha.d/resource.d/ipaddr 192.168.60.200/24/eth0 stop

Nov 09:04:22 node1 ipaddr[4428]: INFO:/sbin/ifconfig eth0:0 192.168.60.200 down

Nov 09:04:22 Node1 avahi-daemon[1854]: Withdrawing address record for 192.168.60.200 on eth0.

Nov 09:04:22 node1 ipaddr[4407]: info:success

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.