Skip to content

Commit

Permalink
Disable hazelcast all join method when run with non-cluster mode
Browse files Browse the repository at this point in the history
  • Loading branch information
donggyu04 authored and junoyoon committed Feb 20, 2019
1 parent 16d081c commit e1a4514
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,14 @@ public HazelcastInstance embeddedHazelcast() {

if (isClustered() && getClusterURIs() != null && getClusterURIs().length > 0) {
JoinConfig join = networkConfig.getJoin();
join.getAwsConfig().setEnabled(false);
join.getMulticastConfig().setEnabled(false);
TcpIpConfig tcpIpConfig = join.getTcpIpConfig();
tcpIpConfig.setEnabled(true);
tcpIpConfig.setMembers(Arrays.asList(getClusterURIs()));
networkConfig.setPublicAddress(selectLocalIp(Arrays.asList(getClusterURIs())));
} else {
JoinConfig join = networkConfig.getJoin();
join.getAwsConfig().setEnabled(false);
join.getTcpIpConfig().setEnabled(false);
join.getMulticastConfig().setEnabled(true);
join.getMulticastConfig().setEnabled(false);
}

HazelcastInstance hazelcastInstance = Hazelcast.newHazelcastInstance(hazelcastConfig);
Expand Down

0 comments on commit e1a4514

Please sign in to comment.