epugh commented on code in PR #2391: URL: https://github.com/apache/solr/pull/2391#discussion_r3228599273
########## solr/solr-ref-guide/modules/deployment-guide/pages/zookeeper-ensemble.adoc: ########## @@ -546,6 +546,68 @@ set SOLR_OPTS=%SOLR_OPTS% -Djute.maxbuffer=0x200000 ==== ====== +[[embedded-zookeeper-ensemble]] +== Embedded ZooKeeper Ensemble (Experimental) + +WARNING: This feature is *experimental / alpha* and is not suitable for production use. +The configuration interface may change without notice in future Solr releases. + +Normally, Solr's embedded ZooKeeper runs in "standalone" mode and cannot tolerate node failures. +Starting in Solr 10.1, it is possible to run Solr nodes where each node's embedded ZooKeeper participates in a multi-node quorum (ensemble). +This allows a self-contained SolrCloud cluster without a separate ZooKeeper deployment — useful for development, testing, or small low-stakes clusters. + +=== How It Works + +Each Solr node that has the `zookeeper_quorum` xref:node-roles.adoc[node role] set to `on` will start an embedded `ZooKeeperServerEmbedded` instance on startup. +Solr identifies which host in the ZK connection string it corresponds to (by matching host+port) and assigns it a ZooKeeper `myid`. + +Port scheme used by each node: + +|=== +|Port |Formula |Example (Solr on 8983) + +|Solr HTTP +|`solr_port` +|8983 + +|ZK client +|`solr_port + 1000` +|9983 + +|ZK quorum peer +|`zk_client_port + 1` +|9984 + +|ZK leader election +|`zk_client_port + 2` +|9985 +|=== + +=== Starting a 3-Node Embedded ZK Ensemble + +The ZK connection string must list all nodes' ZK client ports (`solr_port + 1000`), and every node must use `zookeeper_quorum:on`. +All three nodes must be started before the quorum can elect a leader and become operational. + +NOTE: On a single machine, each node needs distinct ports. Because each ZK instance also binds to `zk_client_port+1` (quorum peer) and `zk_client_port+2` (leader election), Solr ports must be spaced *at least 1001 apart* to avoid collisions. + +[source,bash] +---- +export LH="localhost" +ZK="-z $LH:21000,$LH:31000,$LH:41000" +ROLES="-Dsolr.node.roles=data:on,overseer:allowed,zookeeper_quorum:on" + +bin/solr start -p 20000 $ZK $ROLES +bin/solr start -p 30000 $ZK $ROLES +bin/solr start -p 40000 $ZK $ROLES Review Comment: so, we can't do 8983, 8984,8985? That is definitly a conceptual change for all of us. I'm used to zk being 1000 more that my port... -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
