SearchHead Clustering Flashcards
Which command does initiate a SHC on a SH?
./splunk edit shcluster-config -mgmt_uri https://sh02:8089 -replication_port 9777 -replication_factor 3 -secret mysecret
What do you configure in the shclustering stanza for the mgmt_uri attribute?
The mgmt uri of the instance itself (FQDN)
How do you configure a search peer to use a deployer?
./splunk edit shcluster-config -conf_deploy_fetch_url https://dep01:8089
Is it requiered to set a deployer in the init configuration?
No, it is not requiered, but to use the deployer feature fully, a deployer needs to be set
What is cluster label?
A cluster label is a tag or identifier to recognize the cluster in the MC. It should be set.
./splunk edit shcluster-config -shcluster_label SH_Cluster_Berlin
After all the instances are properly initialized, a captain needs to be set. How do you do that?
./splunk bootstrap shcluster-captain -servers_list “https://sh1.example.com:8089,https://sh2.example.com:8089,https://sh3.example.com:8089,https://sh4.example.com:8089” -auth admin:changed
NOTE: The server name in the servers_list must match the mgmt_uri which we defined on each instance during the initial setup
What is the role of a captain in a SHC?
A captian is similar to what the CM in an indexer cluster does.
The captain orchestrates the SHC, which means replication of search artifacts, runtime changes, job scheduling, load management, proxy for adhoc and RT searches, alert management, deletation of search artefacts etc.
The captain also makes sure to meet the replication policy.
The replication happens every 5s through the configuration bundle.
What is the secret behind the captain election?
The election is a simple process to make sure that there is always a ‘responsible manager’ of the SHC (fault tolerance system).
The process is based on an algorithm called RAFT. RAFT is a common algorithm used in many cluster technologies.
Every node starts up as a ‘follower’. Followers receive an RPC call (aka heartbeat) from the leader (the captain). Captains are elected for a set ‘term’ or period, which is monotonically increasing. The captain communicates with its follower nodes, and will monitor its term as captaincy. When the term expires it will offer itself for re-election. A node remains a follower until it stops receiving a leader heartbeat call. Once a term ends, the leader reverts to follower thus meaning that all the nodes stop receiving the leader heartbeat. *Alternatively the leader may fail to communicate prior to the term expiring, which will also result in the nodes no longer receiving a heartbeat. When a node stops receiving the heartbeat from the leader it will go into a state of candidacy for leadership. It will call out to the other nodes and request to be voted the leader. If you’re thinking ‘but that will cause split votes’ you’re correct! To deal with this raft introduces some arbitrary jitter into the nodes candidacy requests so they don’t all run at the same time. See the whitepaper for exact details. The other nodes respond to the election request and confirm election. Election is assigned once a node receives enough votes to achieve quorum. Quorum is set as >51%. So, in a 5 node SHC, 3 members needs to be fully working and able to vote.
What is a short and brief description of what the deployer does?
The deployer is a deployment server dedicated for all searchheads in a SHC. It provides basic features to provide to all searcheads in SHC a basline configuration for apps and user configuration.
What is the default push mode which the deployer uses to push out its baseline configuration the searchheads?
merge_to_default
Merges per default the default/local configs into the default directory on the SHC members (can be changed)
If app changes happen on the deployer, how many tarballs will be pushed out maximum based on the merge_to_default setting?
1 tarball:
- The deployer merges /local and /default into /default and pushes one tarball to the peers
The amount of tarballs changes based on the push mode.
What is the recommended setting for the deployer for built-in apps like the search app?
local_only
How can the push mode set?
The push mode can be set globally in [shclustering] stanza on the deployer or it can be set for each app
How do you set the push mode on an app level?
By creating a shclustering stanza in app.conf
How do you prevent an app from being pushed out to the searchheads in a SHC?
By deleting the app from the configuration bundle directory, which lives under /etc/shcluster/apps.
The deletation does not work if the app state is set to disabled in the app.conf, even if you delete the app on the deployer. State needs to be set to enabled before the app can be deleted.