Hello,I am attempting to deploy a cluster of vertx instances running inside docker containers on Amazon EC2 instances. I have read all the posts I can find here concerning this fun topic, and learned much along the way ( in particular, that eventbus communication does not use the cluster manager, but rather direct tcp connections ). My current situation is this:By using the Hazelcast AWS discovery service, my instances successfully form a hazelcast cluster and can successfully perform all clustering operations that are managed by hazelcast, for instance sharing session information across the cluster.All instances are running the same verticle, and make use of the SockJS eventbus client to establish socket connections with web clients, so as to communicate with clients over the eventbus. This is also working, but not quite in the way I would hope.Say, for instance that I have three instances of my service deployed, let's call them A, B, and C. Hazelcast reports that each instance has successfully joined the cluster, and cluster communications are using port 5701. I have configured the eventbus to always use port 5702, and each instance reports that it is listening on port 5702. Now, web client X establishes a socket connection with instance A. Client X begins sending messages to the eventbus via A, and successfully receives replies. However, only instance A is consuming the eventbus messages, whereas I would hope that the work of consuming the messages would be shared across A, B, and C.Here are my questions:
- Say client X sends many many messages to the eventbus simultaneously over a socket connection with A ( send, not publish ). Is it fair to expect consumption of the messages to be shared across all instances on the cluster? Or should I truly expect A to consume all the messages since the socket is with A?
- It's difficult for me to parse through all the generated logs, but as far as I can tell, none of the instances are reporting any issues with eventbus communication on port 5702. But, they are also not reporting ANYTHING about port 5702 aside from a single log message stating that a listener is established on port 5702 on the expected interface. Can anyone suggest log settings that would target very specifically messages concerning the eventbus?
- My current hazelcast config very much restricts network settings to those required for AWS discovery. Do any hazelcast config settings inadvertently affect eventbus communications ( for instance, disabling tcp discovery )?
Many thanks for any help that anyone can provide!
--
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/410a9885-88e8-4d8f-b62a-db85f2485ad0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Well, this is strange... i found that in order for the verticle to listen on 5702, i HAD to use the commandline option -cluster-host 5702
...
public class MyLauncher extends Launcher {
private JsonObject config = null;
public static void main(String[] args) {
new MyLauncher().dispatch(args);
}
@Override
public void afterConfigParsed(JsonObject config) {
this.config = config;
}
@Override
public void beforeStartingVertx(VertxOptions options) {
options
.setClustered(true)
.setClusterPublicHost(config.getString("host")) // this worked and was necessary ("host" is the docker host machine's IP)
.setClusterPort(5702) // this did not seem to be honored
.setEventBusOptions(
options.getEventBusOptions()
.setClustered(true)
.setPort(5702) // is this the same setting as above? also did not seem to be honored
);
}
}
...
task capsule(type: Jar, dependsOn: jar) {
archiveName = "my-capsule.jar"
from jar
from { configurations.runtime }
from (configurations.capsule.collect { zipTree(it) }) { include "Capsule.class" }
manifest {
attributes(
"Main-Class" : "Capsule",
"Application-Class" : "com.example.MyLauncher",
"Args" : "run com.example.MyServer -cluster -cluster-port 5702",
"Min-Java-Version" : "1.8.0",
"JVM-Args" : run.jvmArgs.join(' '),
"System-Properties" : run.systemProperties.collect { k,v -> "$k=$v" }.join(' '),
"Java-Agents" : "${(++configurations.quasar.iterator()).getName()}"
)
}
}