--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/f5a64f20-333f-4c53-bfed-82a56c3b46dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
vertx-cluster:
hostname: cluster
image: vertx/vertx3-exec
command: bare
vertx-inst1:
build: ./inst1
hostname: inst1
links:
- vertx-cluster:cluster
vertx-inst2:
build: ./inst2
hostname: inst2
links:
- vertx-cluster:cluster
vertx-cluster: hostname: cluster image: vertx/vertx3-exec command: barevertx-inst1:
image: sample/image1 hostname: inst1 ports: - "7777:7777"
links: - vertx-cluster:clustervertx-inst2:
image: sample/image1 hostname: inst2 ports: - "8888:8888" links: - vertx-cluster:cluster
vertx-inst1_1 | /pingvertx-inst1_1 | /pingvertx-inst1_1 | (TIMEOUT,-1) Timed out waiting for a replyvertx-inst1_1 | (TIMEOUT,-1) Timed out waiting for a replyvertx-inst1_1 | at io.vertx.core.eventbus.impl.HandlerRegistration.sendAsyncResultFailure(HandlerRegistration.java:117)vertx-inst1_1 | at io.vertx.core.eventbus.impl.HandlerRegistration.lambda$new$147(HandlerRegistration.java:64)vertx-inst1_1 | at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:738)vertx-inst1_1 | at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:709)vertx-inst1_1 | at io.vertx.core.impl.ContextImpl.lambda$wrapTask$18(ContextImpl.java:335)vertx-inst1_1 | at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358)vertx-inst1_1 | at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)vertx-inst1_1 | at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)vertx-inst1_1 | at java.lang.Thread.run(Thread.java:745)
On 14 févr. 2016, at 05:05, David Bush <dbu...@gmail.com> wrote:
Here's an example of using Docker Compose to cluster two Groovy verticals. There's no need for a customized cluster.xml as Docker will allow multicast networking between the containers mentioned in the compose file.
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/a012e459-43fb-4282-bf93-83ef7e59f589%40googlegroups.com.
We tried it successfully in a recent spike.
What was neat:
. Creates multicast capable network on environments that don't support multicast
. DNS
. Useful UI and network visualisation
PS I don't work for weave; this is a personal post; it doesn't imply the views of my employer
String name = ManagementFactory.getRuntimeMXBean().getName();
vertx-inst2_1 | Members [3] {
vertx-inst2_1 | Member [172.17.0.6]:5701
vertx-inst2_1 | Member [172.17.0.7]:5701
vertx-inst2_1 | Member [172.17.0.8]:5701 this
vertx-inst2_1 | }
...
vertx-inst1_1 | Reply: ping from 5@inst1 Mon Feb 29 06:35:24 UTC 2016
vertx-inst2_1 | Reply: ping from 5@inst2 Mon Feb 29 06:35:25 UTC 2016
vertx-inst1_1 | Reply: ping from 5@inst1 Mon Feb 29 06:35:26 UTC 2016
vertx-inst2_1 | Reply: ping from 5@inst2 Mon Feb 29 06:35:27 UTC 2016
java -jar inst1/hello-verticle-fatjar-3.2.1.jar
java -jar inst2/hello-verticle-fatjar-3.2.1.jar
Reply: ping from 22666@ubuntu1404.sky Mon Feb 29 07:39:21 CET 2016
Reply: ping from 22751@ubuntu1404.sky Mon Feb 29 07:39:22 CET 2016
Reply: ping from 22666@ubuntu1404.sky Mon Feb 29 07:39:23 CET 2016
Reply: ping from 22751@ubuntu1404.sky Mon Feb 29 07:39:24 CET 2016
Reply: ping from 22751@ubuntu1404.sky Mon Feb 29 07:39:20 CET 2016
Reply: ping from 22666@ubuntu1404.sky Mon Feb 29 07:39:21 CET 2016
Reply: ping from 22751@ubuntu1404.sky Mon Feb 29 07:39:22 CET 2016
Reply: ping from 22666@ubuntu1404.sky Mon Feb 29 07:39:23 CET 2016
vertx-inst1_1 | ping from 5@inst1
vertx-inst2_1 | ping from 5@inst2
vertx-inst1_1 | ping from 5@inst1
vertx-inst2_1 | ping from 5@inst2
ping from 25476@ubuntu1404.sky Mon Feb 29 08:33:02 CET 2016
ping from 25523@ubuntu1404.sky Mon Feb 29 08:33:02 CET 2016
ping from 25476@ubuntu1404.sky Mon Feb 29 08:33:03 CET 2016
ping from 25523@ubuntu1404.sky Mon Feb 29 08:33:03 CET 2016
ping from 25523@ubuntu1404.sky Mon Feb 29 08:33:05 CET 2016
ping from 25476@ubuntu1404.sky Mon Feb 29 08:33:06 CET 2016
ping from 25523@ubuntu1404.sky Mon Feb 29 08:33:06 CET 2016
ping from 25476@ubuntu1404.sky Mon Feb 29 08:33:07 CET 2016
App.java
String local = InetAddress.getLocalHost().getHostAddress();
VertxOptions options = new VertxOptions();
options.setClusterHost(local);
Vertx.clusteredVertx(options, vertxAsyncResult -> vertxAsyncResult.result().deployVerticle(new HelloVerticle()));
docker-compose.yml
vertx-inst1:
build: ./inst1
hostname: inst1
vertx-inst2:
build: ./inst2
hostname: inst2
String dockerIp = InetAddress.getByName("vertx").getHostAddress();
VertxOptions options = new VertxOptions();
options.setClusterHost(dockerIp);
Vertx.clusteredVertx(options, vertxAsyncResult -> vertxAsyncResult.result().deployVerticle(new HelloVerticle()));
vertx-inst1:
build: ./inst1
hostname: vertx
vertx-inst2:
build: ./inst2
hostname: vertx
@Override
public void start() throws Exception {
String name = UUID.randomUUID().toString();
vertx.setPeriodic(1000, id -> {
vertx.eventBus().publish("ping", "ping from " + name + " " + new Date());
});
vertx.eventBus().consumer("ping", message -> {
System.out.println(message.body());
});
}
vertx-inst1_1 | ping from 66b4818a-bf7d-4257-9024-d49bf8cb9327 Tue Mar 01 06:53:21 UTC 2016
vertx-inst1_1 | ping from 6069ce7b-828c-4837-b796-ab04b93887e0 Tue Mar 01 06:53:21 UTC 2016
vertx-inst2_1 | ping from 6069ce7b-828c-4837-b796-ab04b93887e0 Tue Mar 01 06:53:21 UTC 2016
vertx-inst2_1 | ping from 66b4818a-bf7d-4257-9024-d49bf8cb9327 Tue Mar 01 06:53:22 UTC 2016
Is there a full example of the Docker - Hazelcast - Zookeeper solution available?
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/26981443-869d-458c-8dfd-3961c90d5c68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.