java - Vertx: Why is there no clustered verticle? -
im messing around 2 verticles , want start in clustered mode.
here start-methods of 2 verticles:
first verticle:
public static void main(string[] args) { vertxoptions options = new vertxoptions(); options.setclustered(true); options.setclustermanager(new hazelcastclustermanager()); vertx.clusteredvertx(options, res -> { vertx vertx = res.result(); vertx.deployverticle(new walzenschnittblmock()); }); }
second verticle:
public void start() { vertxoptions options = new vertxoptions(); vertx.clusteredvertx(options, res -> { vertx = res.result(); vertx.deployverticle(serviceverticle, this::completeregister); }); }
thhis 2 verticles reside on different machines, not "see" each other, although there in clustered mode....is there problem..have missed something?
i found solution:
i have 2 machines , each of them have 4 networkcards - , vertx seems choose wrong one. forced set ip-adress vertx should use. result looks ipadress argument of jar-file :
vertxoptions options = new vertxoptions(); config config = new config(); networkconfig networkconfig = config.getnetworkconfig(); networkconfig.getinterfaces().setenabled(true).addinterface(args[0]); options.setclustermanager(new hazelcastclustermanager(config)); options.setclustered(true); options.setclusterhost(args[0]); vertx.clusteredvertx(options, res -> { vertx vertx = res.result(); vertx.deployverticle(new receiver()); });
Comments
Post a Comment