Splunk search head cluster setup

From chambear2809/splunk-cisco-skills · View interactive version

Splunk search head cluster setup is an AI agent skill from the GitHub repository chambear2809/splunk-cisco-skills. Use when the user asks to bootstrap an SHC, push a deployer bundle, perform a searchable rolling restart, transfer the captain, add or remove a member, troubleshoot KV Store replication lag, migrate a standalone search head to SHC, or replace a deployer. Render, preflight, apply, validate, and opera

How to use this skill

Skill file

Splunk Search Head Cluster Setup

Before upgrading a cluster to Enterprise 10.6, follow the coordinated SHC

procedure and verify stable captain, healthy membership, parallel KV Store

backup, and authenticated KV Store status. The PostgreSQL sidecar migration can

make KV Store read-only for an extended period; coordinate the maintenance

window across the full cluster.

Prerequisites

| Tool or access | Purpose | Verify |

|---|---|---|

| Bash and Python 3 | Run bundled setup and validation helpers | bash --version && python3 --version |

| Required product/platform access | Inspect or configure the selected target | Complete the documented preflight |

| Credential files for live modes | Keep secrets out of chat | Verify paths only |

Workflow Overview

┌───────────┐   ┌───────────────┐   ┌───────────────┐   ┌─────────────────┐
│ Preflight │ → │ Render/review │ → │ Apply/handoff │ → │ Validate evidence │
└───────────┘   └───────────────┘   └───────────────┘   └─────────────────┘

When to Activate

remove a member, troubleshoot KV Store replication lag, migrate a standalone search head to SHC, or replace a

deployer.

Scope

Follow the documented read-only or render-first path whenever it is available.

This skill does not imply permission to mutate live systems. Require explicit

apply flags, protected credentials, and operator review for state changes.

Examples

Inspect the supported setup modes before selecting one:

bash skills/splunk-search-head-cluster-setup/scripts/setup.sh --help

Expected output: usage, supported modes, and required arguments are displayed

without changing the target environment.

Inspect validation modes before running completion checks:

bash skills/splunk-search-head-cluster-setup/scripts/validate.sh --help

Expected output: offline, live, and completion options are displayed when the

skill supports them; help exits without mutation.

Troubleshooting

| Issue | Cause | Resolution |

|---|---|---|

| Preflight fails | A required tool or access path is missing | Resolve it before rendering or applying |

| Rendered assets are incomplete | Required non-secret inputs are absent | Complete intake and render again |

| Apply is blocked | Review, credentials, or explicit acceptance is missing | Use the documented handoff |

| Validation is incomplete | Live evidence is unavailable | Record the gap and keep completion open |

This skill sits above

CODE0,

which still owns per-host Splunk Enterprise install and upgrade. This skill

owns multi-host SHC orchestration: the deployer, the member cluster, and the

KV Store replication tier.

Architecture First

deployer is a separate, non-clustered Splunk Enterprise instance. Captain

election is automatic after bootstrap; the operator can transfer the captain

at any time via --phase transfer-captain.

be healthy for full cluster operation. KV Store uses port 8191 and its own

replication_factor (configurable independently of SHC RF).

If you also have an indexer cluster, use

CODE0

for the indexer-side bundle; this skill owns only the SHC deployer bundle.

Agent Behavior — Credentials

Never paste secrets into chat.

member URIs, SHC label, RF, KV Store RF, ES placement toggle).

bash skills/shared/scripts/write_secret_file.sh /tmp/splunk_admin_password
bash skills/shared/scripts/write_secret_file.sh /tmp/splunk_shc_secret

The SHC pass4SymmKey ($SHC_SECRET) is distinct from the indexer cluster

$IDXC_SECRET and the license manager pass4SymmKey.

Quick Start

Bootstrap a 3-member SHC (deployer + 3 members):

bash skills/splunk-search-head-cluster-setup/scripts/setup.sh \
  --phase render \
  --shc-label prod_shc \
  --deployer-host deployer01.example.com \
  --member-hosts sh01.example.com,sh02.example.com,sh03.example.com \
  --replication-factor 3 \
  --kvstore-replication-factor 3

Push the deployer bundle (validates, then applies):

bash skills/splunk-search-head-cluster-setup/scripts/setup.sh \
  --phase bundle-apply \
  --deployer-host deployer01.example.com \
  --admin-password-file /tmp/splunk_admin_password

Bundle CLI helpers require a pre-existing local splunk login session for the

Splunk OS user on the deployer. They never expand an admin password into

-auth.

Searchable rolling restart with health-check loop:

bash skills/splunk-search-head-cluster-setup/scripts/setup.sh \
  --phase rolling-restart \
  --rolling-restart-mode searchable \
  --captain-uri https://sh01.example.com:8089 \
  --deployer-host deployer01.example.com \
  --admin-password-file /tmp/splunk_admin_password

Transfer the SHC captain:

bash skills/splunk-search-head-cluster-setup/scripts/setup.sh \
  --phase transfer-captain \
  --captain-uri https://sh01.example.com:8089 \
  --target-captain-uri https://sh02.example.com:8089 \
  --admin-password-file /tmp/splunk_admin_password

Add a new member to an existing SHC:

bash skills/splunk-search-head-cluster-setup/scripts/setup.sh \
  --phase add-member \
  --deployer-host deployer01.example.com \
  --new-member-host sh04.example.com \
  --shc-secret-file /tmp/splunk_shc_secret \
  --admin-password-file /tmp/splunk_admin_password

Decommission a member from the SHC:

bash skills/splunk-search-head-cluster-setup/scripts/setup.sh \
  --phase decommission-member \
  --captain-uri https://sh01.example.com:8089 \
  --member-guid '<guid-from-shcluster-members>' \
  --admin-password-file /tmp/splunk_admin_password

Check KV Store replication status:

bash skills/splunk-search-head-cluster-setup/scripts/setup.sh \
  --phase kvstore-status \
  --captain-uri https://sh01.example.com:8089 \
  --admin-password-file /tmp/splunk_admin_password

Migrate a standalone search head to SHC:

bash skills/splunk-search-head-cluster-setup/scripts/setup.sh \
  --phase migrate-standalone-to-shc \
  --existing-sh-host sh01.example.com \
  --deployer-host deployer01.example.com \
  --additional-member-hosts sh02.example.com,sh03.example.com \
  --shc-label prod_shc \
  --shc-secret-file /tmp/splunk_shc_secret \
  --admin-password-file /tmp/splunk_admin_password

What It Renders

Under splunk-search-head-cluster-rendered/shc/:

disabled=false, conf_deploy_fetch_url pointing to self, and

pass4SymmKey = $SHC_SECRET.

conf_deploy_fetch_url, shcluster_label, replication_factor,

pass4SymmKey = $SHC_SECRET; and [kvstore] with disabled=false,

replication_factor.

member init shcluster-config (parallel, one per member) →

bootstrap-shcluster-captain on designated first captain →

quorum-wait loop.

merge_server_conf_sections.py helper — apply a protected reviewed member

role fragment atomically to etc/system/local/server.conf; membership

sections must not live in an app a later deployer bundle can remove.

force-searchable.sh, transfer-captain.sh}`.

captain crash loop.

check, KV Store quorum check, bundle generation drift check.

Splunk version skew, KV Store quorum, deployer reachability).

Phases

| Phase | Purpose |

|-------|---------|

| render | Produce all config and script assets; no live changes. |

| preflight | Check quorum math, version skew, deployer reachability. |

| bootstrap | Fail-closed CLI handoff for member initialization and captain bootstrap; secrets are never placed in CLI/SSH argv. |

| bundle-validate | splunk validate shcluster-bundle on deployer. |

| bundle-status | Show per-member bundle generation and SHA. |

| bundle-apply | Validate then apply shcluster-bundle; rolling by default. |

| bundle-apply-skip-validation | Bypass bundle validator (requires --accept-skip-validation). |

| bundle-rollback | Restore previous bundle from $SPLUNK_HOME/etc/shcluster-deploy-apps/. |

| rolling-restart | Restart members one at a time while maintaining search capability. |

| transfer-captain | splunk transfer shcluster-captain -mgmt_uri <target> (CLI; no REST endpoint exists). |

| add-member | Fail-closed CLI handoff for a non-disruptive join; the admin password and pass4SymmKey remain interactive/file-managed. |

| decommission-member | Graceful decommission → GracefulShutdown. |

| remove-member | Administrative removal after decommission. |

| kvstore-status | splunk show kvstore-status + lag assessment on all members. |

| kvstore-reset | splunk kvstore reset-status on a stalled member (requires --accept-kvstore-reset). |

| replace-deployer | Migrate the cluster to a new deployer instance. |

| migrate-standalone-to-shc | Convert a running standalone SH into an SHC member. |

| status | splunk show shcluster-status --verbose formatted snapshot. |

| validate | Static + (with --live) live REST health check. |

Configuration Deep-dive

server.conf [shclustering] (per-member):

[shclustering]
disabled = false
conf_deploy_fetch_url = https://deployer01.example.com:8089
shcluster_label = prod_shc
replication_factor = 3
pass4SymmKey = $SHC_SECRET
heartbeat_timeout = 60
heartbeat_period = 5
restart_inactivity_timeout = 600

server.conf [kvstore] (per-member):

[kvstore]
disabled = false
replication_factor = 3
port = 8191

Deployer server.conf [shclustering]:

[shclustering]
disabled = false
pass4SymmKey = $SHC_SECRET
shcluster_label = prod_shc

The deployer does NOT set conf_deploy_fetch_url pointing to itself — members

do. The deployer hosts $SPLUNK_HOME/etc/shcluster/apps/ for the bundle.

Bundle Mechanics

deployer (NOT etc/manager-apps/ — that is the indexer cluster pattern).

etc/system/local/server.conf; do not place it under an app managed by the

deployer bundle.

deployer and are NOT pushed to members via the bundle.

Never use it without explicit operator request.

app.conf [triggers] requires a restart.

bundle apply. The preflight check parses /services/server/info on each

member and fails if any version differs.

KV Store Replication

Store writes; searches continue but Knowledge Object saves fail.

state on a specific member and forces a full re-sync. Use only when lag is

stuck and will not self-recover. Requires --accept-kvstore-reset.

Rolling Restart Modes

| Mode | Flag | Search during restart |

|------|------|-----------------------|

| Default | --rolling-restart-mode default | Brief outage per member |

| Searchable | --rolling-restart-mode searchable | Searches remain available via other members |

| Forced searchable | --rolling-restart-mode forced | Searchable + skips inactivity timeout check |

Searchable mode: transfers captain before first member restart; each member

waits for captain ACK before proceeding; restart_inactivity_timeout is the

ceiling. For large clusters or slow restarts, tune this value and consider

--rolling-restart-mode forced with explicit acceptance.

Quorum Math

| Members | Quorum (N/2+1) | Tolerated failures |

|---------|---------------|-------------------|

| 3 | 2 | 1 |

| 5 | 3 | 2 |

| 7 | 4 | 3 |

The preflight check enforces quorum before any destructive operation

(bundle-apply, rolling-restart, decommission-member).

ES-on-SHC Placement

etc/shcluster/apps/ for bundle distribution.

lookups.

bundle path for the

CODE0

skill.

Failure Mode Runbooks

See runbook-failure-modes.md in the rendered tree. Summary:

steps down on heartbeat recovery or via transfer-shcluster-captain.

use --accept-skip-validation only if the bundle validator is the blocker.

investigating and restarting the problematic member.

Hand-off Contracts

CODE0

before this skill runs.

CODE0.

CODE0.

CODE0.

CODE0.

CODE0.

Out of Scope

pass4SymmKey = $SHC_SECRET for operator-managed secret rotation. Rolling

the secret cluster-wide requires a rolling restart with the new value; this

skill does not orchestrate that rotation.

Splunk Enterprise only.

CODE0.

CODE0.

References

trigger classification, KV Store shard model, and rolling restart health-check

details.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.