cnbird 发表于 2011-04-06 11:49

keepalived虚IP获得了但是不能访问80端口

本帖最后由 cnbird 于 2011-04-06 12:02 编辑

从配置
# cat keepalived.conf
global_defs {
   router_id HAPROXY
    notification_email {
               yangning100661@123.com
      }
    notification_email_from keepalived@123.com
    smtp_server 127.0.0.1
}

vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 177
    priority 199
    advert_int 1
    authentication {
      auth_type PASS
      auth_pass password
    }
    virtual_ipaddress {
      10.255.248.248
    }
}

virtual_server 10.255.248.248 80 {
    delay_loop 6
    lb_algo wrr
    lb_kind DR
    persistence_timeout 1800
    protocol TCP

    real_server 10.255.248.250 81 {
      weight 1
      TCP_CHECK {
                connect_port 81
                connect_timeout 3
      }
    }
    real_server 10.255.248.251 81 {
      weight 1
      TCP_CHECK {
                connect_port 81
                connect_timeout 3
      }
    }

}

主配置:
# cat /etc/keepalived/keepalived.conf
global_defs {
   router_id HAPROXY
    notification_email {
               yangning100661@123.com
      }
    notification_email_from keepalived@123.com
    smtp_server 127.0.0.1
}

vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 177
    priority 200
    advert_int 1
    authentication {
      auth_type PASS
      auth_pass password
    }
    virtual_ipaddress {
      10.255.248.248
    }
}

virtual_server 10.255.248.248 80 {
    delay_loop 6
    lb_algo wrr
    lb_kind DR
    persistence_timeout 1800
    protocol TCP

    real_server 10.255.248.250 81 {
      weight 1
      TCP_CHECK {
                connect_port 81
                connect_timeout 3
      }
    }
    real_server 10.255.248.251 81 {
      weight 1
      TCP_CHECK {
                connect_port 81
                connect_timeout 3
      }
    }

}

现在的问题是连接不到10.255.248.248的80端口

realmon 发表于 2011-04-21 12:16

ipvsadm 看看

我家的双双 发表于 2017-02-05 15:20

我的也是,怎么搞啊

wangyanjie_001 发表于 2017-02-08 13:24

如果配置文件如果没有问题的话, 就是你把nginx或是apache的服务重启就行了,就可以正常访问了。以后配置keep时先配置keep服务再配置aPACHE或是nginx服务就没有这样的问题了。

ashchen 发表于 2018-06-04 13:42

DR模式下能使用不同端口吗?我表示怀疑@!
页: [1]
查看完整版本: keepalived虚IP获得了但是不能访问80端口