百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 网站模板(百分百源码网)>电脑软件>服务器> ipvs模块的治理工具ipvsadm介绍
分享本文到:

ipvs模块的治理工具ipvsadm介绍

发布时间:05/16 来源:未知 浏览: 关键词:

对ipvsadm 的下令参考,并依据本人运用的经验,进行了一个简略的翻译,但愿对ipvsadm 的运用者有一定的帮忙。

为了更好的让大家了解这份下令手册,将手册里面用到的几个术语先简略的介绍一下:

1,virtual-service-address:是指虚拟服务器的ip 地址
2,real-service-address:是指真实服务器的ip 地址
3,scheduler:调度要领

(lna@networksbase.com 翻译 ipvsadm v1.21 2004 年4 月)

ipvsadm 的用法和格局如下:

ipvsadm -A|E -t|u|f virutal-service-address:port [-s scheduler] [-p
[timeout]] [-M netmask]
ipvsadm -D -t|u|f virtual-service-address
ipvsadm -C
ipvsadm -R
ipvsadm -S [-n]
ipvsadm -a|e -t|u|f service-address:port -r real-server-address:port
[-g|i|m] [-w weight]
ipvsadm -d -t|u|f service-address -r server-address
ipvsadm -L|l [options]
ipvsadm -Z [-t|u|f service-address]
ipvsadm --set tcp tcpfin udp
ipvsadm --start-daemon state [--mcast-interface interface]
ipvsadm --stop-daemon
ipvsadm -h

下令选项解释:

有两种下令选项格局,长的和短的,拥有雷同的意思。在现实运用时,两种都可
以。
-A --add-service 在内核的虚拟服务器表中增加一条新的虚拟服务器记载。也
就是添加一台新的虚拟服务器。
-E --edit-service 编辑内核虚拟服务器表中的一条虚拟服务器记载。
-D --delete-service 删除内核虚拟服务器表中的一条虚拟服务器记载。
-C --clear 革除内核虚拟服务器表中的所有记载。
-R --restore 恢复虚拟服务器法则
-S --save 保留虚拟服务器法则,输出为-R 选项可读的格局
-a --add-server 在内核虚拟服务器表的一条记载里增加一条新的真实服务器
记载。也就是在一个虚拟服务器中添加一台新的真实服务器
-e --edit-server 编辑一条虚拟服务器记载中的某条真实服务器记载
-d --delete-server 删除一条虚拟服务器记载中的某条真实服务器记载
-L|-l --list 显示内核虚拟服务器表
-Z --zero 虚拟服务表计数器清零(清空目前的连贯数目等)
--set tcp tcpfin udp 设置连贯超时值
--start-daemon 启动同步守护进程。他背面可以是master 或backup,用来说
明LVS Router 是master 或是backup。在这个功能上也可以采纳keepalived 的
VRRP 功能。
--stop-daemon 休止同步守护进程
-h --help 显示帮忙信息

其他的选项:

-t --tcp-service service-address 注明虚拟服务器供给的是tcp 的服务
[vip:port] or [real-server-ip:port]
-u --udp-service service-address 注明虚拟服务器供给的是udp 的服务
[vip:port] or [real-server-ip:port]
-f --fwmark-service fwmark 注明是经过iptables 标志过的服务类型。
-s --scheduler scheduler 运用的调度算法,有这样几个选项
rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq,
默许的调度算法是: wlc.
-p --persistent [timeout] 耐久巩固的服务。这个选项的意思是来自统一个客
户的屡次请求,将被统一台真实的服务器处置。timeout 的默许值为300 秒。
-M --netmask netmask persistent granularity mask
-r --real-server server-address 真实的服务器[Real-Server:port]
-g --gatewaying 指定LVS 的工作模式为直接路由模式(也是LVS 默许的模式)
-i --ipip 指定LVS 的工作模式为隧道模式
-m --masquerading 指定LVS 的工作模式为NAT 模式
-w --weight weight 真实服务器的权值
--mcast-interface interface 指定组播的同步接口
-c --connection 显示LVS 当前的连贯 如:ipvsadm -L -c
--timeout 显示tcp tcpfin udp 的timeout 值 如:ipvsadm -L --timeout
--daemon 显示同步守护进程状态
--stats 显示统计信息
--rate 显示速率信息
--sort 对虚拟服务器和真实服务器排序输出
--numeric -n 输出IP 地址和端口的数字情势

附上实例

xian_LD_46:~ # ipvsadm
IP Virtual Server version 1.2.1 (size=1048576)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 11.22..239.138:http wrr
-> 192.168.34.22:http Tunnel 1 18974 19855
-> 192.168.34.29:http Tunnel 1 18951 19877
-> 192.168.34.21:http Tunnel 1 19727 20063
-> 192.168.34.23:http Tunnel 1 19182 19640
-> 192.168.34.28:http Tunnel 1 19109 19863
-> 192.168.34.65:http Tunnel 1 19113 19729
-> 192.168.34.66:http Tunnel 1 19319 19520
xian_LD_46:~ # ipvsadm -l --rate
IP Virtual Server version 1.2.1 (size=1048576)
Prot LocalAddress:Port CPS InPPS OutPPS InBPS OutBPS
-> RemoteAddress:Port
TCP 11.22..239.138:http 2803 81379 0 8734018 0
-> 192.168.34.22:http 400 11709 0 1255635 0
-> 192.168.34.29:http 400 11090 0 1228650 0
-> 192.168.34.21:http 401 11789 0 1262369 0
-> 192.168.34.23:http 401 12320 0 1278632 0
-> 192.168.34.28:http 400 11721 0 1268672 0
-> 192.168.34.65:http 400 11382 0 1210737 0
-> 192.168.34.66:http 400 11369 0 1229318 0
TCP 11.22..239.139:http 1707 14506 0 2293752 0


xian_LD_46:~ # ipvsadm -L -c |head -n 5
IPVS connection entries
pro expire state source virtual destination
TCP 00:46 FIN_WAIT 125.33.200.144:6446 11.22..239.139:http 192.168.13.121:http
TCP 00:51 SYN_RECV 116.2.118.223:btpp2audctr1 11.22..239.138:http 192.168.34.28:http
TCP 00:07 CLOSE 221.196.32.99:14256 11.22..239.138:http 192.168.34.29:http

热门标签:dede模板 / destoon模板 / dedecms模版 / 织梦模板
责任编辑:bST0V
打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

共有152人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助



订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板