On 10/20/23 13:34, David Filip wrote:
Understand about redundancy and needing an odd number of nodes (I’ve used quorum in other (non-Solr) type of clusters, so I get it).

So what I’ve done now is installed ZooKeeper on a separate (physical) node (so no longer using ZooKeeper bundled with Solr, since that was causing come confusion).

So I’m trying to follow this document regarding how to set up the “Ensemble” for Solr:

Setting Up an External ZooKeeper Ensemble | Apache Solr Reference Guide 6.6 <https://solr.apache.org/guide/6_6/setting-up-an-external-zookeeper-ensemble.html> solr.apache.org <https://solr.apache.org/guide/6_6/setting-up-an-external-zookeeper-ensemble.html> favicon.ico <https://solr.apache.org/guide/6_6/setting-up-an-external-zookeeper-ensemble.html>

<https://solr.apache.org/guide/6_6/setting-up-an-external-zookeeper-ensemble.html>

This includes the following “example” in zoo.cfg:

|dataDir=/var/lib/zookeeperdata/1 clientPort=2181 initLimit=5 syncLimit=2 server.1=localhost:2888:3888 server.2=localhost:2889:3889 server.3=localhost:2890:3890|


So assuming that I have three (3x) physical nodes — each running Solr 9.2 — and assuming that they are named:

solr1.mydomain.com <http://solr1.mydomain.com>
solr2.mydomain.com <http://solr2.mydomain.com>
solr3.mydomain.com <http://solr.mydomain.com>

This is getting into how to configure ZK, which is a completely separate Apache project from Solr. My info here is from memory.

Those names will only work if each ZK instance is on the same machine as a Solr instance. ZK is completely separate from Solr, you do not tell it anything about Solr. You also need the port numbers. If ZK will be on the same machines as Solr, I would use something like this, and the ZK config will be identical on all the ZK servers:

dataDir=/path/to/some/data/directory
clientPort=2181
initLimit=5
syncLimit=2
server.1=solr1.mydomain.com:2888:3888
server.2=solr1.mydomain.com:2888:3888
server.3=solr1.mydomain.com:2888:3888

You must ensure that the ZK servers can talk to each other on tcp ports 2888 and 3888, and that each Solr server can reach all the ZK servers on port 2181. For most purposes, you do not want to use localhost.

Each server will have a file with its id number. I think it is named "myid" in the data directory, but you should check ZK documentation to make sure.

The -z option on the solr script would be something like this:

solr1.mydomain.com:2181,solr2.mydomain.com:2181,solr3.mydomain.com/solr

For redundancy purposes, every Solr server will need to talk to ALL of the ZK servers, not just one.

Adding a chroot (which is /solr in my example) is encouraged just in case you might want to use your ZK install to coordinate software other than Solr or for multiple SolrCloud clusters. The Solr reference guide has info about how to create the chroot with a 'bin/solr zk' command.

Thanks,
Shawn

Reply via email to