What's Actually Happening

Solr collection is unavailable or showing errors. Queries and indexing fail.

The Error You'll See

```bash $ curl http://localhost:8983/solr/mycollection/select?q=*:*

Error: Could not find a healthy node to handle the request ```

Why This Happens

  1. 1.Zookeeper disconnected - Cannot find cluster state
  2. 2.No shard leader - Leader election failed
  3. 3.All replicas down - No serving nodes
  4. 4.Schema error - Invalid schema configuration

Step 1: Check Cluster Status

```bash # Check collection status: curl http://localhost:8983/solr/admin/collections?action=CLUSTERSTATUS

# Check shard leaders: curl http://localhost:8983/solr/admin/collections?action=CLUSTERSTATUS | jq '.cluster.collections.mycollection.shards' ```

Step 2: Check Zookeeper

```bash # Check ZK connection: bin/solr zk ls / -z localhost:2181

# Check cluster state: bin/solr zk get /clusterstate.json -z localhost:2181 ```

Step 3: Elect Leader

bash
# Force leader election:
curl http://localhost:8983/solr/admin/collections?action=FORCELEADER&collection=mycollection&shard=shard1

Step 4: Add Replica

bash
# Add replica:
curl http://localhost:8983/solr/admin/collections?action=ADDREPLICA&collection=mycollection&shard=shard1&node=localhost:8983_

Solr Collection Checklist

CheckCommandExpected
Cluster statusCLUSTERSTATUSActive
LeadersstatusElected
ReplicasstatusActive

Verify the Fix

bash
curl http://localhost:8983/solr/mycollection/select?q=*:*
# Output: Search results returned
  • [Fix Elasticsearch Cluster Red Status](/articles/fix-elasticsearch-cluster-red-status)
  • [Fix Zookeeper Session Expired](/articles/fix-zookeeper-session-expired)