Distributed search in Splunk allows large-scale deployments by separating the roles of searching and indexing across multiple components. This guide explains the core components, configuration steps, and optimization tips for setting up and managing a distributed Splunk environment.
A distributed environment comprises three primary components, each with specific roles in the search and indexing process.
Overview:
Responsibilities:
Use Case:
Overview:
Key Features:
Replication Factor (RF):
Search Factor (SF):
Overview:
Key Features:
To establish communication between the Search Head and Indexers, use the distsearch.conf file.
Locate distsearch.conf:
$SPLUNK_HOME/etc/system/local/distsearch.conf.Define Indexers:
Example configuration:
[distributedSearch]
servers = <indexer1_ip>:8089, <indexer2_ip>:8089
Replace <indexer1_ip> and <indexer2_ip> with the actual IPs of the Indexers.
Restart Splunk:
Apply the changes:
./splunk restart
Verify Search Peers:
Replication ensures high availability and data redundancy in Indexer Clusters.
Edit server.conf on Indexers:
Example configuration:
[clustering]
mode = slave
master_uri = https://<cluster_master_ip>:8089
replication_factor = 2
search_factor = 2
Configure the Cluster Master:
Add this to the Cluster Master’s server.conf:
[clustering]
mode = master
replication_factor = 2
search_factor = 2
Restart the Cluster Master:
./splunk restart
Add Indexers to the Cluster:
Ensure Indexers are connected to the Cluster Master:
./splunk add cluster-master https://<cluster_master_ip>:8089
Verify Cluster Status:
On the Cluster Master, check the status:
./splunk show cluster-status
Search Head pooling allows multiple Search Heads to share user-generated objects like dashboards and alerts, reducing resource duplication.
server.conf on each Search Head to point to the shared storage.Purpose:
Steps:
Configure limits.conf:
Example:
[search]
max_searches_per_cpu = 2
Restart Splunk for changes to take effect:
./splunk restar
A company experiences increased search demands, leading to slow query responses. They decide to scale the Search Head capacity using a Search Head Cluster.
Set Up a Search Head Cluster:
Configure server.conf for the Cluster:
On each Search Head, add:
[shclustering]
mode = member
mgmt_uri = https://<search_head_ip>:8089
replication_port = 8080
pass4SymmKey = <shared_key>
Designate a Deployer:
On the Deployer, configure server.conf:
[shclustering]
mode = deployer
pass4SymmKey = <shared_key>
Push Configuration from the Deployer:
Deploy updated configurations to Search Heads:
./splunk apply shcluster-bundle -target https://<search_head_ip>:8089
Verify Cluster Status:
On any Search Head:
./splunk show shcluster-status
An organization wants to ensure data is always available, even if one Indexer fails.
Deploy an Indexer Cluster:
Set Replication and Search Factors:
22Monitor Cluster Health:
Use the Cluster Master to check cluster status:
./splunk show cluster-status
Simulate Failover:
A company needs to restrict access to specific indexes for different departments while maintaining centralized search capability.
Define Roles and Index Access:
it_logs.finance_logs.Map Search Heads to Indexers:
distsearch.conf to connect Search Heads to relevant Indexers.Apply Search Filters:
Define search filters in roles.conf:
[role_it]
srchFilter = index=it_logs
[role_finance]
srchFilter = index=finance_logs
Test Permissions:
Goal: Configure a Search Head to query data from two Indexers.
Edit distsearch.conf:
[distributedSearch]
servers = 192.168.1.10:8089, 192.168.1.11:8089
Restart the Search Head:
./splunk restart
Verify Search Peer Connectivity:
Run a Query:
Execute a search that spans both Indexers:
index=* | stats count by index
Goal: Use the Cluster Master to monitor an Indexer Cluster’s status.
Connect to the Cluster Master:
Use the CLI on the Cluster Master to check status:
./splunk show cluster-status
Check Replication:
Verify that all buckets have sufficient replication:
./splunk show cluster-status | grep -i replication
Inspect Peer Status:
Goal: Enable parallel processing for large queries.
Edit limits.conf:
[search]
max_searches_per_cpu = 2
Restart the Search Head:
./splunk restart
Run a Complex Query:
Test performance with a large dataset:
index=main | stats count by host
Monitor Resource Usage:
Cause:
distsearch.conf.Solution:
Verify the distsearch.conf configuration:
splunk cmd btool distsearch list --debug
Ensure the Indexers are reachable on port 8089.
Cause:
Solution:
Check Indexer logs for errors:
index=_internal source=*splunkd.log cluster
Ensure enough disk space is available on all Indexers.
Cause:
Solution:
Optimize SPL queries by avoiding wildcards:
index=main sourcetype=syslog | stats count by host
Enable parallel search processing in limits.conf.
Use Load Balancing for Indexers:
Monitor Search Performance Regularly:
Plan Replication Factors:
Test Failover Scenarios:
Distributed Search enables Splunk to scale horizontally by separating search functions from indexing, facilitating powerful parallel searches across multiple indexers. Below are additional advanced areas often overlooked in initial study but critical for both production deployments and exam success.
When configuring distributed search, a Search Head (SH) must be able to authenticate and securely communicate with one or more Indexers (Search Peers).
Communication between SH and Indexers happens over management port 8089 (HTTPS).
Authentication is required during peer registration, particularly in SSL-enabled environments.
If SSL is enabled on the Indexer, the Search Head must trust the Indexer’s certificate.
You can do this by:
Importing the Indexer’s certificate into the SH’s trust store.
Or (not recommended), disable certificate validation via configuration.
splunk add search-server https://<indexer_ip>:8089 -auth admin:changeme
This command allows the SH to register the Indexer as a search peer using the provided credentials.
The Deployer in a Search Head Cluster (SHC) plays a crucial role in managing configurations across all SHC members but has strict limitations.
Distributes configuration bundles (e.g., apps, lookups, dashboards) to all SHC members.
Uses splunk apply shcluster-bundle to push updates.
The Deployer is not part of the cluster.
It does not run searches, index data, or serve end users.
It is used only for configuration distribution.
Keep the Deployer separate from production SHCs.
Always test bundles before deployment to avoid cluster instability.
Licensing must be managed cohesively across all components of a distributed Splunk deployment.
All Search Heads and Indexers must be covered under the same license (license pool).
Typically, a centralized License Master is used to manage licenses across multiple sites or tiers.
For deployments that span multiple data centers or regions:
Use License Pooling to segment usage.
Use Forwarder-based data routing to ensure license usage is traceable per site.
splunk list licenser-pools.While not directly part of distributed search, Forwarder acknowledgment (ACK) is highly relevant in Indexer Clustering where data integrity is crucial.
When enabled, the Universal Forwarder (UF) waits for acknowledgment from the receiving Indexer before sending the next data block.
Ensures data durability by confirming that events have been successfully indexed.
[general]
ack = true
Forwarder waits for Primary Bucket to receive and replicate data successfully (as per replication factor).
Helps avoid data loss in high-availability environments.
Multisite clustering is used to provide geographic redundancy and disaster recovery capabilities across data centers or cloud regions.
Ensures that copies of data exist in multiple locations.
Maintains availability in the event of a site failure.
server.conf:[clustering]
multisite = true
site = site1
available_sites = site1,site2
site_replication_factor = origin:2,total:3
site_search_factor = origin:1,total:2
origin: the site where data is initially indexed.
total: total number of replicated copies across all sites.
Example: Store 2 copies in origin site, 1 in remote site.
| Area | Recommendation |
|---|---|
| Search Head to Indexer Auth | Use secure certificates; avoid disabling SSL verification. |
| Deployer | Use only for config distribution, never as a production search node. |
| Licensing | Ensure all nodes are managed under a shared License Master. |
| Forwarder ACK | Enable ack = true for reliable delivery, especially in clustered environments. |
| Multisite Clustering | Use for geo-redundancy; configure replication/search factors properly. |
In a Splunk distributed search architecture, which component dispatches search queries to other instances that contain indexed data?
The search head dispatches search queries to search peers (typically indexers).
In distributed search, the search head acts as the coordinator for user queries. When a user runs a search, the search head distributes the search request to configured search peers, which usually contain indexed data. These peers execute the search locally on their data and return partial results to the search head. The search head then merges, sorts, and presents the combined results to the user interface. A common misunderstanding is assuming that forwarders or indexers initiate searches. In reality, forwarders only send data to indexers, while indexers store data and respond to queries issued by the search head. This architecture allows searches to scale across multiple indexers while keeping query management centralized.
Demand Score: 90
Exam Relevance Score: 94
What is the primary role of a search peer in a Splunk distributed search environment?
A search peer responds to search requests from the search head by executing searches on its indexed data.
A search peer is typically an indexer that stores indexed data and participates in distributed searches. When the search head sends a query, the search peer runs the search locally against its stored events. It then returns the results back to the search head for aggregation. Although indexers commonly serve as search peers, other Splunk instances with searchable data (such as monitoring consoles) can also function as search peers in some contexts. A common mistake is confusing search peers with forwarders. Forwarders only send raw data to indexers and do not store searchable indexes, so they cannot respond to distributed search queries.
Demand Score: 86
Exam Relevance Score: 92
Which configuration file can be edited to manually define search peers in a Splunk distributed search deployment?
distsearch.conf
The distsearch.conf configuration file defines distributed search settings on the search head. Administrators can manually add search peers by specifying them in the servers setting within the [distributedSearch] stanza. Each peer is listed as a URI including protocol, hostname, and management port. After modifying the configuration file, the search head must be restarted for the changes to take effect. When peers are added manually through configuration files instead of Splunk Web or CLI commands, administrators must also distribute authentication key files (such as trusted.pem) to the peers to establish trust. Failing to distribute these keys often leads to authentication failures when the search head attempts to communicate with peers.
Demand Score: 88
Exam Relevance Score: 90
What configuration setting inside distsearch.conf defines the list of search peers?
The servers setting under the [distributedSearch] stanza.
Within the distsearch.conf file, the [distributedSearch] stanza controls how the search head interacts with search peers. The servers parameter specifies a comma-separated list of search peers using their management endpoints. Each entry must include the URI scheme (http or https), hostname or IP address, and the management port (usually 8089). When this configuration is applied, the search head distributes search requests to the listed peers. Administrators must ensure the peer instances are reachable and properly authenticated. Incorrect URIs, missing schemes, or wrong ports can prevent the distributed search connection from functioning correctly.
Demand Score: 82
Exam Relevance Score: 89
What prerequisite must be satisfied before an indexer can function as a search peer?
The indexer must have its default password changed so the search head can authenticate.
Before a search head can connect to an indexer as a search peer, the indexer must have valid credentials configured. Splunk does not allow authentication using default credentials for distributed search connections. This requirement ensures that administrative access between the search head and peer is secured. When configuring peers through Splunk Web or the CLI, the administrator must provide both local authentication credentials and remote credentials for the peer instance. If this prerequisite is not met, the search head will fail to establish the distributed search connection even if the peer address is correctly configured.
Demand Score: 75
Exam Relevance Score: 87
Why must the trusted.pem file sometimes be manually copied to search peers when configuring distributed search through configuration files?
Because manual configuration does not automatically distribute authentication keys between the search head and peers.
When search peers are added using Splunk Web or the CLI, Splunk automatically handles authentication by distributing required keys. However, when administrators configure distributed search manually by editing distsearch.conf, this automation does not occur. In such cases, the search head’s public key (trusted.pem) must be manually copied to the appropriate directory on each search peer. This key enables the peer to trust and authenticate search requests from the search head. Without the correct key distribution, authentication failures occur even though the peer appears correctly configured in the distributed search settings.
Demand Score: 74
Exam Relevance Score: 88