![Ipvsadm:我怎样才能开始“伪装”?](https://linux22.com/image/648699/Ipvsadm%EF%BC%9A%E6%88%91%E6%80%8E%E6%A0%B7%E6%89%8D%E8%83%BD%E5%BC%80%E5%A7%8B%E2%80%9C%E4%BC%AA%E8%A3%85%E2%80%9D%EF%BC%9F.png)
我按照以下步骤设置负载平衡:
$ sudo ipvsadm -A -t 127.0.0.1:8301 -s rr
$ sudo ipvsadm -a -t 127.0.0.1:8301 -r 127.0.0.1:8310 -m
在 Ubuntu 14.04、内核 3.13.0-44-generic #73-Ubuntu、ipvsadm v1.2.6 2008/5/15 中:
$ sudo ipvsadm
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP localhost:8301 rr
-> localhost:8310 **Masq** 1 0 0
但在CentOS 6中,内核2.6.32-504.3.3.el6.x86_64,ipvsadm v1.2.6 2008/5/15:
$ sudo ipvsadm
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP localhost:amberon rr
-> localhost:8310 **Local** 1 0 0
伪装和本地有区别吗?
-m
由于在 CentOS 中无法按预期工作,我该如何进行伪装?
更新:
当我nc -l 8310
打开另一个终端时telnet localhost 8301
,CentOS 返回,Connection refused
而 Ubuntu 运行正常。