Reputation: 34071
I am trying to learn vertx and downloaded a sample from github.
Consider following code snippet:
VertxOptions options = new VertxOptions().setClustered(true).setClusterHost("localhost");
How can I imagine how the localhost will be clustered?
Upvotes: 1
Views: 335
Reputation: 2792
If you run your example in multiple JVM's on the same host, then these JVM's will be clustered.
If you want to run the JVM's on different hosts, then it is important to specify the ip and not localhost.
Here is the Troubelshoot section of the vert.x doc on this topic: http://vertx.io/docs/vertx-hazelcast/java/#_using_wrong_network_interface
If you are interested in playing around with the clustering on one host / different hosts you can use this application https://github.com/swisspush/vertx-cluster-watchdog
Upvotes: 2