Ipvsadm参数详解(常用命令)

2013年11月29日 12:41:40 怀素1980 阅读数:15901
 
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/huaishu/article/details/17023061
[root@localhost ipvsadm]#  ipvsadm  -h
ipvsadm v1.24 2005/12/10 (compiled with popt and IPVS v1.2.1)
Usage:
  ipvsadm -A|E -t|u|f service-address [-s scheduler] [-p [timeout]] [-M netmask]
  ipvsadm -D -t|u|f service-address
  ipvsadm -C
  ipvsadm -R
  ipvsadm -S [-n]
  ipvsadm -a|e -t|u|f service-address -r server-address [options]
  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] [--syncid sid]
  ipvsadm --stop-daemon state
  ipvsadm -h

Commands:
Either long or short options are allowed.
  --add-service     -A        add virtual service with options
  --edit-service    -E        edit virtual service with options
  --delete-service  -D        delete virtual service
  --clear           -C        clear the whole table
  --restore         -R        restore rules from stdin
  --save            -S        save rules to stdout
  --add-server      -a        add real server with options
  --edit-server     -e        edit real server with options
  --delete-server   -d        delete real server
  --list            -L|-l     list the table
  --zero            -Z        zero counters in a service or all services
  --set tcp tcpfin udp        set connection timeout values
  --start-daemon              start connection sync daemon
  --stop-daemon               stop connection sync daemon
  --help            -h        display this help message

Options:
  --tcp-service  -t service-address   service-address is host[:port]
  --udp-service  -u service-address   service-address is host[:port]
  --fwmark-service  -f fwmark         fwmark is an integer greater than zero
  --scheduler    -s scheduler         one of rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq,
                                      the default scheduler is wlc.
  --persistent   -p [timeout]         persistent service
  --netmask      -M netmask           persistent granularity mask
  --real-server  -r server-address    server-address is host (and port)
  --gatewaying   -g                   gatewaying (direct routing) (default)
  --ipip         -i                   ipip encapsulation (tunneling)
  --masquerading -m                   masquerading (NAT)
  --weight       -w weight            capacity of real server
  --u-threshold  -x uthreshold        upper threshold of connections
  --l-threshold  -y lthreshold        lower threshold of connections
  --mcast-interface interface         multicast interface for connection sync
  --syncid sid                        syncid for connection sync (default=255)
  --connection   -c                   output of current IPVS connections
  --timeout                           output of timeout (tcp tcpfin udp)
  --daemon                            output of daemon information
  --stats                             output of statistics information
  --rate                              output of rate information
  --exact                             expand numbers (display exact values)
  --thresholds                        output of thresholds information
  --persistent-conn                   output of persistent connection info
  --sort                              sorting output of service/server entries
  --numeric      -n                   numeric output of addresses and ports
--add-service     -A        add virtual service with option
  在内核的虚拟服务器表中添加一条新的虚拟服务器记录。也就是增加一台新的虚拟服务器
  --edit-service    -E        edit virtual service with options
  编辑内核虚拟服务器表中的一条虚拟服务器记录
  --delete-service  -D        delete virtual service
  删除内核虚拟服务器表中的一条虚拟服务器记录
  --clear           -C        clear the whole table
  清除内核虚拟服务器表中的所有记录
  --restore         -R        restore rules from stdin
  恢复虚拟服务器规则
  --save            -S        save rules to stdout
  保存虚拟服务器规则,输出为-R 选项可读的格式
  --add-server      -a        add real server with options
  在内核虚拟服务器表的一条记录里添加一条新的真实服务器
  --edit-server     -e        edit real server with options
  编辑一条虚拟服务器记录中的某条真实服务器记录
  --delete-server   -d        delete real server
  删除一条虚拟服务器记录中的某条真实服务器记录
  --list            -L|-l     list the table
  显示内核虚拟服务器表
  --zero            -Z        zero counters in a service or all services
  虚拟服务表计数器清零
  --set tcp tcpfin udp        set connection timeout values
  设置连接超时值
  --start-daemon              start connection sync daemon
  启动同步守护进程。他后面可以是master 或backup,用来说明LVS Router 是master 或是backup。在这个功能上也可以采keepalived 的VRRP 功能。
  --stop-daemon               stop connection sync daemon
  停止同步守护进程
  --help            -h        display this help message
  显示帮助信息

Options:

  --tcp-service  -t service-address   service-address is host[:port]
  说明虚拟服务器提供的是tcp 的服务[vip:port] or [real-server-ip:port]
  --udp-service  -u service-address   service-address is host[:port]
  说明虚拟服务器提供的是udp 的服务[vip:port] or [real-server-ip:port]
  --fwmark-service  -f fwmark         fwmark is an integer greater than zero
  说明是经过iptables 标记过的服务类型。
  --scheduler    -s scheduler         one of rr|wrr|lc|wlc|lblc|lblcr|dh|sh|sed|nq,the default scheduler is wlc.
  使用的调度算法,有这样几个选项,默认的调度算法是: wlc.
  --persistent   -p [timeout]         persistent service
  持久稳固的服务。这个选项的意思是来自同一个客户的多次请求,将被同一台真实的服务器处理。timeout 的默认值为300 秒
  --netmask      -M netmask           persistent granularity mask

  --real-server  -r server-address    server-address is host (and port)
  真实的服务器[Real-Server:port]
  --gatewaying   -g                   gatewaying (direct routing) (default)
  指定LVS 的工作模式为直接路由模式(也是LVS 默认的模式
  --ipip         -i                   ipip encapsulation (tunneling)
  指定LVS 的工作模式为隧道模式
  --masquerading -m                   masquerading (NAT)
  指定LVS 的工作模式为NAT 模式
  --weight       -w weight            capacity of real server
  真实服务器的权值
  --u-threshold  -x uthreshold        upper threshold of connections

  --l-threshold  -y lthreshold        lower threshold of connections

  --mcast-interface interface         multicast interface for connection sync
  指定组播的同步接口
  --syncid sid                        syncid for connection sync (default=255)

  --connection   -c                   output of current IPVS connections
  显示LVS 目前的连接 如:ipvsadm -L -c
  --timeout                           output of timeout (tcp tcpfin udp)
  显示tcp tcpfin udp 的timeout 值 如:ipvsadm -L --timeout
  --daemon                            output of daemon information
  显示同步守护进程状态
  --stats                             output of statistics information
  显示统计信息
  --rate                              output of rate information
  显示速率信息
  --thresholds                        output of thresholds information

  --persistent-conn                   output of persistent connection info

  --sort                              sorting output of service/server entries
   对虚拟服务器和真实服务器排序输出
  --ops          -O                   one-packet scheduling

  --numeric      -n                   numeric output of addresses and ports
  输出IP 地址和端口的数字形式

有两种命令选项格式,长的和短的,具有相同的意思。在实际使用时,两种都可
以。
-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 地址和端口的数字形式

--stat选项是统计自该条转发规则生效以来的包
1. Conns    (connections scheduled)  已经转发过的连接数
2. InPkts   (incoming packets)       入包个数
3. OutPkts  (outgoing packets)       出包个数
4. InBytes  (incoming bytes)         入流量(字节)
5. OutBytes (outgoing bytes)         出流量(字节)
--rate选项是显示速率信息
1. CPS      (current connection rate)   每秒连接数
2. InPPS    (current in packet rate)    每秒的入包个数
3. OutPPS   (current out packet rate)   每秒的出包个数
4. InBPS    (current in byte rate)      每秒入流量(字节)
5. OutBPS   (current out byte rate)      每秒入流量(字节)

[转帖]Ipvsadm参数详解(常用命令)的更多相关文章

  1. ipvsadm参数详解(常用命令)

    [root@localhost ipvsadm]# ipvsadm -h ipvsadm v1.24 2005/12/10 (compiled with popt and IPVS v1.2.1) U ...

  2. mysql详解常用命令操作,利用SQL语句创建数据表—增删改查

    关系型数据库的核心内容是 关系 即 二维表 MYSQL的启动和连接show variables; [所有的变量] 1服务端启动 查看服务状态 sudo /etc/init.d/mysql status ...

  3. JAVA命令参数详解

    JAVA命令参数详解 JAVA命令详解 结构 说明 Java 和 OldJava JIT 选项 另请参阅 结构 java [ options ] class [ argument ... ] java ...

  4. shell编程系列23--shell操作数据库实战之mysql命令参数详解

    shell编程系列23--shell操作数据库实战之mysql命令参数详解 mysql命令参数详解 -u 用户名 -p 用户密码 -h 服务器ip地址 -D 连接的数据库 -N 不输出列信息 -B 使 ...

  5. free命令常用参数详解

    free命令常用参数详解 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 在运维期间我们会经常去查看服务器硬件信息,比如说内存,大家可能知道看内存用“[root@yinzhengji ...

  6. [转帖]持久化journalctl日志清空命令查看配置参数详解

    持久化journalctl日志清空命令查看配置参数详解 最近 linux上面部署服务 习惯使用systemd 进行处理 这样最大的好处能够 使用journalctl 进行查看日志信息. 今天清理了下 ...

  7. [转帖]XCopy复制文件夹命令及参数详解以及xcopy拷贝目录并排除特定文件

    XCopy复制文件夹命令及参数详解以及xcopy拷贝目录并排除特定文件 https://www.cnblogs.com/smartsmile/p/7665979.html xcopy dirA dir ...

  8. chattr的常用参数详解

    chattr的常用参数详解 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 在实际生产环境中,有的运维工程师不得不和开发和测试打交道,在我们公司最常见的就是部署接口.每天每个人部署的 ...

  9. find常用参数详解

    find常用参数详解 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 在linux系统中,在init 3模式情况下都是命令行模式,这个时候我们想要找到一个文件的就得依赖一个非常好用的 ...

随机推荐

  1. 《Java大学教程》—第24章 Java的背景

    本章主要介绍的是Java的背景知识,通过了解历史知道Java与其他语言的区别,以便更好选择在什么场景下使用Java. 24.2    语言的尺寸Java语言短小.紧凑,以C++为基础,放弃了一些特定的 ...

  2. 【车】汽车X40保养

    参考文档: [养车成本]小保养331元,奔腾X40养车成本调查

  3. 【Linux基础】VM使用

    VM三种联网方法和原理 (1)Bridged桥接 使用VMnet0虚拟交换机,此时虚拟机相当与网络上的一台独立计算机与主机一样,拥有一个独立的IP地址,所有机器均可互访,可以联网.使用桥接方式,A,A ...

  4. nginx 学习笔记

    Nginx是一个自由的.开源的.高性能的HTTP服务器和反向代理服务器:同时也是一个IMAP.POP3.SMTP代理服务器:nginx可以作为一个HTTP服务器进行网站的发布处理,另外nginx可以作 ...

  5. 本地项目上传到CODING

    1.在Coding上添加项目 1).新建项目 README:一般项目中都会添加一个README文件对项目进行概述,以便一目了然地知道这个项目是做什么用的,如何使用等信息.README文件采用markd ...

  6. nginx配置tomcat负载均衡,nginx.conf配置文件的配置

  7. [HAOI2018]苹果树

    嘟嘟嘟 这种计数大题就留给南方的计数神仙们做吧-- 刚开始我一直想枚举点,考虑新加一个点在根节点的左右子树,以及左右子树大小怎么分配,但是这样太难计算新的点带来的贡献了. 后来lba又提示我枚举边,考 ...

  8. js如何获取跨域iframe 里面content

    每天学习一点点 编程PDF电子书.视频教程免费下载:http://www.shitanlife.com/code 其中src可能存在跨域. 现有的获取方式   var test = document. ...

  9. 小a的子序列 (线性dp)

    思路:设dp[i][j]表示最大数为j,i为第i的位置的萌值.那么推导过程就是两种情况:1.第i位数不放数字,则结果就是dp[i-1][j]; 2.第i位放数字,则结果就是前面的萌值sum+dp[i- ...

  10. 环境部署(九):linux下安装python+chrome+Xvfb

    在基于selenium进行的UI自动化测试中,开发调试环境一般都是windows操作系统.完成后需要部署到专门的测试环境. 如要要部署到linux环境的服务器(阿里云.腾讯云)执行,那么测试脚本也需要 ...