TCPHA-0.3 What is it? ----------- TCPHA implements an architecture for scalable content-aware request distribution in cluster-based servers.It implements TCP Handoff inside kernel for the LINUX operating system. TCPHA can be used to build a high-performance and highly available server based on a cluster of Linux servers. What's the architecture of TCPHA? -------------------------------- TCPHA is composed of tcpha_fe (dispatcher), tcpha_be (real server). The dispatcher(FE) does the content-aware request distribution to real servers(BEs).Real servers(BEs) serve requests and send responses to clients directly. The softwares needed by TCPHA ------------------------------- Linux with Kernel-2.4.18 and later,Gcc COPYRIGHT --------- Copyright (c) 2004 Li Wang. It is released under GNU GPL (General Public License). Please see the file called COPYING. Fastest setup --------------- Let's assume your cluster has the following configuration: Workstation with address:192.168.1.23 runs as dispatcher(FE:front end), Workstations with address:192.168.1.33 and 192.168.1.38 run as real server(BE:back end). Thay all share address:192.168.1.36,which is saw by client. First,you should execute the following commands in shell: Shell>tar -zxvf tcpha-0.3.tar.gz Shell>cd tcpha Then you should choose to install which component.In this case,surely,you should install tcpha_fe on 192.168.1.23,install tcpha_be on 192.168.1.33 and 192.168.1.38. Install tcpha_fe 1. Shell>fe/make 2. Modify the file:fe/tcphafe.conf according to your cluster configuration. Generally speeking,you need only change the following: 'raddr = x.x.x.x' to the FE real address,So here you should change the line to 'raddr = 192.168.1.23' 'vaddr = x.x.x.x' to the cluster shared virtual address,here 'vaddr = 192.168.1.36' 'server = x.x.x.x port' to the BE address and port,here 'server = 192.168.1.33 666' and 'server = 192.168.1.38 666' 'rule = x.x.x.x pattern' stands for:if a request matching 'pattern' uses BE:x.x.x.x to handle it,the pattern should be regular expressions.such as 'rule = 192.168.1.38 jpg$' and 'rule = 192.168.1.33 .*' 3. Shell>mkdir /etc/tcpha;cp fe/tcphafe.conf /etc/tcpha/ Install tcpha_be 1. Shell>be/make 2. Modify the file:be/tcphabe.conf according to your cluster configuration. Generally speeking,you need only change the following: 'raddr = x.x.x.x' to the BE real address,So here you should change the line to 'raddr = 192.168.1.33' 'uaddr = x.x.x.x' to a address the cluster NOT used,for example: if 192.168.1.39 is not used in your cluster, you can change the line to 'uaddr = 192.168.1.39' 'vaddr = x.x.x.x' to the cluster shared virtual address,here 'vaddr = 192.168.1.36' 'fe = x.x.x.x port' to the FE address and port,here 'fe = 172.18.20.23 666' 'server = x.x.x.x port' to the BE address and port,here 'server = 192.168.1.33 666' and 'server = 192.168.1.38 666' 'rule = x.x.x.x pattern' stands for:if a request matching 'pattern' uses BE:x.x.x.x to handle it,the pattern should be regular expressions.such as 'rule = 192.168.1.38 jpg$' and 'rule = 192.168.1.33 .*' 3. Shell>mkdir /etc/tcpha;cp be/tcphabe.conf /etc/tcpha/ How to use -------------- Start You should start the components by the following order(assume you are in shell path 'tcpha/'): Start BE: 1. Shell>insmod be/ktcphabe.o 2. Shell>ifconfig tunl0 192.168.1.36 up 3. Shell>httpd Start FE: 1. Shell>ifconfig tunl0 192.168.1.36 up 1. Shell>insmod fe/ktcphafe.o Ok,as you see,setup and run are very simple, Enjoy to explore it! Stop You should stop the components by the following order(assume you are in shell path 'tcpha/'): Stop FE: 1. Shell>ifconfig tunl0 down 2. Shell>echo 1 >> /proc/sys/net/ktcphafe/unload 2. Shell>rmmod ktcphafe Stop BE: 1. Shell>ifconfig tunl0 down 2. Shell>echo 1 >> /proc/sys/net/ktcphabe/unload 3. Shell>rmmod ktcphabe Costomize setup --------------- You can look at the files:fe/tcphafe.conf.detail and be/tcphabe.conf.detail for reference. Notes ------ 1. When you stop BE,the step 1 must be done before step 2 and 3 2. The rules must contain all the cases,so you'd better add rule: 'rule = x.x.x.x .*' in the config file 3. The configuration of 'server=...' and 'rule=...' must be the same in FE and BEs Feedback -------- Welcome your comments, bug reports, bug fixes, and ideas Thanks, Li Wang dragonfly@linux-vs.org