Heartbeat high-availability httpd simple configuration based on Resources

Source: Internet
Author: User

Simple configuration of HeartBeat based on Resources
Lab environment: RedHat5.8 i386
Disable the firewall and selinux

Software Package: http://dl.Fedoraproject.org/pub/epel/5/i386/repoview/letter_h.group.html
Heartbeat-Heartbeat subsystem for High-Availability Linux
Heartbeat-devel-Heartbeat development package
Heartbeat-gui-Provides a gui interface to manage heartbeat clusters
Heartbeat-ldirectord-Monitor daemon for maintaining high availability resources provides components for ipvs high availability to automatically generate rules and check the health status of backend realserver;
Heartbeat-pils-Provides a general plugin and interface loading library
Heartbeat-stonith-Provides an interface to Shoot The Other Node In The Head
Perl-MailTools-1.77-1.el5.noarch.rpm
Libnet-1.1.4-3.el5.i386.rpm
1. the/etc/hosts must be used for name resolution, and the node name must be consistent with the uname-n command results;
# Vim/etc/hosts
2. ssh mutual trust Communication
Node1
# Ssh-keygen-t rsa-f ~ /. Ssh/id_rsa-p''
# Ssh-copy-id-I./. ssh/id_rsa.pub root@192.168.100.8
# Ssh 192.168.100.8
Node2
# Ssh-keygen-t rsa-f ~ /. Ssh/id_rsa-p''
# Ssh-copy-id-I./. ssh/id_rsa.pub root@192.168.100.7
# Ssh 192.168.100.7
3. Synchronize the time of each node
# Hwclock-w
Of course, this is used in the experiment environment. You can configure the ntp service in the production environment.
4. install the software package
# Ls
Rw-r -- 1 root 1637238 Mar 20 heartbeat-2.1.4-9.el5.i386.rpm
-Rw-r -- 1 root 230890 Mar 20 heartbeat-gui-2.1.4-9.el5.i386.rpm
-Rw-r -- 1 root 92070 Mar 20 heartbeat-pils-2.1.4-10.el5.i386.rpm
-Rw-r -- 1 root 179199 Mar 20 heartbeat-stonith-2.1.4-10.el5.i386.rpm
-Rw-r -- 1 root 56817 Mar 20 libnet-1.1.4-3.el5.i386.rpm
-Rw-r -- 1 root 92071 Mar 20 perl-MailTools-1.77-1.el5.noarch.rpm
# Yum -- nogpgcheck localinstall *. rpm-y

Note: This step can automatically resolve the dependency, provided that your local yum source has been configured
5. Start the service
# Yum install httpd-y
Httpd must be disabled and cannot be started automatically
Node1
# Echo "# Chkconfig httpd off
Node2
# Chkconfig httpd off
# Echo "Three configuration files are required:
1. Key file;
2. heartbeat service configuration file ha. cf
3. Resource Management Configuration File haresources
# Cp/usr/share/doc/heartbeat-2.1.4/{authkeys, ha. cf, haresources}/etc/ha. d/
# Chmod 600 authkeys
# Vim authkeys add two rows
Auth 1
1 md5 d41d8cd98f00b204e9800998ecf8427e
Note: The Next string is a random number generated using md5sum. You can define them as needed, but the format must be consistent.
# Vim ha. cf
Logfile/var/log/heartbeat. log
Logfacility local0
Keepalive 1
Bcast eth0
Node node1.neo.com
Node node2.neo.com
Ping 192.168.100.2
# Vim haresources
Node1.neo.com IPaddr: 192.168.100.5/24/eth0 httpd
# Scp-p authkeys haresources ha. cf 192.168.100.8:/etc/ha. d/
# Service heartbeat start
# Ssh 192.168.100.8 'service heartbeat start'
Note: It is best to use the master node to remotely start the slave node. When the slave node is disabled, the slave node is disabled first and then the master node is disabled.
View log status:/var/log/message
Fault test:
# Cd/usr/lib/heartbeat
#./Hb_standby
This script is a fault test file that comes with heartbeat.
# Ifconfig eth0: The eth0 interface on node2 is displayed.

 

Recommended reading:

Heartbeat for Linux high availability (HA) Cluster Based on crm

Heartbeat + httpd + NFS for highly available Web Servers

Heartbeat for Linux high availability (HA) CLUSTERS

Heartbeat CRM configuration for Linux high availability solution

High-availability cluster Heartbeat v1 instance

LVS + heartbeat + ldirectord high-availability server Load balancer cluster Solution

  • 1
  • 2
  • Next Page

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.