标签:编写 关于 章文嵩 tcp 详解 数据 arp round net
负载均衡集群介绍#! /bin/bash
# director 服务器上开启路由转发功能
echo 1 > /proc/sys/net/ipv4/ip_forward
# 关闭icmp的重定向
echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects
echo 0 > /proc/sys/net/ipv4/conf/default/send_redirects
# 注意区分网卡名字,阿铭的两个网卡分别为ens33和ens37
echo 0 > /proc/sys/net/ipv4/conf/ens33/send_redirects
echo 0 > /proc/sys/net/ipv4/conf/ens37/send_redirects
# director 设置nat防火墙
iptables -t nat -F
iptables -t nat -X
iptables -t nat -A POSTROUTING -s 192.168.21.0/24 -j MASQUERADE
# director设置ipvsadm
IPVSADM=‘/usr/sbin/ipvsadm‘
$IPVSADM -C
$IPVSADM -A -t 192.168.110.130:80 -s wlc -p 3
$IPVSADM -a -t 192.168.110.130:80 -r 192.168.21.129:80 -m -w 1
$IPVSADM -a -t 192.168.110.130:80 -r 192.168.21.130:80 -m -w 1
[root@akuilinux01 ~]# sh /usr/local/sbin/lvs_nat.sh
[root@akuilinux02 ~]# vim /usr/share/nginx/html/index.html
[root@akuilinux02 ~]# curl localhost
akuilinux-02
[root@akuilinux03 ~]# vim /usr/share/nginx/html/index.html
[root@akuilinux03 ~]# curl localhost
akuilinux-03
[root@akuilinux01 ~]# curl 192.168.110.130
akuilinux-02
[root@akuilinux01 ~]# curl 192.168.110.130
akuilinux-02
[root@akuilinux01 ~]# curl 192.168.110.130
akuilinux-03
[root@akuilinux01 ~]# curl 192.168.110.130
akuilinux-02
[root@akuilinux01 ~]# curl 192.168.110.130
akuilinux-03
负载均衡集群介绍,LVS介绍,LVS的调度算法,LVSNAT模式搭建
标签:编写 关于 章文嵩 tcp 详解 数据 arp round net
原文地址:http://blog.51cto.com/akui2521/2136353