Github user IMS94 commented on the issue:
https://github.com/apache/curator/pull/175
Yes. If we are to provide unit tests, we must be aware of the network
interfaces in the host machine.I manually tested whether all are fine when I
wanted to run a zookeeper cluster to test my clustering implementation through
a LAN and it worked fine.
```
List<InstanceSpec> specs = new ArrayList<>();
List<Integer> ports = new ArrayList<>();
int port = 30155, electionPort = 31155, quorumPort = 32155;
for (int i = 0; i < 3; i++) {
InstanceSpec spec = new InstanceSpec(null, port, electionPort,
quorumPort,
true, i, 10000, 100, null, "0.0.0.0");
logger.info("Zookeeper-{} : port : {}, election port : {},
quorum port : {}", i, port, electionPort, quorumPort);
specs.add(spec);
ports.add(port);
port++;
electionPort++;
quorumPort++;
}
logger.info("Connect string ports : {}", ports);
TestingCluster cluster = new TestingCluster(specs);
try {
cluster.start();
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
try {
logger.debug("Stopping cluster");
cluster.stop();
} catch (IOException e) {
logger.error("Error when stopping cluster", e);
}
}));
} catch (Exception e) {
logger.error("Error when starting zookeeper cluster", e);
throw e;
}
logger.info("Cluster started with ports : {}", ports);
```
Here, I had used "0.0.0.0" to open ports on all interfaces. I tried with my
IPv4 address assigned by my LAN and confirmed that I can access these ports
through network
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---