Handling EventBus clustering on Kubernetes + Hazelcast

412 views
Skip to first unread message

Mohamed Moharam

unread,
Apr 17, 2017, 2:50:32 PM4/17/17
to vert.x
Hi All,

I'm clustering several vertx pods successfully but failed so far to make the pods talk to each other over EventBus. I'm using vertx 3.4.0, vertx-hazelcast, vertx-service-discovery. Following what I did:

1) I initialized vertx as follows (on both ends):

Config hazelcastConfig = new Config();
        hazelcastConfig.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
        hazelcastConfig.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(false);

        DiscoveryStrategyConfig strategyConfig = new DiscoveryStrategyConfig(new HazelcastKubernetesDiscoveryStrategyFactory());
        strategyConfig.addProperty("namespace", System.getenv(""HAZELCAST_VALUE"));
        strategyConfig.addProperty("service-label-name", System.getenv("HAZELCAST_LABEL"));
        strategyConfig.addProperty("service-label-value", System.getenv("HAZELCAST_VALUE"));

hazelcastConfig.getNetworkConfig().getJoin().getDiscoveryConfig().addDiscoveryStrategyConfig(strategyConfig);

ClusterManager mgr = new HazelcastClusterManager(hazelcastConfig);

// the log shows : 
        String address = GetEthernetIPAddress();
        System.out.println("--------- Using address ==> " + address);

        VertxOptions vertxOptions = new VertxOptions()
                .setClusterManager(mgr)
                .setClusterPublicHost(address)
                .setClusterPublicPort(5711);


the result is :

--------- Using address ==> 10.244.2.88
.....
2017-04-17T18:14:02.411827149Z Members [3] {
2017-04-17T18:14:02.411829949Z Member [10.244.0.132]:5701
2017-04-17T18:14:02.411833249Z Member [10.244.0.133]:5701
2017-04-17T18:14:02.411836049Z Member [10.244.2.88]:5701 this
2017-04-17T18:14:02.411838949Z }


2) Ensured the port 5701, 5711 is exposed on both pods

3) Confirmed that the consumer is successfully registering the bus handler on all nodes with the correct bus address.
 
Now when I'm trying to send over the eventbus I got the following error:

 Timed out after waiting 30000(ms) for a reply. address: 6743eae7-878d-4b3e-b9a7-84e03538b06c

How can I sort out this issue?

Thanks,
Mohamed 

Mohamed Moharam

unread,
Apr 18, 2017, 5:17:31 AM4/18/17
to vert.x
just to answer my own question:

Using setClusterPublicHost(address) and setClusterPublicPort(5711);  is not correct here as it seems they are configuring Hazelcast clustering and not the eventbus. I used .setEventBusOptions(new EventBusOptions().setPort(5711).setHost(address) and it worked.
 
Reply all
Reply to author
Forward
0 new messages