Hazelcast tcp-ip configuration cluster: Unwanted IPs join the cluster even after cluster-name is specified

泄露秘密 提交于 2021-01-29 06:28:20

问题


I have two hazelcast configure yaml files:

hazelcast-cluster1.yml:

  hazelcast:
    cluster-name: cluster1
    network:
      join:
        multicast:
          enabled:false
        tip-ip:
          enabled: true
          member-list:
           machineA
           machineB

hazelcast-cluster2.yml:

  hazelcast:
    cluster-name: cluster2
    network:
      join:
        multicast:
          enabled:false
        tip-ip:
          enabled: true
          member-list:
           machineC
           machineD

What I wanted is machineA and machineB forms a cluster while machineC and machineD does a separate cluster. However, when I started machineC, it forms a cluster with machinaA and machineB even though I specified the cluster names differently. How can I prevent unwanted node from joining a cluster?


回答1:


You have some typos in your configurations:

  • tip-ip => tcp-ip
  • member-list: - addresses should start with -
  • indentation is wrong

So your configuration should look like:

hazelcast:
  cluster-name: cluster1
  network:
    join:
      multicast:
        enabled:false
      tcp-ip:
        enabled: true
        member-list:
        - machineA
        - machineB

This may solve your issue. If not, please share the logs from all your Hazelcast members (as recommended by Neil Stevenson)




回答2:


The log you have added shows two lines of interest. Line 1

INFO [main] [machineC]:5701 [cluster2] [4.0.1]

and line 13

INFO [main] [machineC]:5702 [dev] [4.0.1] Backpressure is disabled

Here cluster2 and dev are the cluster names. The first is as you specified but the second is the default.

Your config file hazelcast-cluster1.yml isn't being used. This is why there is a devcluster on machineA, machineB and machineC.

Further back in the logs it should show if an attempt is made to load hazelcast-cluster1.yml which would indicate if it hasn't been found or is corrupt in someway.



来源:https://stackoverflow.com/questions/65864032/hazelcast-tcp-ip-configuration-cluster-unwanted-ips-join-the-cluster-even-after

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!