Reputation:
When I run the server.bat in the same hazelcast client twice, I can see that I am am able to form a cluster with two members on the same physical computer. However, when I try using the following code to spawn a new instance (on the same physical machine) using the same hazelcast.xml config file (as the ones being used by the sample client), my server instance does not seem to join the samle client node. The server process I am starting is staying up (I can see it in visualvm). I have Join->multicast enabled to true for both sample client and my hazelcast server. I am trying to figure out if my server is reading the proper hazelcast config or not - will update the post on that.
<join>
<multicast enabled="true">
<multicast-group>224.2.2.3</multicast-group> <!--224.2.2.3-->
<multicast-port>54327</multicast-port>
</multicast>
</join>
Server sample:
HazelcastInstance hcast = null;
try {
final Config config = new FileSystemXmlConfig("src/main/config/hazelcast.xml");
hcast = Hazelcast.newHazelcastInstance(config);
} (catch Exception e) {
//log statement
}
Upvotes: 2
Views: 1354
Reputation:
I was reading the wrong config file. When I enabled multicast join to true, the cluster was formed. I will try tcp besides that as well. I should have read the config file being read when I started the hazelcast server
Upvotes: 1