码迷,mamicode.com
首页 > 其他好文 > 详细

ipvsadm

时间:2016-04-26 14:27:40      阅读:265      评论:0      收藏:0      [点我收藏+]

标签:ipvsadm

[root@192 ~]# ipvsadm -A -t 192.168.1.212:80 -s wlc


[root@192 ~]# ipvsadm -a -t 192.168.1.212:80 -r  192.168.1.213:80 -m -w 2

[root@192 ~]# ipvsadm -a -t 192.168.1.212:80 -r  192.168.1.214:80 -m -w 2 


[root@192 ~]# ipvsadm -Ln 

IP Virtual Server version 1.2.1 (size=4096)

Prot LocalAddress:Port Scheduler Flags

  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn

TCP  192.168.1.212:80 wlc

  -> 192.168.1.213:80             Masq    2      0          0         

  -> 192.168.1.214:80             Masq    2      0          0         


[root@192 ~]# ipvsadm -Ln -c

IPVS connection entries

pro expire state       source             virtual            destination

TCP 00:03  CLOSE       192.168.1.212:30840 192.168.1.212:80   192.168.1.214:80


[root@localhost ~]# ifconfig | awk -F ‘[ :]+‘ ‘FNR==2{print $4}‘

192.168.1.214

[root@localhost ~]# ifconfig | awk -F ‘[" ",:]+‘ ‘FNR==2{print $4}‘ 

192.168.1.214

[root@localhost ~]# 


[root@localhost html]# ifconfig | awk -F ‘[" ",:]+‘ ‘FNR==2{print $4}‘  >> /var/www/html/index.html



192.168.1.214

[root@192 ~]#  curl http://192.168.1.212/index.html

192.168.1.213

[root@192 ~]#  curl http://192.168.1.212/index.html

192.168.1.214

[root@192 ~]# ipvsadm -Ln -c

IPVS connection entries

pro expire state       source             virtual            destination

TCP 01:48  TIME_WAIT   192.168.1.212:30851 192.168.1.212:80   192.168.1.213:80

TCP 01:51  TIME_WAIT   192.168.1.212:30855 192.168.1.212:80   192.168.1.213:80

TCP 01:51  TIME_WAIT   192.168.1.212:30856 192.168.1.212:80   192.168.1.214:80

TCP 01:49  TIME_WAIT   192.168.1.212:30852 192.168.1.212:80   192.168.1.214:80

TCP 01:50  TIME_WAIT   192.168.1.212:30853 192.168.1.212:80   192.168.1.213:80

TCP 01:50  TIME_WAIT   192.168.1.212:30854 192.168.1.212:80   192.168.1.214:80

TCP 01:47  TIME_WAIT   192.168.1.212:30850 192.168.1.212:80   192.168.1.214:80


ipvsadm

标签:ipvsadm

原文地址:http://wangqh.blog.51cto.com/5367393/1767823

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!