LVS Web tools Piranha and node monitoring tools Ldirector

Source: Internet
Author: User

LVS Web tools Piranha and node monitoring tools Ldirector


Description: 1. Piranha is a web-based LVS configuration software provided by Rethat, which can eliminate the tedious work of manually configuring LVS, and also provide HA functions, and
is to configure the dual-machine hot standby. You can also monitor the status of the Realserver.
2. Ldirector is a plug-in in heartbeat, which can be used to configure LVS, or to monitor realserver, in the event of a realserver failure,
The fault machine is separated out. To implement HA functionality, you need to install the entire heartheart.
################## #Piranha的安装与配置 #####################
1. Yum-y Install Piranha
2./etc/init.d/piranha_gui Stop #启动piranha自带的httpd服务, the port used is 3636
3. Visit http://192.168.1.104:3636
1. Click "Login" button to prompt for user name and password
2. User name: Piranha Password: You need to use the PIRANHA-PASSWD settings, then directly enter the password to set
4. Go to the Web, you can configure LVS. #因为基于web的配置非常简单, then do not do the specific operation.
5.service Pulse Start #启动pulse后, the LVS Cluster service is automatically started.
6. In order to configure Realserver convenience, write the following script:
Vim/etc/init.t/lvsrs
#!/bin/bash
#
#chkconfig: 35 70 50
#
vip=192.168.1.100
lo=lo:0
Retval=0
Start () {
Ifconfig $lo $VIP netmask 255.255.255.255 up
Route add-host $vip Dev $lo
Echo 1 >/proc/sys/net/ipv4/conf/lo/arp_ignore
Echo 2 >/proc/sys/net/ipv4/conf/lo/arp_announce
Echo 1 >/proc/sys/net/ipv4/conf/all/arp_ignore
Echo 2 >/proc/sys/net/ipv4/conf/all/arp_announce
}

Stop () {

Ifconfig $lo Down
Route Del-host $VIP
echo 0 >/proc/sys/net/ipv4/conf/lo/arp_ignore
echo 0 >/proc/sys/net/ipv4/conf/lo/arp_announce
echo 0 >/proc/sys/net/ipv4/conf/all/arp_ignore
echo 0 >/proc/sys/net/ipv4/conf/all/arp_announce
}

Case $ in
start)
 start
 retval=$?
 [$retval = 0] && echo "Starting LVs OK"
 ;;
Stop)
 stop
 retval=$?
 [$retval = 0] && echo "Starting LVs Failed"
 ;;

*)
 echo "Usage: $ start|stop}"
 exit 1
 ;;
Esac
Exit 0
7.chmod +x/etc/init.d/lvsrs
8.chkconfig--add Lvsrs
9./etc/init.d/lvsrs start
10. Install httpd to test
################### #Ldirectord #######################
1.yum-y localinstall ldirectord-3.9.5-3.fc20.x86_64.rpm--nogpgcheck
2.cp/usr/share/doc/ldirectord-3.9.5/ldirectord.cf   /etc/ha.d/
3. Configure the LDIRECTORD.CF as follows:
# Global directives
checktimeout=20       #检测RealServer时, no response in this time will determine Realserver error
checkinterval=10  #定义检测RealServer的时间间隔
#fallback = 127.0.0.1:80 #当RealServer都出问题时, return to local continue service
#fallback6 =[::1]:80 
autoreload=yes   # LDIRECTORD.CF configuration changes automatically loaded into memory
logfile= "/var/log/ldirectord.log"  
#logfile = "Local0"
#emailalert = "[ Email protected] "
#emailalertfreq =3600
#emailalertstatus =all
quiescent=no  #定义在RealServer失效后 , whether to clear the LVS routing table for invalid nodes, connection records, and so on, and whether to terminate connections to this defunct node before terminating. No means terminating the connection and clearing the record, yes.

# Sample for an HTTP virtual service
Virtual=192.168.1.100:80
REAL=192.168.1.106:80 Gate
REAL=192.168.1.107:80 Gate
# REAL=192.168.6.6:80 Gate
# FALLBACK=127.0.0.1:80 Gate
Service=http
Scheduler=rr
#persistent =600
netmask=255.255.255.255
Protocol=tcp
Checktype=negotiate
checkport=8080 #配置检测RealServer是否可用的端口, it is best to configure a single port-based access-only virtual host on the Realserver for detection
Request= "Index.html" #通过这个选项来检测RealServer是否正常.
receive= "Test page" #index. The information to be returned by HTML.
Virtualhost=www.x.y.z
4.service Ldirectord Start
5. Execute the Lvsrs script on Realserver
Service Lvsrs Start
6. Note: To use Ldirectord alone, you also need to manually configure the VIP, otherwise you need to install the entire heartbeat software.
Ifconfig eth0:0 192.168.1.100 netmask 255.255.255.255 up
Route Add-host 192.168.100

Summarize:
Piranha and Heartbeat (Ldirectord), as well as subsequent keepalived, can achieve high availability and node monitoring of LVS. But the three kinds of software performance is optimal is the keepalived;heartbeat configuration is more complex, piranha in the double-click switch does not have the main spare points, first started for the host, after the start is the standby machine, there is no heartbeat in the Auto_failback function. So, keepalived will speak alone.


This article is from the "Everything Possible" blog, please be sure to keep this source http://noican.blog.51cto.com/4081966/1656577

LVS Web tools Piranha and node monitoring tools Ldirector

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.