Malte Behrendt
Malte Behrendt

Reputation: 21

How to use SSL on distributed vert.x EventBus?

However, I can not make it work for me:

Setup:

Working:

Failing:

Log messages:

I tried using different keys/certificates, keystore + trusted keystores, enabling/disabling client auth requirement. Nothing worked so far.

Questions:

  1. How do I get more log messages from Netty/EventBus-Impl/Hazelcast?
  2. Any idea what could be the issue with clustering + SSL?

Upvotes: 2

Views: 1090

Answers (1)

Vassilis Bekiaris
Vassilis Bekiaris

Reputation: 823

I tried executing the SSL eventbus example on two machines and in my case it failed due to Hazelcast not being able to establish a cluster at startup (so each hazelcast instance was a single-node cluster of its own). Once I fixed that, the example worked flawlessly. Vertx-hazelcast documentation has a related section on troubleshooting clustering.

The reason Hazelcast was not able to form a cluster in my case was that the default Hazelcast configuration (in $VERTX_HOME/conf/default-cluster.xml) configures Hazelcast for multicast discovery; this is by default disabled on OSX (also it's not unusual for home routers to disable multicast traffic). I copied $VERTX_HOME/conf/default-cluster.xml to my working directory, then changed the <multicast> and <tcp-ip> sections of the configuration as follows:

  <multicast enabled="false"> <!-- was originally true -->
    <multicast-group>224.2.2.3</multicast-group>
    <multicast-port>54327</multicast-port>
  </multicast>
  <tcp-ip enabled="true"> <!-- this one was false -->
    <!-- list your cluster machines IPs including the current one in member elements -->
    <member>192.168.2.1</member>
    <member>192.168.2.2</member>
  </tcp-ip>

Copy the cluster.xml on both machines, then start vertx from the directory where you placed cluster.xml in order for vertx to pick it up (I did that in the javascript example sources directory so I executed vertx run receiver.js -cluster / vertx run sender.js -cluster on each machine) and it worked.

Vertx-hazelcast module documentation also provides instructions for configuring logging, configuring vertx with the location of your hazelcast XML configuration and choosing the cluster host address to bind to (useful in case you have multiple network interfaces).

Upvotes: 1

Related Questions