concept server in category solr

appears as: server, servers, server, servers
Solr in Action

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

Figure 1.4. A screenshot of the Solr 4 administration console, in which you can send test queries, ping the server, view configuration settings, and see how your shards and replicas are distributed in a cluster.

In Solr, ZooKeeper is responsible for assigning shard leaders and replicas and keeping track of which servers are available to service requests. SolrCloud bundles ZooKeeper, so you don’t need to do any additional configuration or setup to get started with SolrCloud. We’ll dig into the details of SolrCloud in chapter 13.

Listing 3.3. A failed distributed search (RemoteServer down)
<response>
    <lst name="responseHeader">
        <int name="status">500</int>
        <int name="QTime">1076</int>
        <lst name="params">
            <str name="shards">
                box1:8983/solr/core1,
                box2:8983/solr/core2
            </str>
        </lst>
    </lst>
    <lst name="error">
        <str name="msg">
            org.apache.solr.client.solrj.SolrServerException: IOException
            occurred when talking to server at: http://box2:8983/solr/core2
        </str>
        <str name="trace">...</str>
        <int name="code">500</int>
    </lst>
</response>

If you have a distributed Solr cluster containing shards and/or replicas, you will want a way to balance traffic between each of the servers in your cluster. If you are fortunate enough to work for a company with a hardware load balancer, you probably already know how to set up a virtual IP address into which you can put each of your Solr servers, or you know someone within your company who does. If you are using Amazon EC2 instances in the cloud, you can use Amazon’s Elastic Load Balancer to set up load balancing in a similar way. If you are running a smaller operation, you may consider installing HAProxy for use as a load balancer. Regardless of which solution you use, you will want some kind of “health check” option—something the load balancer can check on the server to determine whether the server is healthy and should be in service or is in a failed state and should be removed.

12.7. Managing clusters of servers

As you move beyond a single Solr instance, managing your Solr cluster becomes much more complicated. If you have a sharded search environment, taking one server down can actually cause searches to fail on other servers that are trying to execute a distributed search using the server you took down. Likewise, if one or more of your replicas starts having an application-affecting problem, you need some way to identify which servers are healthy enough to remain in your production load balancer. Additionally, as you begin adding more and more servers, you may notice that the complexity of managing unique configurations for every server (solrconfig.xml, schema.xml, etc.) becomes a maintenance headache. This section will discuss tricks that can help with these problems.