虚拟服务器的集群配置
大部分的集群配置工作都在虚拟服务器vs1上面,需要下面的几个步骤:
重新编译内核。
首先,下载最新的Linux内核,版本号为2.2.19,下载地址为:http://www.kernel.org/,解压缩后置于/usr/src/linux目录下。
其次需要下载LVS的内核补丁,地址为:http://www.linuxvirtualserver.org/software/ipvs-1.0.6-2.2.19.tar.gz。这里注意,如果你用的Linux内核不是2.2.19版本的,请下载相应版本的LVS内核补丁。将ipvs-1.0.6-2.2.19.tar.gz解压缩后置于/usr/src/linux目录下。
然后,对内核打补丁,如下操作:
[root@vs2 /root]# cd /usr/src/linux
[root@vs2 linux]# patch -p1 < ipvs-1.0.6-2.2.19/ipvs-1.0.6-2.2.19.
patch |
下面就是重新配置和编译Linux的内核。特别注意以下选项:
1 Code maturity level options--->
* [*]Prompt for development and/or incomplete code/drivers
2 Networking部分:
[*] Kernel/User netlink socket
[*] Routing messages
<*> Netlink device emulation
* [*] Network firewalls
[*] Socket Filtering
<*> Unix domain sockets
* [*] TCP/IP networking
[*] IP: multicasting
[*] IP: advanced router
[ ] IP: policy routing
[ ] IP: equal cost multipath
[ ] IP: use TOS value as routing key
[ ] IP: verbose route monitoring
[ ] IP: large routing tables
[ ] IP: kernel level autoconfiguration
* [*] IP: firewalling
[ ] IP: firewall packet netlink device
* [*] IP: transparent proxy support
* [*] IP: masquerading
--- Protocol-specific masquerading support will be built as modules.
* [*] IP: ICMP masquerading
--- Protocol-specific masquerading support will be built as modules.
* [*] IP: masquerading special modules support
* IP: ipautofw masq support (EXPERIMENTAL)(NEW)
* IP: ipportfw masq support (EXPERIMENTAL)(NEW)
* IP: ip fwmark masq-forwarding support (EXPERIMENTAL)(NEW)
* [*] IP: masquerading virtual server support (EXPERIMENTAL)(NEW)
[*] IP Virtual Server debugging (NEW) <--最好选择此项,以便观察LVS的调试信息
* (12) IP masquerading VS table size (the Nth power of 2) (NEW)
* IPVS: round-robin scheduling (NEW)
* IPVS: weighted round-robin scheduling (NEW)
* IPVS: least-connection scheduling (NEW)
* IPVS: weighted least-connection scheduling (NEW)
* IPVS: locality-based least-connection scheduling (NEW)
* IPVS: locality-based least-connection with replication scheduling
(NEW)
* [*] IP: optimize as router not host
* IP: tunneling
IP: GRE tunnels over IP
[*] IP: broadcast GRE over IP
[*] IP: multicast routing
[*] IP: PIM-SM version 1 support
[*] IP: PIM-SM version 2 support
* [*] IP: aliasing support
[ ] IP: ARP daemon support (EXPERIMENTAL)
* [*] IP: TCP syncookie support (not enabled per default)
--- (it is safe to leave these untouched)
< > IP: Reverse ARP
[*] IP: Allow large windows (not recommended if <16Mb of memory)
< > The IPv6 protocol (EXPERIMENTAL) |