【问题标题】:Jgroups UDP bind_addr creates two clusters instead oneJgroups UDP bind_addr 创建两个集群而不是一个
【发布时间】:2016-03-04 09:26:25
【问题描述】:

我在同一个网络中有两台服务器(10.40.20.1 和 10.40.20.2),使用 UDP 的集群缓存配置如下:

通过这种配置,在网络中创建了两个集群(每个集群都有一台服务器):

  <UDP bind_addr="127.0.0.1" mcast_addr="212.1.2.1" mcast_port="49960"
                      ip_ttl="64" ip_mcast="true"   
                      mcast_send_buf_size="150000" mcast_recv_buf_size="80000"  
                      ucast_send_buf_size="150000" ucast_recv_buf_size="80000"  
                      loopback="false" /> 

使用此配置,最好使用两台服务器(10.40.20.1 和 10.40.20.2)创建一个集群

 <UDP bind_addr="10.40.20.1" mcast_addr="212.1.2.1" mcast_port="49960"
                      ip_ttl="64" ip_mcast="true"   
                      mcast_send_buf_size="150000" mcast_recv_buf_size="80000"  
                      ucast_send_buf_size="150000" ucast_recv_buf_size="80000"  
                      loopback="false" />

我用的是jgroups 2.4.1,为什么一定要提供真实的ip地址?

【问题讨论】:

    标签: java jgroups


    【解决方案1】:

    第一个节点绑定到127.0.0.1,所以它不会看到另一个节点。这只有在两个节点都在同一主机上运行时才有效。

    这就是为什么您需要将bind_addr 设置为真正的 NIC。

    您还可以将bind_addr 设置为符号名称,例如site_local,那么任何站点的本地 IP 地址都会被选择。

    或者,您可以将其设置为正则表达式,例如bind_addr=match_interface:eth0.\* 选择任何以eth0 开头的接口,或bind_addr=match-address:192.168.5.\* 选择任何地址以192.168.5 开头的网卡。

    [1]http://www.jgroups.org/manual/index.html#Transport

    【讨论】:

      猜你喜欢
      • 2013-02-22
      • 2014-11-21
      • 2013-04-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-21
      相关资源
      最近更新 更多