天极传媒:
天极网
比特网
IT专家网
52PK游戏网
极客修
全国分站

北京上海广州深港南京福建沈阳成都杭州西安长春重庆大庆合肥惠州青岛郑州泰州厦门淄博天津无锡哈尔滨

产品
  • 网页
  • 产品
  • 图片
  • 报价
  • 下载
全高清投影机 净化器 4K电视曲面电视小家电滚筒洗衣机
您现在的位置: 天极网>新闻>

linux上的集群及其配置实例

Yesky 2001-11-08 13:57 我要吐槽

  1. 虚拟服务器的集群配置

大部分的集群配置工作都在虚拟服务器vs1上面,需要下面的几个步骤:

    1. 重新编译内核。

首先,下载最新的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)

上面,带*号的为必选项。

然后就是常规的编译内核过程,不再赘述,

在这里要注意一点:如果你使用的是RedHat自带的内核或者从RedHat下载的内核版本,已经预先打好了LVS的补丁。这可以通过查看/usr/src/linux/net/目录下有没有几个ipvs开头的文件来判断:如果有,则说明已经打过补丁。


    1. 编写LVS配置文件,实例中的配置文件如下:
      作者: 责任编辑:)
      请关注天极网天极新媒体 最酷科技资讯
      扫码赢大奖
      评论
      * 网友发言均非本站立场,本站不在评论栏推荐任何网店、经销商,谨防上当受骗!
笔记本手机数码家电