VMware Virtual Appliances Community
VMTN_Admin
Enthusiast
Enthusiast

Hercules Load Balancer Virtual Appliance

http://www.vmware.com/vmtn/appliances/directory/300

A tiny but mighty tcp load balancer

0 Kudos
186 Replies
vmmeup
Expert
Expert

I might sound like an idiot asking this question, but what is the proper syntax for assigning a static IP to this appliance. I see the /etc/network/interface config file. The default is dhcp. I want to change it to static, but I want to make suer I use the right syntax. I generally use redhat, fedora, or suse which has a different style interface configuration. Would I just do something like this:

iface eth0 inet 192.168.1.x 255.255.255.0

also I'm looking to dual home the box and I added a second NIC, but the os isn't picking it up for me to use. Suggestions on what I need to do?

Message was edited by:

vmmeup

Sid Smith ----- VCP, VTSP, CCNA, CCA(Xen Server), MCTS Hyper-V & SCVMM08 [http://www.dailyhypervisor.com] - Don't forget to award points for correct and helpful answers. 😉
0 Kudos
Matt_Ghantous
Contributor
Contributor

Here's an example of /etc/network/interfaces with a static IP for eth0:

iface eth0 inet static

 address 192.168.1.123

 netmask 255.255.255.0

 gateway 192.168.1.1

then run /etc/init.d/network restart

0 Kudos
Matt_Ghantous
Contributor
Contributor

Oops forgot to answer your other question...

Adding a second NIC is easy. Power down the VM, add the virtual NIC, reboot. In the OS just add it to /etc/network/interfaces like you did for eth0, only the second card will be called eth1. Just increment the number for each NIC you add. If you have 3 NICs then call them eth0, eth1, and eth2.

Here's a DHCP example for a second NIC:

auto lo eth0 eth1

\[...]

iface eth1 inet dhcp

For a static example, see my last post Smiley Happy

To test it run ifup eth1. Then do ifconfig, and you should see your shiney new interface with an IP address.

0 Kudos
vmmeup
Expert
Expert

You are the man.....thank you for the help.....I love this forum.......

Sid Smith ----- VCP, VTSP, CCNA, CCA(Xen Server), MCTS Hyper-V & SCVMM08 [http://www.dailyhypervisor.com] - Don't forget to award points for correct and helpful answers. 😉
0 Kudos
vmmeup
Expert
Expert

Is vrrpd package no built into your kernel 2.6.17.7 release? I might be crazy, but I can't find it on there any where..... definatly not in /bin

never mind it's in /sbin I was reading the post and someone made a script poitning to /bin.....sorry

Message was edited by:

vmmeup

Sid Smith ----- VCP, VTSP, CCNA, CCA(Xen Server), MCTS Hyper-V & SCVMM08 [http://www.dailyhypervisor.com] - Don't forget to award points for correct and helpful answers. 😉
0 Kudos
Matt_Ghantous
Contributor
Contributor

So here's an update on what I've been doing with ESX and Hercules testing:

I have two IIS 6.0 web servers running on Windows Server 2003 SP 1 VM's. They both have static IP's and are called WEBTEST01 and WEBTEST02.

Next, I set up two Hercules VM's (to get the vmdk from a workstation to an ESX version see http://kb.vmware.com/vmtnkb/search.do?cmd=displayKC&docType=kc&externalId=900&sliceId=SAL_Public(

I called the VM's Hercules01 and Hercules02. Their "real" IP's are irrelevant, so I just left them with their default DHCP setup. What is important is that they are sharing a static VRRP address.

I've had this up and running for days now, and both instances of Hercules are barely using a couple megs of ram. I'm going to get some stress test automation tools and beat Hercules up a bit (and hopefully not get IT to come and kill me).

To mirror IIS 6.0 servers I realized I had to both mainatin the same files and the same IIS settings. My solution was to use a little batch script with iiscnfg.vbs /copy. You can read up more on that, but basically that command lets you copy IIS settings over a network to another server. Every time I change IIS settings on WEBTEST01 I just run the batch file. To mirror files/permissions/securities I am using robocopy as a service with the /MIR and /COPYALL flags.

I'll let you know what happens when I get around to stress testing Hercules. Haven't googled much yet on this, but does anyone know of any good tools to use for this kind of automation?

Anyways, it's 5 o' clock on a Friday here... Time for some beers.

0 Kudos
vmmeup
Expert
Expert

I'm trying a similar setup and can't seem to get pen to listen on the vrrp virtual IP address. I have configured both hercules boxes the same, I can ping the vrrp virtual IP but cannot get pen to load balance over it. I have my hercules boxes dual homed and they load balance and work great with their assigned IP addresses. Here is what my config looks like below:

PIDFILE=/var/run/pen.pid

PIDFILE2-/var/run/pen2.pid

CONTROLPORT=8888

CONTROLPORT2=8889

CHROOTDIR=/chroot/pen

VRRP_IP=192.168.5.100

VSERVER_ID=1

LBSERVER=80

LBSERVER2=443

SERVER1=192.168.10.200

SEVRER2=192.168.10.201

case "$1" in

start)

echo -n "Starting VRRP Cluster Service: "

/sbin/vrrpd -i eth0 -v $VSERVER_ID $VRRP_IP

echo " \[OK]"

if \[ -x /bin/pen ] ; then

echo -n "Starting LB on Port 80: "

/bin/pen -C $CONTROLPORT -X -l $LOGFILE -p $PIDFILE $LBSERVER $SERVER1 $SERVER2

echo " \[OK]"

fi

if \[ -x /bin/pen ] ; then

echo -n "Starting LN on Port 443 "

/bin/pen -C $CONTROLPORT2 -X -l $LOGFILE -p $PIDFILE2 $LBSERVER2 $SERVER1 $SERVER2

echo " \[OK]"

fi

;;

stop)

echo -n "Halting LB on Port 80: "

kill `cat /var/run/pen.pid`

echo " \[OK]

echo -n "Halting LB on Port 443: "

kill `cat /var/run/pen2.pid`

echo " \[OK]"

echo -n "Halting VRRPD Cluster Deamon: "

killall vrrpd

echo " \[OK]"

;;

*)

echo "usage; $0 \{ start | stop }" >&2

EXIT 1

;;

Sid Smith ----- VCP, VTSP, CCNA, CCA(Xen Server), MCTS Hyper-V & SCVMM08 [http://www.dailyhypervisor.com] - Don't forget to award points for correct and helpful answers. 😉
0 Kudos
Matt_Ghantous
Contributor
Contributor

Hmm... I can think of a couple things to try.

1.) This may sound silly, but try to ping 192.168.5.100 before enabling vrrpd to make sure another machine doesn't have it.

2.) Do 192.168.5.100 and 192.168.10.200 use the same gateway? I'm not sure if that matters and I'm not in the lab to test it out. Try using a vrrpd address like 192.168.10.202

3.) Try vrrpd with the -n flag (don't handle virtual mac address).

Hope that helps, let us know how it goes.

0 Kudos
vmmeup
Expert
Expert

1.) Yeah this is a new subnet so none of the IP's are in use, but I had checked it just to be sure.

2.) 192.168.10.x I don't give these machines gateways. The only purpose of this subnet is to sit behind the load balancer with the web servers on it.

If I load up the load balancer and go to the physical address of the box 192.168.5.101 it works great no problems what so ever. I'm running vrrpd on the 192.168.5.x network because that is the one the firewall nats to.

3.) I have tried vrrpd with and without the -n flag doesn't seem to make a difference.

I thank you much for your help, it's got to be something so simple that I'm over looking, just can't put my finger on it.

Sid Smith ----- VCP, VTSP, CCNA, CCA(Xen Server), MCTS Hyper-V & SCVMM08 [http://www.dailyhypervisor.com] - Don't forget to award points for correct and helpful answers. 😉
0 Kudos
torcomp
Contributor
Contributor

Has anyone tried to use the -w param on the pen startup script?

from the PEN docs, -w filename wil post the pen.log output in HTML format to the specified file.

Can't seem to get it to work.

Any help is appreciated.

Cheers,

Tony.

0 Kudos
briearn
Contributor
Contributor

Hi prabhakar,

1st of all: Great work! Cool to have an very easy to use small image for an LB.

You can even handle other protocols like ssh and CIFS when you balance on the right ports. I've missed this info in the documentation on the VMWARE site. Could be very useful for others as well ...

Unfortunately I have a big problem with the stability of the system when I use it with VMWARE-Server 1.0.1. Every couple of Minutes I get an kernel crash. Don't know why...

And the strange thing is: vrrpd seems to be buggy at all. I can balance without this one running, but when I try to start this one nothing is working anymore. Even no complain or an error. It does simply nothing further and I have to reboot to get it working again. The whole VM is freezed.

May be you have a solution on that.

BTW I'm running it on a SUN X4100 2xOpteron 285 16GB RAM with FC5 and on that VMware-Server 1.0.1

Thanks mate,

Arne

0 Kudos
Matt_Ghantous
Contributor
Contributor

briearn,

Do you see errors in /var/log/messages?

0 Kudos
prabhakar
Contributor
Contributor

Can you post what kind of errors you are seeing? Like Matt said check your /var/log/.

0 Kudos
prabhakar
Contributor
Contributor

Sorry, have never used the -w param. Have you tried checking the pen users list for any more info?

0 Kudos
briearn
Contributor
Contributor

in /var/log/messages is nothing special. No problem occurs.

BUT: I have a snapshot where all of your VMs crash. This happens from time to time after a while. One after the other...

0 Kudos
pencer
Contributor
Contributor

Is there a way to get this working on VMware Server?

We have a couple of oldish HP Proliants that I've put the free VMWare Server on.

This app would be useful on there.

I've tried copying the hercules files across to it and registering an exisitng machine. But when I start the VM I just get a blank screen?

0 Kudos
pencer
Contributor
Contributor

It's ok, i've figured out what i did wrong!

Needed to create the VM with Buslogic instead of LSIlogic interface.

Works fine now.

0 Kudos
Hoppa66
Contributor
Contributor

Hi,

Just tried to use the supplied vmdk on my iSCSI/SAN based ESX farm, but when creating the VM, I could not locate the .vmdk file (whilst I copied it there).

Steps to solve this (save you at least my headache):

-1- Copy .vmdk from the .zip file to /vmimages/Hercules.vmdk on any ESX server (must be on local SCSI disk, not on shared VMFS volumes!)

-2- Create /vmfs/volumes/; this puts the stuff in 1 directory

-5- Create the virtual machine

-6- When powering up, ESX might ask you to change SCSI types automatically. Select "Yes" to use the correct SCSI controller type

-7- Delete the copied .vmdk on the local disk you where working on

This is probably something related to iSCSI related installations only ...

Cheers,

Mark

0 Kudos
Hoppa66
Contributor
Contributor

Little extra to spare about 150Mhz of CPU power when running on ESX 3:

\- Edit /boot/grub/menu.lst

\- Add "noapic nolapic clock=pit" to the kernel entry, example:

kernel /boot/vmlinuz-2.6.17.7 root=/dev/sda1 rw quiet splash noapic nolapic nosmp clock=pit[/b]

Cheers,

Mark

0 Kudos
Hoppa66
Contributor
Contributor

And last but not least, an /etc/init.d/pen with vrrp inside and setup for multiple virtuals and multiple services/ports.

#!/bin/sh

#

\# startup script for pen

\# moudsen@allshare.nl

PIDDIR=/var/run

PIDFILE1=/var/run/pen1.pid

PIDFILE2=/var/run/pen2.pid

VIRTUAL1_ADDR="10.1.8.21"

VIRTUAL1_INSTANCE=1

VIRTUAL1_PRIORITY=100

PEN_CHROOTDIR=/chroot/pen

PEN1_CPORT1=8888

PEN1_LBSERVER=80

PEN1_PIDFILE=$PIDDIR/pen_1.pid

PEN2_CPORT2=8889

PEN2_LBSERVER=443

PEN2_PIDFILE=$PIDDIR/pen_2.pid

SERVER1=10.1.3.84

SERVER2=10.1.3.85

case "$1" in

start)

if \[ -x /sbin/vrrpd ] ; then

echo -n "Starting vrrpd ($VIRTUAL1_ADDR): "

/sbin/vrrpd -f $PIDDIR -n -i eth0 -v $VIRTUAL1_INSTANCE $VIRTUAL1_ADDR

echo "OK"

fi

if \[ -x /bin/pen ] ; then

echo -n "Starting pen (*:$PEN1_LBSERVER): "

/bin/pen -C $PEN_CPORT1 -X -p $PEN1_PIDFILE $PEN1_LBSERVER $SERVER1 $SERVER2

echo "OK"

fi

if \[ -x /bin/pen ] ; then

echo -n "Starting pen (*:$PEN2_LBSERVER): "

/bin/pen -C $PEN_CPORT2 -X -p $PEN2_PIDFILE $PEN2_LBSERVER $SERVER1 $SERVER2

echo "OK"

fi

;;

stop)

if \[ -x $PEN1_PIDFILE ] ; then

kill `cat $PEN1_PIDFILE`

fi

if \[ -x $PEN2_PIDFILE ] ; then

kill `cat $PEN2_PIDFILE`

fi

killall vrrpd

;;

*)

echo "usage: $0 \{ start | stop }" >&2

exit 1

;;

esac

0 Kudos