Hazelcast discovery through marathon, blacklisting all hosts.

435 views
Skip to first unread message

Andreas Joelsson

unread,
Aug 2, 2016, 2:57:49 AM8/2/16
to Hazelcast
Hi!

we have a marathon managed cluster using dcos. So I try to connect through the other instances with https://github.com/phaneesh/hazelcast-marathon-discovery

Config config = new Config();
//This is important to enable the discovery strategy
config.setProperty(GroupProperty.DISCOVERY_SPI_ENABLED, "true");
config.setProperty(GroupProperty.DISCOVERY_SPI_PUBLIC_IP_ENABLED, "true");
config.setProperty(GroupProperty.SOCKET_CLIENT_BIND_ANY, "false");
config.setProperty(GroupProperty.SOCKET_BIND_ANY, "false");
NetworkConfig networkConfig = config.getNetworkConfig();
networkConfig.setPublicAddress(System.getenv("HOST") + ":" + System.getenv("PORT_5071"));
for(Map.Entry<String, String> item : System.getenv().entrySet()) {
    log.info(item.getKey() + " => " + item.getValue());
}
JoinConfig joinConfig = networkConfig.getJoin();
joinConfig.getTcpIpConfig().setEnabled(false);
joinConfig.getMulticastConfig().setEnabled(false);
joinConfig.getAwsConfig().setEnabled(false);
DiscoveryConfig discoveryConfig = joinConfig.getDiscoveryConfig();
//Set the discovery strategy to RangerDiscoveryStrategy
DiscoveryStrategyConfig discoveryStrategyConfig = new DiscoveryStrategyConfig(new MarathonDiscoveryStrategyFactory());
//Marathon master endpoint that can provide app metadata
discoveryStrategyConfig.addProperty("marathon-endpoint", "http://XXXX:8080");
//Namespace that needs to be used by ranger for this service
discoveryStrategyConfig.addProperty("app-id", "YYYY");
//Hazelcast port index that is used in marathon configuration
discoveryStrategyConfig.addProperty("port-index", "2");
discoveryConfig.addDiscoveryStrategyConfig(discoveryStrategyConfig);
this.hzInstance = Hazelcast.newHazelcastInstance(config);

And here is the output, deploying 2 docker images towards marathon:

Node 1:
06:45:17.712 [main] INFO  com.hazelcast.instance.Node - [#1.#1.#1.#1]:8652 [dev] [3.6.4] Activating Discovery SPI Joiner
06:45:17.716 [main] INFO  com.hazelcast.core.LifecycleService - [#1.#1.#1.#1]:8652 [dev] [3.6.4] Address[#1.#1.#1.#1]:8652 is STARTING
06:45:17.787 [main] INFO  c.h.n.t.n.NonBlockingIOThreadingModel - [#1.#1.#1.#1]:8652 [dev] [3.6.4] TcpIpConnectionManager configured with Non Blocking IO-threading model: 3 input threads and 3 output threads
06:45:17.787 [main] DEBUG c.h.n.t.n.NonBlockingIOThreadingModel - [#1.#1.#1.#1]:8652 [dev] [3.6.4] IO threads selector mode is SELECT
06:45:17.803 [cached3] INFO  c.h.cluster.impl.DiscoveryJoiner - [#1.#1.#1.#1]:8652 [dev] [3.6.4] Address[#2.#2.#2.#2]:13881 is added to the blacklist.
06:45:17.803 [cached2] INFO  c.h.cluster.impl.DiscoveryJoiner - [#1.#1.#1.#1]:8652 [dev] [3.6.4] Address[#2.#2.#2.#2]:13280 is added to the blacklist.
06:45:17.803 [cached1] INFO  c.h.cluster.impl.DiscoveryJoiner - [#1.#1.#1.#1]:8652 [dev] [3.6.4] Address[#1.#1.#1.#1]:16735 is added to the blacklist.
06:45:18.801 [main] INFO  c.h.cluster.impl.DiscoveryJoiner - [#1.#1.#1.#1]:8652 [dev] [3.6.4]

Members [1] {
 
Member [#1.#1.#1.#1]:8652 this
}

06:45:18.801 [main] WARN  com.hazelcast.instance.Node - [#1.#1.#1.#1]:8652 [dev] [3.6.4] Config seed port is 5701 and cluster size is 1. Some of the ports seem occupied!
06:45:18.831 [main] INFO  com.hazelcast.core.LifecycleService - [#1.#1.#1.#1]:8652 [dev] [3.6.4] Address[#1.#1.#1.#1]:8652 is STARTED

Node 2:
06:45:17.654 [cached3] INFO  c.h.cluster.impl.DiscoveryJoiner - [#2.#2.#2.#2]:13280 [dev] [3.6.4] Address[#2.#2.#2.#2]:13881 is added to the blacklist.
06:45:17.654 [cached1] INFO  c.h.cluster.impl.DiscoveryJoiner - [#2.#2.#2.#2]:13280 [dev] [3.6.4] Address[#1.#1.#1.#1]:16735 is added to the blacklist.
06:45:17.654 [cached2] INFO  c.h.cluster.impl.DiscoveryJoiner - [#2.#2.#2.#2]:13280 [dev] [3.6.4] Address[#1.#1.#1.#1]:8652 is added to the blacklist.
06:45:18.653 [main] INFO  c.h.cluster.impl.DiscoveryJoiner - [#2.#2.#2.#2]:13280 [dev] [3.6.4]

Members [1] {
 
Member [#2.#2.#2.#2]:13280 this
}

06:45:18.653 [main] WARN  com.hazelcast.instance.Node - [#2.#2.#2.#2]:13280 [dev] [3.6.4] Config seed port is 5701 and cluster size is 1. Some of the ports seem occupied!
06:45:18.679 [main] INFO  com.hazelcast.core.LifecycleService - [#2.#2.#2.#2]:13280 [dev] [3.6.4] Address[#2.#2.#2.#2]:13280 is STARTED

The instances being blacklisted with port 16735 and 13881 is the nodes being replaced, however the blacklist is giving small information. I Currently have debug level active on hazel cast.

// Andreas

Noctarius

unread,
Aug 2, 2016, 4:31:03 AM8/2/16
to Christoph Engelbert - Hazelcast
He Andreas,

The Marathon discovery is a community project. You’re probably better of to ask at their own github tracker if they’re not reading here.

Chris

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/977fb3d3-8bba-4863-98ba-521f7adc2c9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages