Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blacklists all hosts #2

Open
Scrier opened this issue Aug 2, 2016 · 1 comment
Open

Blacklists all hosts #2

Scrier opened this issue Aug 2, 2016 · 1 comment

Comments

@Scrier
Copy link

Scrier commented Aug 2, 2016

Hi!

I have posted this in https://groups.google.com/forum/#!topic/hazelcast/p6JtKsyAoK4, and they recommended me to post it here.

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

@bpiper
Copy link

bpiper commented Feb 28, 2018

I hit the same issue. Seems it was failing to connect because it was trying to bind the client socket to the host IP instead of the container IP. Setting hazelcast.socket.client.bind.any to true (or rather not setting it to false as the README suggests, since true is the default) seems to have resolved it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants