From b15992e09bab685a3cb138da3b7a531b1d93e32e Mon Sep 17 00:00:00 2001 From: pipy201 Date: Thu, 21 Sep 2017 15:04:34 +0900 Subject: [PATCH] Add a vert.x cluster option. Need to write your IP address in the box. ex) options.setClusterHost("192.168.0.55"); --- .../spring/clustering/hazelcast/VertxProducer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spring-examples/springboot-clustering/springboot-clustering-hazelcast/src/main/java/io/vertx/examples/spring/clustering/hazelcast/VertxProducer.java b/spring-examples/springboot-clustering/springboot-clustering-hazelcast/src/main/java/io/vertx/examples/spring/clustering/hazelcast/VertxProducer.java index f1d86d626..1f5ff197c 100644 --- a/spring-examples/springboot-clustering/springboot-clustering-hazelcast/src/main/java/io/vertx/examples/spring/clustering/hazelcast/VertxProducer.java +++ b/spring-examples/springboot-clustering/springboot-clustering-hazelcast/src/main/java/io/vertx/examples/spring/clustering/hazelcast/VertxProducer.java @@ -47,8 +47,11 @@ public class VertxProducer { @PostConstruct void init() throws ExecutionException, InterruptedException { - VertxOptions options = new VertxOptions() - .setClusterManager(new HazelcastClusterManager(hazelcastInstance)); + VertxOptions options = new VertxOptions() + .setClusterManager(new HazelcastClusterManager(hazelcastInstance)) + .setClustered(true) + .setHAEnabled(true) + .setClusterHost("192.168.0.67");// Write your ip address numeric form CompletableFuture future = new CompletableFuture<>(); Vertx.clusteredVertx(options, ar -> { if (ar.succeeded()) {