问题
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 dev
cluster 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