concept SolrCloud in category solr

appears as: SolrCloud
Solr in Action

This is an excerpt from Manning's book Solr in Action.

We’ve touched on Solr’s approach to scalability and fault tolerance in sections 1.2.6 and 1.2.7. As an architect, you’re probably most curious about the limitations of Solr’s approach to scalability and fault tolerance. First, you should realize that the sharding and replication features in Solr have been improved in Solr 4 to be robust and easier to manage. The new approach to scaling is called SolrCloud. Under the covers, SolrCloud uses Apache ZooKeeper to distribute configurations across a cluster of Solr servers and to keep track of cluster state. Here are highlights of the new SolrCloud features:

To illustrate the core concepts in SolrCloud, we use the example of a search engine to power a log aggregation and analytics service called logmill. This fictitious application aggregates log messages from many systems into a centralized search engine to power monitoring, data visualization, and analytics of application activity.

SolrCloud is well suited for this type of problem because it supports near real-time indexing and can scale to handle an immense number of log messages generated by hundreds of applications; many of the queries, such as facets to analyze log metrics, will be complex.

SolrCloud introduces the concept of a collection, which extends the concept of a uniquely named, managed, and configured index to one that is split into shards and distributed across multiple servers. The reason SolrCloud needs a new term is because each shard of a distributed index is hosted in a Solr core, as depicted in figure 13.3.

Figure 13.3. A diagram illustrating the logmill collection being distributed into two shards on two separate nodes

When talking about SolrCloud, it helps to no longer think in terms of cores, but rather to think of shards, which are mutually exclusive slices of an index. The fact that a shard is backed by a Solr core is simply an implementation detail. Consequently, we won’t use the term core in this chapter unless it is to draw reference back to non-SolrCloud behavior.

Just as a single Solr server can host multiple cores, a SolrCloud cluster can host multiple collections. If you need to represent documents with different schemas, you will use multiple collections in SolrCloud as you would use multiple cores in a single server setup. Now that we have a basic understanding of collections, let’s learn about ZooKeeper, which is a critical component in the SolrCloud architecture.

In SolrCloud, an index split across multiple nodes is called a collection. Up to this point, you have only worked with Solr cores (a single index on one node) and have not encountered the concept of a Solr collection. We’ll dig deeper into the details of a collection in section 13.2.1. For now, think of a collection as an index split across multiple Solr nodes. For our example application, we’ll call the collection logmill.

SolrCloud also depends on a distributed coordination service called Apache ZooKeeper, which we will cover in section 13.2.2. For now, it’s easiest to think of ZooKeeper as an abstract service that manages cluster state and distributes configuration files to nodes joining the cluster. To keep things simple, we’ll run ZooKeeper embedded in the same Java process as Solr.