• 企业400电话
  • 微网小程序
  • AI电话机器人
  • 电商代运营
  • 全 部 栏 目

    企业400电话 网络优化推广 AI电话机器人 呼叫中心 网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    centos中lvs安装配置方法详解

    一、lvs-nat模式

    网络配置:

    复制代码
    代码如下:

    lvs-server eth0 :host-only adapter 192.168.56.101
    lvs-server eth1 :Internal 192.168.0.1
    real-server-1 eth0:Internal 192.168.0.2
    real-server-2 eth0:Internal 192.168.0.3

     
    lvs-server:
    1、安装ipvsadm软件

    复制代码
    代码如下:

    yum -y install ipvsadm*
    echo 1 > /proc/sys/net/ipv4/ip_forward 路由器功能,ip转发
    ipvsadm -C
    ipvsadm -At 192.168.56.101:80 -s rr 轮叫模式
    ipvsadm -at 192.168.56.101:80 -r 192.168.0.2 -m
    ipvsadm -at 192.168.56.101:80 -r 192.168.0.3 -m
    ipvsadm -L -n

    2、real-server-1:

    复制代码
    代码如下:

    ifconfig eth0 192.168.0.2 netmask 255.255.255.0
    route add default gw 192.168.0.1

    3、real-server-2

    复制代码
    代码如下:

    ifconfig eth0 192.168.0.3 netmask 255.255.255.0
    route add default gw 192.168.0.1
    route -n 查看路由表

     
    二、lvs-ipturn

    网络配置:

    复制代码
    代码如下:

    lvs-server eth0:host-only adapter 192.168.56.101
    real-server-1 eth0:host-only adapter 192.168.56.102
    real-server-2 eth0:host-only adapter 192.168.56.103

    lvs-server:
    配置虚拟ip即vip

    复制代码
    代码如下:

    ifconfig tunl0 192.168.56.10 netmask 255.255.255.255 up
    route add -host 192.168.56.10 dev tunl0/p> p>ivsadm -C
    ipvsadm -At 192.168.56.10:80 -s rr
    ipvsadm -at 192.168.56.10:80 -r 192.168.56.102 -i
    ipvsadm -at 192.168.56.10:80 -r 192.168.56.103 -i
    ipvsadm -L -n

    real-server-1:

    复制代码
    代码如下:

    ifconfig tunl0 192.168.56.10 netmask 255.255.255.255 up
    route add -host 192.168.56.10 dev tunl0
    echo 1 > /proc/sys/net/ipv4/conf/tunl0/arp_ignore
    echo 2 > /proc/sys/net/ipv4/conf/tunl0/arp_announce
    echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
    echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce

    real-server-2:

    复制代码
    代码如下:

    ifconfig tunl0 192.168.56.10 netmask 255.255.255.255 up
    route add -host 192.168.56.10 dev tunl0
    echo 1 > /proc/sys/net/ipv4/conf/tunl0/arp_ignore
    echo 2 > /proc/sys/net/ipv4/conf/tunl0/arp_announce
    echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
    echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce

     
    三、lvs-dr

    网络配置:

    复制代码
    代码如下:

    lvs-server eth0:host-only adapter 192.168.56.101/p> p>real-server-1 eth0:host-only adapter 192.168.56.102/p> p>real-server-2 eth0:host-only adapter 192.168.56.103/p> p>lvs-server:/p> p>ifconfig eth0:0 192.168.56.10 netmask 255.255.255.255/p> p>route add -host 192.168.56.10 dev eth0:0

    ipvs:

    复制代码
    代码如下:

    ipvsadm -C ipvsadm -At 192.168.56.10:80 -s rr ipvsadm -at 192.168.56.10:80 -r 192.168.56.102 -g ipvsadm -at 192.168.56.10:80 -r 192.168.56.103 -g ipvsadm -L -n/p> p>real-server-1: ifconfig lo:0 192.168.56.10 netmask 255.255.255.255 route add -host 192.168.56.10 dev lo:0 echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce/p> p>real-server-2: ifconfig lo:0 192.168.56.10 netmask 255.255.255.255 route add -host 192.168.56.10 dev lo:0 echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce

    上一篇:centos6.4安装CloudStack 4.2(开源云计算平台)详解
    下一篇:centos中文乱码修改字符编码使用centos支持中文
  • 相关文章
  • 

    © 2016-2020 巨人网络通讯 版权所有

    《增值电信业务经营许可证》 苏ICP备15040257号-8

    centos中lvs安装配置方法详解 centos,中,lvs,安装,配置,方法,