我做的lvs+keepalived ,用ipvsadm -ln 只能看到一台真实主机
我安装ipvsadm-1.24和keepalived-1.1.19,然后配置keepalived.conf
复制代码
然后用ipvsadm -ln 查看如下
复制代码
只能看到一台真实主机是为乍回事儿呢?
是不是客户端也需要配置?
- global_defs {
- router_id LVS_DEVEL
- }
-
- vrrp_sync_group VG_1{
- group{
- VI_1
- }
- }
-
- vrrp_instance VI_1{
- #state BACKUP
- state MASTER
- nopreempt
- interface eth0
- virtual_route_id 51
- priority 180
- advert_int 5
- authentication {
- auth_type PASS
- auth_pass 1111
- }
- virtual_ipaddress {
- 192.168.6.222
- }
- }
-
- virtual_server 192.168.6.222 22222 {
- delay_loop 6
- lb_algo wrr
- lb_kind DR
- persistence_timeout 50
- protocol TCP
-
- real_server 192.168.6.9 8089{
- weight 1
- TCP_CHECK{
- connect_timeout 3
- nb_get_retry 10
- delay_before_retry 10
- connect_port 8089
- }
- }
-
-
- real_server 192.168.6.2 8089{
- weight 1
- TCP_CHECK{
- connect_timeout 3
- nb_get_retry 10
- delay_before_retry 10
- connect_port 8089
- }
- }
- }
- [root@localhost keepalived]$vi keepalived.conf
- [root@localhost keepalived]$ipvsadm -ln
- IP Virtual Server version 1.2.1 (size=4096)
- Prot LocalAddress:Port Scheduler Flags
- -> RemoteAddress:Port Forward Weight ActiveConn InActConn
- TCP 192.168.6.222:22222 wrr persistent 50
- -> 192.168.6.9:8089 Route 1 0 0
是不是客户端也需要配置?
作者: mfkwwgi 发布时间: 2011-02-12
服务器,和客户端是需需要添加loopback 地址,并且loopback 地址是否需要手动添加?
作者: mfkwwgi 发布时间: 2011-02-12