————
固定調度
rr:論調
wrr:加權論調
weight,加權
sh:source hash ,源地址hash
動態調度
lc:最少鏈接
active*256+inactive
wlc:加權最少鏈接
(active*256+inactive)/weight
sed:最短期望延遲
(active+1)*256/weight
nq:never queue (永不排隊)
LBLC:基於本地的最少鏈接
LBLCR:基於本地的帶復制功能的最少鏈接
————
lvs
ipvsadm:管理集群服務的命令行工具
管理集群服務
添加:-A -t|u|f service-address[-s sheduler ]
{ -t:TCP協議集群
-u:UDP協議集群} service-address: IP:PORT(套接字)
-f:FWM:防火牆標記
service-address : Mark Number
修改: -E
刪除: -D -t|u|f service-address
管理機器服務中心的RS
添加:-a -t|u|f service-address -r server-address [-g|i|m] [-w weight ]
-t|u|f service-address:事前定義好的某集群服務
-r server-address :某RS的地址,在NAT模型中;可使用IP:PORT實現端口映射:
[-g|i|m]:lvs類型
-g:DR
-i:TUN
-m:NAT
[-w weight ]:定義權重
修改:-e
刪除:-d -t|u|f serrvice address -r service-add
# ipvsadm -a -t xx.xx.xx.xx:80 -r xx.xx.xx.xx -m
查看
-L|l
-n:數字格式顯示IP地址和端口號
--stats:統計信息
--rate:速率
--timeout:顯示TCP/TCPFIN/UDP的會話超時時長
--sort:排序
-c:顯示當前IPVS的鏈接狀態
-Z:清空計數器
-C:清空ipvs規則
-S:使用輸出重定向進行規則保存
# ipvsadm -S > /../..
-R:使用輸入重定向載入規則
# ipvsadm -R < /../..
