官术网_书友最值得收藏!

Search heads

After configuring the licensing and forwarding the internal logs, you can configure a node to be a member of a search head cluster, either by executing a CLI command, or editing the server.conf file directly—there is no provision to make all these settings in Splunk Web. Let's try the CLI command splunk init shcluster-config first, providing all the needed elements in the arguments:

  • auth: The admin-level username and password.
  • mgmt_uri: scheme:ipaddress:port of the node you're configuring.
  • replication_port: A port you've selected for the search heads to replicate knowledge artifacts with each other.
  • replication_factor: The number of searchable copies of data (index files) to be retained on the indexers (default is 2).
  • conf_deploy_fetch_url: The scheme:ipaddress:port of the deployer – this is so that the search head knows who to contact to get updates if it was previously down.
  • secret: The same pass4SymmKey password you configured on the deployer - use this same secret key on all the search heads, too. If you use certain non-text characters in your password, you may need to wrap this entry in single quotes.
  • shcluster_label: The same cluster label you configured in the deployer.
  • Here's what the command looks like fully filled out, with entries for our example deployment:
./splunk init shcluster-config -auth admin:Splunk1t2me -mgmt_uri https://172.31.28.137:8089 -replication_port 8090 -replication_factor 2 -conf_deploy_fetch_url https://172.31.18.102:8089 -secret '!Sp1unkSH!' -shcluster_label DevTestSearchHeads

The preceding command creates the following entries in the /opt/splunk/etc/system/local/
server.conf
 file. Note that the disabled = 0 entry is needed because search head clustering is disabled by default in /opt/splunk/etc/system/default/server.conf:

[replication_port://8090]

[shclustering]
conf_deploy_fetch_url = https://172.31.28.225:8089
mgmt_uri = https://172.31.28.137:8089

pass4SymmKey = $1$q3Fg5DtBkC6yGZA=
replication_factor = 2
disabled = 0
shcluster_label = DevTestSearchHeads

Next, you need to configure the search heads to communicate with the cluster master, and thus join them to the indexing cluster. The cluster master provides a list of the search peers (indexers) to the search heads so that they can contact the active indexers for search requests. Here's the CLI command to run on each search head:

./splunk edit cluster-config -mode searchhead -master_uri https://172.31.18.102:8089 -secret '!Sp1unkCM!'

Note that you're specifying the cluster master's URI, and providing the index cluster secret key. Running this command will add the following entries to the server.conf file:

[clustering]
master_uri = https://172.31.18.102:8089
mode = searchhead
pass4SymmKey = $1$q3Fg5DtBkG23GZA=

You can configure nodes to be a clustered search head by directly editing the server.conf file with the correct entries; sometimes, this is easier if you're sure of the entries to be made. After restarting Splunk on these servers, you will have a search head cluster!

主站蜘蛛池模板: 老河口市| 阿勒泰市| 抚远县| 固始县| 五河县| 太仆寺旗| 阿克苏市| 霞浦县| 彭水| 堆龙德庆县| 隆化县| 桂林市| 青冈县| 遂平县| 石屏县| 肇州县| 竹北市| 临桂县| 修文县| 彭水| 榕江县| 叶城县| 房产| 齐齐哈尔市| 广丰县| 连山| 洪泽县| 罗甸县| 普定县| 韩城市| 台湾省| 岗巴县| 钟山县| 龙山县| 许昌市| 奉贤区| 舒兰市| 拜城县| 贞丰县| 五华县| 托克托县|