Yes, that is the best way to go, but only available for zk >3.5, I have spun up zookeeper and checked /zookeeper/config.
Any idea if querying the ZK client for information for zk >3.5 will be added in the near future? Should I raise a JIRA for it? On 28/9/19, 1:33 AM, "Shawn Heisey" <apa...@elyograg.org> wrote: On 9/27/2019 10:39 AM, LEE Ween Jiann wrote: > FYI, solr-zookeeper-headless resolves to 3 different IPs. And getZkRawResponse() method only connects to 1 of the 3. > > My suggestion is the following: > - List<String> zookeepers = Arrays.asList(zkHost.split("/")[0].split(",")); > + List<String> zookeeperHosts = Arrays.asList(zkHost.split("/")[0].split(",")); > + final List<String> zookeepers = new ArrayList<>(); > + for (String host : zookeeperHosts) { > + // resolve host and add all IP:port to zookeepers array > + } > > Let me know your thoughts. I think that Solr should query the ZK client for information about what server hosts are active, rather than relying on the connection string, unless that information cannot be obtained by the client. That will be particularly important now that Solr contains ZK client version 3.5.x. When paired with servers also running 3.5 or later, it is capable of dynamic reconfiguration. It is entirely possible that the active server list will be very different than the connection string. According to the ZK team, the /zookeeper/config znode has this information. I do not know if that is new in version 3.5 or if it also exists in 3.4. Thanks, Shawn