Professional Documents
Culture Documents
4 Kezhong's Weblog
Page 1 of 13
Kezhong's Weblog
The future belongs to Linux! It isn't necessary to do the thing that Windows can do but Linux can't! About
Posted by: kezhong | March 28, 2010
Setup Linux loadbalancer with Piranha and LVS on CentOS 5.4 Kezhong's Weblog
Page 2 of 13
Configuring the LVS Routers with Piranha Configuration Tool Open http://192.168.26.201:3636 in a Web browser to access the Piranha Configuration Tool. Click on the Login button and enter piranha for the Username and the administrative password you created in the Password field. Click on the GLOBAL SETTINGS panel, and input the primary server public IP, and then click the ACCEPT button.
Click on the REDUNDANCY panel, and input the redundant server public IP, and then click the ACCEPT button.
Click on the VIRTUAL SERVERS panel, add a server, edit it, and activate it.
Clicking on the REAL SERVER subsection link at the top of the panel displays the EDIT REAL SERVER subsection. Click the ADD button to add new servers, edit them and activate them.
Setup Linux loadbalancer with Piranha and LVS on CentOS 5.4 Kezhong's Weblog
Page 3 of 13
Copy the lvs.cf file to another LVS router. # scp /etc/sysconfig/ha/lvs.cf root@192.168.26.202:/etc/sysconfig/ha/lvs.cf Start the pulse services on the LVS Routers # service pulse restart Test The test way used my last post. You can also use the Apache HTTP server benchmarking tool (ab) to simulate users visit. References Linux Virtual Server Administration
ADVERTISEMENT
StumbleUpon
Digg
Posted in Uncategorized Setup Linux loadbalancer with LVS, ldirectord and heartbeat Install RAR Archiver on Fedora 12
Responses
1. Thanks for these posts. Enjoyed reading them on the cdot planet.
2.
Setup Linux loadbalancer with Piranha and LVS on CentOS 5.4 Kezhong's Weblog
Page 4 of 13
What about arp requests etc? I tried the piranha mode but even if I am using the RR algorithm all request are forwarded to server2 (and not randomly to server1). When I then stop apache on server2 it does not fallback to server1. Have you tried it and Ive read that you have to use aprtables or such otherwise things dont work.
3. I am trying to get mine to work. Question: Do I create the eth0:1 for VIP using the Piranha gui or using the /etc/sysconfig/network-scripts/ifcfg-eth0:1 file? Then, what about routing from the real servers to the LVS?
4. Willie you can create the ifcfg-eth0:1 files on both servers. And do not for get to change the name on the interface or your netowrk will fobar. Also you do not need the mac address in the eth0:1 file it uses the parent eth0 mac
Setup Linux loadbalancer with Piranha and LVS on CentOS 5.4 Kezhong's Weblog
Page 5 of 13
By: straighshot on June 19, 2010 at 5:52 pm Reply 5. [...] Setup Linux loadbalancer with Piranha and LVS on CentOS 5.4 [...]
By: Red Hat Cluster Piranha Linux Virtual Server - on August 31, 2010 at 12:09 am Reply
6. Hello, do you use 4 machines? 2 for lvs and other 2 for the server?
7. Thank you very much. The blog helps me a lot. I really appreciate that.
8. BTW, could you help me about MySQL HA issues (Replication, Mysql Cluster NDB Cluster, MySQL proxy) combined with Linux loadbalancer with Piranha and LVS? Thank you very much, again.
Setup Linux loadbalancer with Piranha and LVS on CentOS 5.4 Kezhong's Weblog
Page 6 of 13
Reply
9. hye..i folow this tuto..but why when i run command ipvsadm,the real server not appear in routing table? please help me..!
10. p/s : real server not appear at ipvsadm routing table when i configure for mysql load balancing cluster..
11. Nice job .. defo way more easier than ldirector and heartbeat
Setup Linux loadbalancer with Piranha and LVS on CentOS 5.4 Kezhong's Weblog
Page 7 of 13
at 7:17 am Reply
13. nice tutor.. i follow ur tutor but when i tried to launch the web site http://192.168.26.200/ through the web browser at another machine i cant access the web server.. im using CentOS for piranha and using windows for the web server.. and the only changes that i make that that not follow ur tutor is subnetmask for vip to 255.255.255.0 really need ur help..tq..
try to append the following lines to the /etc/sysctl.conf file, and execute sysctl -p. net.ipv4.conf.all.arp_ignore = 1 net.ipv4.conf.eth0.arp_ignore = 1 net.ipv4.conf.all.arp_announce = 2 net.ipv4.conf.eth0.arp_announce = 2
im truly grateful for ur assistant.. i already add the following line that ur mention above on both LVS.. but still give the same result. because tomorrow will be sunday my university lab will be close. under those circumstance i can only implement this load balancer using VMWare.
Setup Linux loadbalancer with Piranha and LVS on CentOS 5.4 Kezhong's Weblog
Page 8 of 13
maybe using simulation cause it doesnt . the gateway 192.168.26.1 gateway is the router ip right? off topic: did u know how to implement HA load balancer using keepalived on fedora? im asking u because im also try implement load balancing using fedora but got problem same like now cant access VIP from others machine.. :(
did you check your firewall? when you did lab, you could stop iptables. as for HA, you can see my past post Setup Linux loadbalancer with LVS, ldirectord and heartbeat
i already disable firewall on both real server.. and set SELinux in permissive mode at the installation proses.. okey, at the lab tomorrow i will stop iptable and give feed back to u again.. the command is /etc/init.d/iptables stop, right?? tq cause helping me..
i already test at the real environment.. and already stop the iptables.. but like before still cant get web page went browse virtual ip.. question :-
Setup Linux loadbalancer with Piranha and LVS on CentOS 5.4 Kezhong's Weblog
Page 9 of 13
1- suppose if I follow all ur guide above i can view web page if browse using virtual ip right? 2- is there any configuration that i need to do that u dont list at above? im so sory if i ask u to much, but i really need this load balancer working, because my final year project title about web server load balancer..
14. hellow kezhong. i follow all your configuration. at the real server did i need to configure anything? because i find this note if i set Direct Routing : http://www.centos.org/docs/5/html/Virtual_Server_Administration/s2-lvs-direct-iptablesVSA.html Direct Routing and IPTables or Direct Routing and arptables_jf must be set on real server.
Setup Linux loadbalancer with Piranha and LVS on CentOS 5.4 Kezhong's Weblog Page 10 of 13
at 4:49 am Reply
15. [...] graphical interactivity with the configuration. Kezhong has a very good installation guide on his blog, which we are using to install this portion of the [...]
By: Wordpress in a Commercial Environment Lord Brockett's Blog on August 25, 2011 at 6:01 pm Reply
Leave a Reply
Email
(Not published)
Name
Website
Notify me of follow-up comments via email. Notify me of new posts via email.
Post Comment
Categories
Uncategorized
Blog Stats
Setup Linux loadbalancer with Piranha and LVS on CentOS 5.4 Kezhong's Weblog Page 11 of 13
128,356 hits
Top Posts
Install phpMyAdmin on CentOS 5.6 Change Timezone on CentOS 5.4 Setup Linux loadbalancer with Piranha and LVS on CentOS 5.4 Linux EXT2/EXT3 Superblock Recovery Install Adobe Flash Player on Fedora 14 (x86_64)
Calendar
March 2010 M T W T F S S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Feb Apr
kezhong
Installing Skype on Fedora 15(X86_64) Using SSH Tunnelling(Port Forwarding) Reading CHM files on Fedora 15 Using MSN with pidgin on Fedora 15 Finding CPU temperature on Fedora 14 Install and Update CentOS on RocketRAID 2720 Controller as Hardware Raid Install Cisco Packet Tracer 5.3.1 on Fedora 15(X86_64) Installing Cacti on Fedora 14 Solving GPT problem during the linux installation on CentOS5.6 Make yum to trigger a script after yum update on Fedora 15
Blogroll
Chris Tyler's Blog Gary Kwong's Blog John Selmys' Blog Milton Paiva's Blog Mohak Vyas' Blog Nestor Chan's Blog Patricia Constantino's Blog Varinder Singh's Blog
Websites
Fedora HowtoForge IBM Developerworks Linux Library
Setup Linux loadbalancer with Piranha and LVS on CentOS 5.4 Kezhong's Weblog Page 12 of 13
Linux Home Networking Linux Home Page LPI Manuals LWN.net nixCraft Red Hat Deployment Guide TLDP YoLinux
Planet CDOT
Processing.js Blog: Meet the Processing.js team Peter McIntyre: How to use Apple developer documentation Peter McIntyre: iOS development toolset introduction for Seneca ICT students Peter McIntyre: Introduction to Cocoa for Seneca ICT students Peter McIntyre: Introduction to Objective-C for Seneca ICT students Ashkan Sotoudeh: Setting up a Basic Encryption on openSUSE 11.4 (Using LUKS) Andor Salga (asalga): House of Cards WebGL Demo Source Varinder Singh: SSH Login to GNU/Linux Machine from Windows Machine using Winscp
workopolis
SENIOR UNIX SYSTEMS ADMINISTRATOR - TORONTO SENIOR UNIX SYSTEMS ADMINISTRATOR - TORONTO Unix/AIX Administrator (Part Time) Senior UNIX Administrator Corporate Website Operations Support Admin Analyst (UNIX) Unix System Administrator Unix Administrator II UNIX/AIX Technical Administrator
nixCraft
FAQ Updates: Sep/05/2011 Debian / Ubuntu Linux: Configure Network Bonding [ Teaming / Aggregating NIC ] Linux Desktop Fun: Summon Swarms Of Penguins To Waddle About The Desktop FAQ Updates: July/12/2011 Download CentOS 6 CD / DVD ISO VMWare Image Clone Problem: eth0 Renamed As eth1 FAQ Updates June/26/2011 Debian Linux Version 6.0.2 Released
Setup Linux loadbalancer with Piranha and LVS on CentOS 5.4 Kezhong's Weblog Page 13 of 13