Use the Red Hat Piranha solution to achieve WEB Load Balancing

Source: Internet
Author: User
Tags exampl
System Environment: RHEL6.5x86 _ 64smallinstallselinuxandiptablesdisabledvirtualip192.168.2.253192.168.20.2server62.exampl.com (master node) 192.168.20.3server63.example.com (slave node) 192.168.2.521_top52.ex

System Environment: RHEL6.5x86 _ 64 small install selinux and iptables disabled

Virtual IP 192.168.2.253

192.168.20.2 server62.exampl.com (master node)

192.168.20.3 server63.example.com (slave node)

192.168.2.52 topics top52.example.com (real server)

192.168.2.53 topics top53.example.com (real server)

Edit/etc/hoststs for the above Parsing

I. Brief introduction to the Piranha solution.

1. Advantages of the Piranha solution:

1.1 simple and efficient configuration:

You can easily configure an lvs. conf configuration file (keepalived-like solution .)

1.2 WEB configuration page.

WEB configuration is very attractive for those who do not understand the LVS configuration. You can configure a perfect load balancing and high availability solution in almost 15 minutes.

1.3 complete functions:

Heartbeat and HA (pulse, send_arp) of the Master/Slave LVS (Load Balancer), Load Balancer and Heartbeat (nanny) of the process service between the Real Server)

* IPVS function (lvsd)

* Ipvsadm)

2. principles and structure of the Piranha solution:

The Piranha solution is a set of load balancing high availability solutions based on LVS.

LVS runs on a computer with similar configurations:

One is Active LVS Router and the other is Backup LVS Router ).

The active LVS Router service has two roles:

* Load the server to the Real Server.

* Check whether the services provided by the Real Server are normal.

The backup LVS Router is used to monitor the active LVS Router. When the active LVS Router fails, the backup LVS Router takes over.

Pulse:

The Pulse process runs on the active LVS Router and the backup LVS Router. On the backup LVS Router, pulse sends a heartbeat to the public interface of the active LVS Router to check whether the active LVS Router is normal.

On the active LVS Router, pulse starts the lvs process and responds to the heartbeat from the backup LVS Router.

Lvsd:

The lvs process calls the ipvsadm tool to configure and maintain the IPVS route table, and starts a nanny process for each virtual service on the Real Server.

Nanny:

Each nanny process checks the virtual service status on the Real Server and notifies the lvs process of the fault. If a fault is found, The lvs process notifies ipvsadm to delete the node in the IPVS route table.

Send_arp:

If the backup LVS Router does not receive a response from the active LVS Router, it will call send_arp to distribute the virtual IP address to the public network interface of the backup LVS Router. A command is sent on the public network interface and LAN interface to disable the LVS process on the active lvs Router. Start your own lvs process to schedule client requests.

3. Install the basic package of the Piranha solution:

# Yum install ipvsadm modcluster piranha system-config-cluster php-cli php-common

4. configuration file introduction:

/Etc/sysconfig/ha/lvs. cf // This file is written by the configuration file configured on the http: // ip: 3636 web interface.

/Etc/init. d/piranha‐gui start // The WEB configuration interface for starting the piranha service.

/Etc/init. d/pulse // start the piranha service to read/etc/sysconfig/ha/lvs. cf.

Implement MySQL High Availability http://www.linuxidc.com/Linux/2013-06/86390.htm of WEB site through LVS

LVS + Apache + PHP + MySQL read/write splitting http://www.linuxidc.com/Linux/2012-12/77027.htm

MySQL LVS Load Balancing http://www.linuxidc.com/Linux/2012-09/69862.htm

Practice of Enterprise Web high availability cluster LVS + Keepalived + MySQL HA http://www.linuxidc.com/Linux/2012-09/70097.htm

Ii. Piranha Configuration

Configure the Piranha Service on the WEB page.

#/Etc/init. d/piranha‐gui start // start the piranha service.

#/Usr/sbin/piranha‐passwd // set the password. Set the logon password for your piranha Service WEB configuration.

Http: // 192.168.20.2: 3636 // enter the username: piranha and the password you just set to log in.

After logging in, select Global Settings. This is the configuration for LVS.

Enter the public IP address of the Primary server: 192.168.20.2, and press the ACCEPT button to save the settings.

Configure master LVS information through WEB

1. Configure master LVS

2. Configure the backup LVS

3. Configure and add LVS (VIP Information)

For more details, refer to the highlights on the next page.: Http://www.linuxidc.com/Linux/2014-07/104791p2.htm

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.