What is the interaction between Solr and Zookeeper?
Asked Answered
F

1

14

I've been working on a system where they use SolrCloud, which entails a Zookeeper ensemble that helps "manage the overall structure so that both indexing and search requests can be routed properly" (straight out of the Solr documentation).

What exactly is this "management"? What information, what data/configuration/information do the machines running Solr read/write from the Zookeeper ensemble and why? Is the data in Zookeeper ever changed at runtime by solr? Or do you configure "the data" once and runtime is going to be reads all across SolrCloud hosts?

To put the question into perspective, this is my first contact with Zookeeper, Solr, and in many ways with distributed systems.

Farfetched answered 20/9, 2017 at 22:49 Comment(0)
T
22

A Single node Solr instance uses it's own configuration files usually in a conf folder containing files like schema.xml, stopwords.txt etc. But in Solr cloud context a collection is a logical index having group of cores. These group of cores need centralised configurations (same configuration shared among cores belonging to same collection). ZooKeeper is a centralised service for maintaining configuration information in a distributed system.

You can upload, download, and edit configuration files, so that all cores belonging to the same collection get same config set.

You can read more about Solr cloud config management here

Toomey answered 21/9, 2017 at 3:16 Comment(2)
In addition Zookeeper keeps the current state of the cluster for each collection (i.e. which nodes are active and their roles, etc.). If you explore the Zookeeper node, you'll find a state.json for each collection available that you can look at. This is what a cloud aware Solr client uses to send a document directly to the node responsible for it instead of going through a random node.Burbage
I guess we cannot edit configuration files once uploaded. only option is to upload new/updated config files. if yes, pls give some info on how to edit uploaded config files to zookeeper.Cassel

© 2022 - 2024 — McMap. All rights reserved.