Ipvsadm参数详解

来源:互联网 发布:c语言创建目录函数 编辑:程序博客网 时间:2024/06/08 02:52
--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 地址和端口的数字形式
 
[plain] view plaincopy
01.--stat选项是统计自该条转发规则生效以来的包  
02.1. Conns    (connections scheduled)  已经转发过的连接数  
03.2. InPkts   (incoming packets)       入包个数  
04.3. OutPkts  (outgoing packets)       出包个数  
05.4. InBytes  (incoming bytes)         入流量(字节)    
06.5. OutBytes (outgoing bytes)         出流量(字节)  


[plain] view plaincopy
01.--rate选项是显示速率信息  
02.1. CPS      (current connection rate)   每秒连接数  
03.2. InPPS    (current in packet rate)    每秒的入包个数  
04.3. OutPPS   (current out packet rate)   每秒的出包个数  
05.4. InBPS    (current in byte rate)      每秒入流量(字节)  
06.5. OutBPS   (current out byte rate)      每秒入流量(字节) 
0 0
原创粉丝点击