Hi all,
I just wanted to report back that, that my LVS/DR works fine with
Linux-Mandrake 7.0 now.
The nice thing was, that this was an out-of-the box setup, i.e. with no
kernel patch and recompile required since Mandrake already includes LVS
patches (Ver. 0.9.4, Q: Should this be updated, or is this version
reasonably error free?). All one needs is the proper networking setup
(i.e. two networks) and the ipvsadm package. As for our specifig setup
and use - many seem to want to know what LVS is beeing used for - some
more info below.
My company is currently running 7 SMP PCs (2 HA directors, 4 real
servers, 1 maintenance machine) connected to two 100mbps switched
networks (Internet + local). The servers are primarly used for script
and database driven web service for a desktop tool. The site is secured
using openssh and portsentry. We plan on beeing able to scale the system
up to a maximum of 20 real servers. All files and the databases are kept
local to each machine and get replicated using scripts from the service
machine.
Attached is a little script that I wrote for our LVS/DR setup. Might be
useful for someone wanting to experiment with the LVS setup on Mandrake
... its basically a copy of whats in the LVS/DR manual.
Ciao
Andreas Schiffler
----
#!/bin/sh
# LVS/DR http (port 80) setup script - schiffler@xxxxxx
# Works with Mandrake-Linux 7.00 and ipvsadm-1.7-4.i386.rpm installed
# ----- Configuration section -----
# Choose yes if this script is run on a "real" sever
IS_SERVER="no"
# The virtual IP
VIP=xxx.xxx.xxx.xxx
# The port
PORT=80
# Just for reference
MYIP=xxx.xxx.xxx.xxx
# The actual and local IPs if the "real" servers
SERVERIPS="xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx
xxx.xxx.xxx.xxx"
SERVERIPS_LOCAL="192.168.0.196 192.168.0.197 192.168.0.198
192.168.0.199"
# Choose scheduling method
SCHEDULING=wlc
# ---- End of configuration section ----
# Decide what kind of host we are running on
if [ "$IS_SERVER" = "no" ]; then
echo "Load Balancer/Director configuration ..."
echo "----------------------------------------"
if [ "$PORT" = "80" ]; then
# Shutdown webserver
echo "Shutting down webserver ..."
/etc/rc.d/init.d/httpd stop
fi
# Remove alias
echo "Removing existing (first) alias IPs ..."
ifconfig eth0:0 down
# Setup alias
echo "Adding alias ..."
ifconfig eth0:0 $VIP netmask 255.255.255.255 broadcast $VIP up
route add -host $VIP dev eth0:0
# Remove routing table
echo "Removing routing table ..."
ipvsadm -C
# Setup director routing
echo "Setup routing table ..."
ipvsadm -A -t $VIP:$PORT -s $SCHEDULING
for i in $SERVERIPS_LOCAL; do
echo "Adding $i ..."
ipvsadm -a -t $VIP:$PORT -r $i -g
done
# Turn on forwarding
echo "Turning on forwarding ..."
echo "1" >/proc/sys/net/ipv4/ip_forward
# Show results
echo "Current routing table ..."
ipvsadm -L
else
echo "Real Server configuration ..."
echo "-----------------------------"
# Remove redirection port
echo "Removing rediretion port ..."
ifconfig lo:0 down
# Turn on forwarding
echo "Turning on forwarding ..."
echo "1" >/proc/sys/net/ipv4/ip_forward
# Setup redirection port
echo "Setting up redirection port ..."
ifconfig lo:0 $VIP netmask 255.255.255.255 broadcast $VIP up
route add -host $VIP dev lo:0
# Hide interface from ARP
echo "Hiding interface from ARP ..."
echo "1" > /proc/sys/net/ipv4/conf/all/hidden
echo "1" > /proc/sys/net/ipv4/conf/lo/hidden
fi
|