lost and found ( for me ? )

install Zen Load Balancer

Zen LB is a open source sofwtware Layer 7 LB :D

[ install Zen LB within KVM ]

I’ll install Zen LB within KVM.
download zenloadbalancer-distro_3rc1.iso.

Before installing Zen LB , mount ISO and check which distribution Zen LB is based on.

# mount -t iso9660 ISO_files/zenloadbalancer-distro_3rc1.iso tmp_mount

OS of Zen LB is Debian 6.0.0 i386.
cd tmp_mount/
# head -1 readme.txt
     Debian GNU/Linux 6.0.0 "Squeeze" - Official i386 NETINST Binary-1

# cd ..
# umount tmp_mount

Let’s install Zen LB in KVM !

KVM host
# lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description:    Linux Mint 12 Lisa
Release:        12
Codename:       lisa

# uname -ri
3.2.0-32-generic x86_64

# kvm --version
QEMU emulator version 1.0 (qemu-kvm-1.0), Copyright (c) 2003-2008 Fabrice Bellard

# libvirtd --version
libvirtd (libvirt) 0.9.8

# virt-manager --version

make a Zen LB VM with virt-manager

OS type : Linux

Version : Debian Squeeze

I added two vNICs.
architecture : i686

installation is very easy , configure hostname , credentials for root user , IP address and disk partition.

installation is finished.
login to ZenLB over SSH.

# ssh -l root
root@'s password:
Linux zenlb-01 2.6.32-5-686 #1 SMP Wed Jan 12 04:01:41 UTC 2011 i686

Zen Load Balancer

Last login: Fri Nov  2 22:03:20 2012 from x.x.x.x

root@zenlb-01:~# cat /etc/debian_version
root@zenlb-01:~# uname -ri
2.6.32-5-686 unknown

you can apply patches with apt-get
root@zenlb-01:~# apt-get update;apt-get upgrade -y
無視 http://zenloadbalancer.sourceforge.net v3/ Release.gpg
無視 http://zenloadbalancer.sourceforge.net/apt/x86/ v3/ Translation-en

you can upgrade zen LB via apt-get as well.
root@zenlb-01:~# apt-get install zenloadbalancer
Reading package lists... Done
Building dependency tree
Reading state information... Done
zenloadbalancer is already the newest version.

enable “virsh console” access to the Zen LB.

on Zen LB


# egrep -i ^t0 /etc/inittab
T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100

# egrep -i ^grub_cmdline_linux /etc/default/grub
GRUB_CMDLINE_LINUX="console=tty0" <- add

root@zenlb-01:~# reboot

after rebooting the OS , you would access to the LB with “virsh console” like this
virsh # console ZenLB-01
Connected to domain ZenLB-01
Escape character is ^]

Debian GNU/Linux 6.0 zenlb-01 ttyS0

zenlb-01 login: root

[ configuration ]

Client --eth0 ZenLB eth1 – Web Server

login to Zen LB with Web browser.
https://<ZenLB IP>:444

user : admin
pass : admin

assign IP address to eth1
Settings -> Interface 

add a virtual IP ( similar to VIP for load balancing )

create a FARM. FARM is similar to Virtual Servers
Manage -> FARM

associate a real server with farm01

access to VIP ( ) from a client

capture data on Web Server.
Zen LB seems to act as proxy not transparency , because source IP address is Zen LB’s. ( )

# tshark -i eth0 port 80
Running as user "root" and group "root". This could be dangerous.
Capturing on eth0
 0.000000 -> TCP 49811 > http [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=788770 TSER=0 WS=6
 0.000033 -> TCP http > 49811 [SYN, ACK] Seq=0 Ack=1 Win=14480 Len=0 MSS=1460 TSV=251029 TSER=788770 WS=6
 0.000430 -> TCP 49811 > http [ACK] Seq=1 Ack=1 Win=5888 Len=0 TSV=788770 TSER=251029
 0.000467 -> TCP 49812 > http [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=788770 TSER=0 WS=6
 0.000477 -> TCP http > 49812 [SYN, ACK] Seq=0 Ack=1 Win=14480 Len=0 MSS=1460 TSV=251030 TSER=788770 WS=6
 0.000804 -> TCP 49812 > http [ACK] Seq=1 Ack=1 Win=5888 Len=0 TSV=788770 TSER=251030
 0.000882 -> HTTP GET / HTTP/1.1
 0.000910 -> TCP http > 49811 [ACK] Seq=1 Ack=565 Win=15616 Len=0 TSV=251030 TSER=788770
 0.001232 -> HTTP HTTP/1.1 304 Not Modified
 0.001336 -> TCP http > 49811 [FIN, ACK] Seq=150 Ack=565 Win=15616 Len=0 TSV=251031 TSER=788770
 0.001569 -> TCP 49811 > http [ACK] Seq=565 Ack=150 Win=6912 Len=0 TSV=788770 TSER=251031
 0.001820 -> TCP 49811 > http [FIN, ACK] Seq=565 Ack=151 Win=6912 Len=0 TSV=788770 TSER=251031
 0.001831 -> TCP http > 49811 [ACK] Seq=151 Ack=566 Win=15616 Len=0 TSV=251031 TSER=788770
 0.050355 -> HTTP GET /favicon.ico HTTP/1.1
 0.050398 -> TCP http > 49812 [ACK] Seq=1 Ack=399 Win=15552 Len=0 TSV=251080 TSER=788782
 0.050759 -> HTTP HTTP/1.1 404 Not Found  (text/html)
 0.050858 -> TCP http > 49812 [FIN, ACK] Seq=470 Ack=399 Win=15552 Len=0 TSV=251080 TSER=788782
 0.051175 -> TCP 49812 > http [ACK] Seq=399 Ack=470 Win=6912 Len=0 TSV=788783 TSER=251080
 0.051381 -> TCP 49812 > http [FIN, ACK] Seq=399 Ack=471 Win=6912 Len=0 TSV=788783 TSER=251080
 0.051397 -> TCP http > 49812 [ACK] Seq=471 Ack=400 Win=15552 Len=0 TSV=251081 TSER=788783

Zen LB can insert client IP info in X-forwared header.
   GET / HTTP/1.1\r\n
       [Expert Info (Chat/Sequence): GET / HTTP/1.1\r\n]
           [Message: GET / HTTP/1.1\r\n]
           [Severity level: Chat]
           [Group: Sequence]
       Request Method: GET
       Request URI: /
       Request Version: HTTP/1.1
   Host:\r\n   <- VIP
   X-Forwarded-For: x.x.x.x\r\n  <- Client IP

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.