http://www.zenloadbalancer.com/web/
[ 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 |
unmount
# 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 0.9.1 |
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 192.168.10.130 -l root root@192.168.10.130'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:~# root@zenlb-01:~# cat /etc/debian_version 6.0 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
uncomment
# 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_DEFAULT="quiet" 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 Password: |
[ 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 ( 192.168.10.131 ) 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. ( 192.168.100.10 )
# tshark -i eth0 port 80 Running as user "root" and group "root". This could be dangerous. Capturing on eth0 0.000000 192.168.100.10 -> 192.168.100.20 TCP 49811 > http [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=788770 TSER=0 WS=6 0.000033 192.168.100.20 -> 192.168.100.10 TCP http > 49811 [SYN, ACK] Seq=0 Ack=1 Win=14480 Len=0 MSS=1460 TSV=251029 TSER=788770 WS=6 0.000430 192.168.100.10 -> 192.168.100.20 TCP 49811 > http [ACK] Seq=1 Ack=1 Win=5888 Len=0 TSV=788770 TSER=251029 0.000467 192.168.100.10 -> 192.168.100.20 TCP 49812 > http [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=788770 TSER=0 WS=6 0.000477 192.168.100.20 -> 192.168.100.10 TCP http > 49812 [SYN, ACK] Seq=0 Ack=1 Win=14480 Len=0 MSS=1460 TSV=251030 TSER=788770 WS=6 0.000804 192.168.100.10 -> 192.168.100.20 TCP 49812 > http [ACK] Seq=1 Ack=1 Win=5888 Len=0 TSV=788770 TSER=251030 0.000882 192.168.100.10 -> 192.168.100.20 HTTP GET / HTTP/1.1 0.000910 192.168.100.20 -> 192.168.100.10 TCP http > 49811 [ACK] Seq=1 Ack=565 Win=15616 Len=0 TSV=251030 TSER=788770 0.001232 192.168.100.20 -> 192.168.100.10 HTTP HTTP/1.1 304 Not Modified 0.001336 192.168.100.20 -> 192.168.100.10 TCP http > 49811 [FIN, ACK] Seq=150 Ack=565 Win=15616 Len=0 TSV=251031 TSER=788770 0.001569 192.168.100.10 -> 192.168.100.20 TCP 49811 > http [ACK] Seq=565 Ack=150 Win=6912 Len=0 TSV=788770 TSER=251031 0.001820 192.168.100.10 -> 192.168.100.20 TCP 49811 > http [FIN, ACK] Seq=565 Ack=151 Win=6912 Len=0 TSV=788770 TSER=251031 0.001831 192.168.100.20 -> 192.168.100.10 TCP http > 49811 [ACK] Seq=151 Ack=566 Win=15616 Len=0 TSV=251031 TSER=788770 0.050355 192.168.100.10 -> 192.168.100.20 HTTP GET /favicon.ico HTTP/1.1 0.050398 192.168.100.20 -> 192.168.100.10 TCP http > 49812 [ACK] Seq=1 Ack=399 Win=15552 Len=0 TSV=251080 TSER=788782 0.050759 192.168.100.20 -> 192.168.100.10 HTTP HTTP/1.1 404 Not Found (text/html) 0.050858 192.168.100.20 -> 192.168.100.10 TCP http > 49812 [FIN, ACK] Seq=470 Ack=399 Win=15552 Len=0 TSV=251080 TSER=788782 0.051175 192.168.100.10 -> 192.168.100.20 TCP 49812 > http [ACK] Seq=399 Ack=470 Win=6912 Len=0 TSV=788783 TSER=251080 0.051381 192.168.100.10 -> 192.168.100.20 TCP 49812 > http [FIN, ACK] Seq=399 Ack=471 Win=6912 Len=0 TSV=788783 TSER=251080 0.051397 192.168.100.20 -> 192.168.100.10 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: 192.168.10.131\r\n <- VIP X-Forwarded-For: x.x.x.x\r\n <- Client IP \r\n |
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.