8.4 Search Head Scaling & Search Head Clustering (SHC)
Key Takeaways
- Search head scaling options are a single search head, multiple independent search heads, or a search head cluster (SHC), which Splunk recommends when you need several search heads.
- An SHC needs at least three members plus a separate deployer; one member is dynamically elected captain through a Raft-based election that needs a majority of members.
- The captain schedules saved searches across members, coordinates replication of search artifacts (replication_factor defaults to 3), and replicates runtime knowledge-object changes.
- Apps and baseline configuration are staged on the deployer in $SPLUNK_HOME/etc/shcluster/apps and pushed with splunk apply shcluster-bundle -target <member URI>.
- Static captain (election = false) is a disaster-recovery override for when a majority of members is lost; members can be excluded from scheduled jobs with adhoc_searchhead or captain_is_adhoc_searchhead.
Search Head Scaling & Search Head Clustering (SHC)
As user adoption and analytical workloads expand across an enterprise, a single Search Head inevitably encounters resource constraints. Maximum concurrent search capacity is bound to physical CPU cores, and an unexpected hardware outage or operating system restart halts dashboard access and scheduled alerting. To eliminate single points of failure and scale search throughput horizontally, Splunk provides Search Head Clustering (SHC).
An SHC coordinates a pool of search heads that share search workloads, synchronize configurations, replicate search artifacts, and orchestrate scheduled reports without human intervention. Mastering the underlying architecture, consensus mechanisms, and administrative workflows of Search Head Clusters is an advanced competency for Splunk administrators.
Search Tier Scaling Models: Standalone vs. Clustered
Enterprise architectures evaluate three distinct operational models for the search tier:
1. SINGLE SEARCH HEAD (Lab / Dev)
[Users] --> [Single Search Head] --> [Indexers]
* Single Point of Failure (SPOF)
* Strict Concurrency Ceiling
2. MULTIPLE INDEPENDENT SEARCH HEADS (Departmental)
[SecOps Users] --> [Search Head A] --\
--> [Shared Indexers]
[NetOps Users] --> [Search Head B] --/
* Siloed Knowledge Objects (Saved searches on A do not exist on B)
* Duplicate Alert Executions
* Operational Divergence
3. SEARCH HEAD CLUSTER (Enterprise Production)
+----------------------+
| Load Balancer (ADC) |
+----------------------+
/ | \
v v v
+-----+ +-----+ +-----+
| SH1 | | SH2 | | SH3 | (Min 3 Members)
+-----+ +-----+ +-----+
\ | /
Raft Consensus & Replicated Artifacts
\ | /
v v v
+----------------------+
| Shared Indexers |
+----------------------+
Model Comparison
| Operational Feature | Single Standalone SH | Multiple Independent SHs | Search Head Cluster (SHC) |
|---|---|---|---|
| Minimum Host Count | 1 host | 2+ hosts | 3 members + 1 Deployer |
| High Availability (HA) | None (Host failure halts all search) | Partial (Users can log in to remaining SH) | Full (Zero user downtime via load balancing) |
| Knowledge Synchronization | N/A | None (manual copy or divergent objects) | Automatic: runtime changes are replicated through the captain |
| Scheduled Search Handling | Runs all local alerts | Duplicates alerts if configured on both nodes | Coordinated by Captain; zero duplicates |
| User Experience | Single endpoint | Users must choose distinct URLs | Single virtual URL via Load Balancer (VIP) |
| App Deployment Method | Manual or Deployment Server | Deployment Server | Dedicated SHC Deployer (shcluster/apps) |
Architecture of a Search Head Cluster
A Search Head Cluster consists of multiple interconnected components operating under explicit architectural rules:
1. The 3-Member Minimum Requirement
An SHC requires a minimum of three Search Head members. A two-member cluster is strictly unsupported in production because two nodes cannot achieve a majority quorum in the event of a single node failure or network partition.
2. The Dynamic Captain
At any given time, exactly one member in the cluster functions as the Search Head Captain. The captain is elected dynamically by the members through a Raft-based election. The Captain's responsibilities include:
- Scheduling Coordination: Managing the cluster-wide scheduler and assigning scheduled searches and alerts across members based on current node resource utilization.
- Search Artifact Synchronization: Orchestrating the replication of search artifacts across members to meet the cluster's configured
replication_factor. - Knowledge Object Replication: Coordinating changes to runtime knowledge objects (dashboards, alerts, lookups, field extractions) across all cluster members.
- Cluster State Tracking: Monitoring member heartbeats and health metrics.
[!IMPORTANT] The Captain does not sit idle waiting to schedule jobs; it functions as a fully capable search head that also serves user queries and executes searches.
3. Cluster Members
All other search heads in the cluster function as Members. Members:
- Authenticate users and serve Splunk Web sessions distributed by an upstream load balancer.
- Execute ad-hoc searches initiated by users.
- Execute scheduled searches assigned to them by the Captain.
- Replicate search artifacts and knowledge object modifications to peer members.
- Participate in Raft elections whenever the Captain becomes unreachable.
4. The Deployer Role
The Deployer is a specialized, non-clustered Splunk Enterprise instance dedicated to distributing apps, configuration baselines, and Technology Add-ons to SHC members.
- Staging Directory: Staged inside
$SPLUNK_HOME/etc/shcluster/apps/. - Crucial Boundary Rule: The deployer must never be a member of the search head cluster it manages. It is a separate Splunk Enterprise instance. Members find it through
conf_deploy_fetch_urlin their[shclustering]stanza. It can share an instance with some other management components, and a deployment server with 50 or fewer clients can host it. - Anti-Pattern Warning: The Deployment Server must never be used to manage Search Head Cluster members. Baseline apps must be deployed exclusively via the Deployer.
Inter-Node Network Ports
| Port | Used for |
|---|---|
| 8000 (Splunk Web) | User sessions, usually through a load balancer in front of the members |
| 8089 (management) | Captain election and cluster control traffic between members, deployer pushes, and search dispatch to indexers |
Replication port (you choose it, e.g. splunk init shcluster-config -replication_port 34567) | Search artifact replication between members |
| 8191 (KV store) | KV store replication between members |
The Raft Consensus Algorithm & Quorum Dynamics
Search Head Clusters rely on the Raft consensus algorithm to elect the Captain and maintain state consistency across members without risk of split-brain corruption.
Calculating Quorum: The Majority Formula
To elect a Captain and perform write operations (such as scheduling searches or modifying knowledge objects), an SHC must achieve Quorum. Quorum represents a strict majority of the total configured cluster members:
Where $N$ is the total number of registered cluster members.
Fault Tolerance by Member Count
| Total Members ($N$) | Calculation | Quorum Required | Maximum Node Failures Tolerated |
|---|---|---|---|
| 3 | $\lfloor 3/2 \rfloor + 1 = 1 + 1$ | 2 | 1 node |
| 4 | $\lfloor 4/2 \rfloor + 1 = 2 + 1$ | 3 | 1 node (No added resilience over 3!) |
| 5 | $\lfloor 5/2 \rfloor + 1 = 2 + 1$ | 3 | 2 nodes |
| 6 | $\lfloor 6/2 \rfloor + 1 = 3 + 1$ | 4 | 2 nodes (No added resilience over 5!) |
| 7 | $\lfloor 7/2 \rfloor + 1 = 3 + 1$ | 4 | 3 nodes |
Why Odd Numbers of Members Are Preferred
The quorum table shows why architects prefer odd numbers of cluster members (3, 5, or 7):
- Adding a 4th member to a 3-member cluster increases hardware, licensing, and network costs, but provides zero additional fault tolerance. Both a 3-member and a 4-member cluster can only survive a single node failure.
- If a 4-member cluster loses 2 nodes, remaining members (2) cannot reach the required quorum of 3, causing the cluster to freeze.
- In contrast, a 5-member cluster withstands 2 simultaneous node failures while maintaining the quorum of 3.
Handling Network Partitions (Split-Brain Prevention)
Consider a 5-member SHC deployed across two physical data centers connected by an inter-site link:
- Data Center East: Contains Member 1, Member 2, Member 3.
- Data Center West: Contains Member 4, Member 5.
If the inter-site fiber link is severed:
- Data Center East (3 nodes): Calculates its active count against $N=5$. It has 3 nodes available, satisfying Quorum ($3 \ge 3$). It retains or elects an active Captain and continues full operations: scheduling searches, modifying dashboards, and servicing users.
- Data Center West (2 nodes): Evaluates its active count (2 nodes). Because $2 < 3$, it fails quorum. The nodes immediately step down to a restricted operational state: they refuse to elect a Captain, halt all scheduled search executions, and reject knowledge object writes.
- Outcome: The cluster completely prevents a "split-brain" catastrophe where both data centers independently schedule duplicate alerts and diverge in state.
Dynamic Captaincy vs. Static Captaincy
- Dynamic Captaincy (Default): Members continuously elect and re-elect the Captain dynamically using Raft. If the active Captain crashes, the remaining quorum members automatically elect a new Captain within seconds.
- Static Captaincy: A disaster-recovery override. When too many members are lost for a majority to exist, an administrator reconfigures the survivors with
election = false(in[shclustering]), making one member a static captain (mode = captain) and pointing the others at it (captain_uri). Searching and scheduling can then resume. Return to dynamic election once the cluster is healthy again. - Captain tuning:
preferred_captain = truemarks the members that should hold captaincy.captain_is_adhoc_searchhead = truestops the captain from running scheduled jobs, andadhoc_searchhead = truedoes the same for a regular member.
Scheduled Search Execution & Search Artifact Replication
One of the greatest operational advantages of an SHC is its ability to scale scheduled reporting and alerting without duplication.
+-------------------------+
| SHC CAPTAIN (MEMBER 1) |
| - Central Scheduler |
| - Tracks Node Load |
+-------------------------+
/ \
Assigns Job 101 / \ Assigns Job 102
(Low CPU Load) / \ (Low CPU Load)
v v
+-------------------+ +-------------------+
| MEMBER 2 | | MEMBER 3 |
| Executes Job 101 | | Executes Job 102 |
+-------------------+ +-------------------+
\ /
\ /
Replicates Search Artifacts (replication_factor = 3)
\ /
v v
+-----------------------------------------+
| DISPATCH DIRECTORY REPLICATION: |
| $SPLUNK_HOME/var/run/splunk/dispatch/ |
+-----------------------------------------+
1. Centralized Scheduled Search Orchestration
In a standalone search head, the local savedsearches.conf scheduler dispatches searches directly. In an SHC, scheduling is centralized exclusively on the Captain:
- The Captain reads the consolidated schedule for all enabled alerts and reports across all apps.
- The Captain monitors the current search concurrency, active search jobs, and CPU load of all members.
- The Captain delegates execution to the least loaded member in the cluster.
- Failover Protection: If a member executing a scheduled alert terminates unexpectedly before finishing, the Captain detects the broken heartbeat, re-claims the job, and re-dispatches it to a healthy member. Alerts are never dropped or silently abandoned.
2. Search Artifact Replication Mechanics
When a member completes a search, the results are written to disk as a search artifact inside $SPLUNK_HOME/var/run/splunk/dispatch/<search_id>/.
- In an SHC, artifacts are replicated between members over the cluster's configured replication port.
- The number of copies maintained is determined by the
replication_factorattribute inserver.conf([shclustering]stanza; default value:3). - Why this matters for users: When users access Splunk Web through a load balancer, subsequent page refreshes or dashboard views may land on different cluster members. Because artifacts are replicated, Member 2 can instantly render the cached dashboard panels generated moments earlier by Member 1 without re-running expensive queries against the indexers.
Deployer Administration & App Lifecycle Management
Because SHC members are ephemeral compute nodes that replicate dynamic runtime configurations, administrative configurations—such as installing Technology Add-ons, creating base apps, or deploying pre-built dashboards—must follow a controlled deployment pipeline via the Deployer.
1. The Staging Repository on the Deployer
On the Deployer host, application packages and configurations destined for cluster members are placed inside:
$SPLUNK_HOME/etc/shcluster/apps/
├── Splunk_TA_windows/
├── Splunk_TA_nix/
├── enterprise_security_app/
└── custom_corporate_dashboards/
2. Pushing App Bundles via the CLI
To deploy the staged applications to the cluster, the administrator executes the apply shcluster-bundle command directly from the Deployer:
splunk apply shcluster-bundle \
-target https://sh01.corp.internal:8089 \
-auth admin:DeployerPassword \
-preserve-lookups true
-target: The URI of any active member of the cluster (standard practice targets the current Captain, though pointing to any member redirects appropriately).-auth: Local administrative credentials on the Deployer authorizing the push.-preserve-lookups true|false: A critical administrative flag. If set totrue, the deployment process ensures that lookup table CSV files modified by users or lookups populated by searches on the cluster members are not overwritten by the static files residing on the Deployer.
3. Deployment Flow and Rolling Restarts
When splunk apply shcluster-bundle executes:
- The Deployer packages
$SPLUNK_HOME/etc/shcluster/apps/into a compressed bundle and transmits it to the target member over TCP 8089. - The Captain coordinates the distribution of the bundle to all active members.
- The Captain inspects the updated configurations. If the changes require a restart (e.g., updates to
server.conf,web.conf, or specific modular inputs), the Captain orchestrates a rolling restart. - During a rolling restart, the Captain instructs members to restart one at a time. The remaining members absorb incoming user traffic from the load balancer, ensuring uninterrupted availability throughout the application upgrade.
A Search Head Cluster consists of 5 members deployed across two data centers. A sudden inter-datacenter fiber cut isolates 2 members in Data Center B from the 3 members in Data Center A. Based on the Raft consensus algorithm, how will the cluster respond?
An administrator needs to deploy a newly developed security operations application to all members of a production Search Head Cluster. Where must the application files be staged on the Deployer, and which command applies the bundle?
In a Search Head Cluster, what is the primary role of the dynamically elected Search Head Captain regarding scheduled search execution?