<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic why Searches running on only one Indexer ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/why-Searches-running-on-only-one-Indexer/m-p/419167#M167214</link>
    <description>&lt;P&gt;Hi All ,&lt;/P&gt;

&lt;P&gt;So I have two indexers in a cluster with CM&lt;BR /&gt;
Two SH's in a cluster with a deployer&lt;BR /&gt;
SH cluster is connected to CM .&lt;/P&gt;

&lt;P&gt;I see Indexer's having high CPU alerts.&lt;BR /&gt;
Sometimes Indexer01 have 100% CPU alerts&lt;BR /&gt;
Sometime IDX02 but not both collectively.&lt;/P&gt;

&lt;P&gt;So I went to DMC , saw that searches are causing this issue.&lt;/P&gt;

&lt;P&gt;So i opened two indexer's via putty (command line) and ran the top command to view the CPU utilization.&lt;/P&gt;

&lt;P&gt;whenever i see a Indexer hitting 100%&lt;BR /&gt;
I opened the dispatch folder at&lt;BR /&gt;
 &lt;CODE&gt;/opt/splunk/var/run/splunk/dispatch&lt;/CODE&gt;&lt;BR /&gt;
and ran&lt;BR /&gt;
 &lt;CODE&gt;find . -name "alive.token"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;What i found out is , whenever the acceleration searches are running the cpu is hitting 100% on that particular indexer.&lt;/P&gt;

&lt;P&gt;My question is :&lt;/P&gt;

&lt;P&gt;1.Why my acceleration searches are only running on only one of two indexer's why not both collectively?&lt;/P&gt;

&lt;P&gt;If i see they are running on IDX01 , the IDX02 dispatch directory doesnot have any alive searches or cpu usage is very low.&lt;/P&gt;

&lt;P&gt;If i see they are running on IDX02 ,the IDX01dispatch directory doesnot have any alive searches or cpu usage is very low.&lt;/P&gt;

&lt;P&gt;2.I am trying to draft a search to count the number of jobs ran on any Indexer.&lt;/P&gt;

&lt;P&gt;I took the search_id from the dispatch folder and searched in splunk.&lt;BR /&gt;
I got events from _audit and _internal , the problem is I dont see any field saying on which indexer the search job has run.&lt;BR /&gt;
[as the _audit and _internal indexes are replicated among the cluster , i cant differentiate the internal logs of the indexer's]&lt;/P&gt;

&lt;P&gt;Please give your thoughts.&lt;/P&gt;

&lt;P&gt;P.S : it is a multisite cluster .&lt;BR /&gt;
SH01 and IDX01 are on site1&lt;BR /&gt;
SH02 and IDX02 are on site2&lt;/P&gt;

&lt;P&gt;I thought search affinity is the problem.&lt;BR /&gt;
But as per search affinity , if the search is triggered by SH01 it will run on IDX01 mostly.&lt;BR /&gt;
But here i see search jobs are triggered by both SH01 and SH02 [i have known this from the search jobs naming convention in the dispatch folder ]and running only on either of the indexers. (edited)&lt;/P&gt;</description>
    <pubDate>Mon, 08 Oct 2018 05:23:34 GMT</pubDate>
    <dc:creator>ramarcsight</dc:creator>
    <dc:date>2018-10-08T05:23:34Z</dc:date>
    <item>
      <title>why Searches running on only one Indexer ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-Searches-running-on-only-one-Indexer/m-p/419167#M167214</link>
      <description>&lt;P&gt;Hi All ,&lt;/P&gt;

&lt;P&gt;So I have two indexers in a cluster with CM&lt;BR /&gt;
Two SH's in a cluster with a deployer&lt;BR /&gt;
SH cluster is connected to CM .&lt;/P&gt;

&lt;P&gt;I see Indexer's having high CPU alerts.&lt;BR /&gt;
Sometimes Indexer01 have 100% CPU alerts&lt;BR /&gt;
Sometime IDX02 but not both collectively.&lt;/P&gt;

&lt;P&gt;So I went to DMC , saw that searches are causing this issue.&lt;/P&gt;

&lt;P&gt;So i opened two indexer's via putty (command line) and ran the top command to view the CPU utilization.&lt;/P&gt;

&lt;P&gt;whenever i see a Indexer hitting 100%&lt;BR /&gt;
I opened the dispatch folder at&lt;BR /&gt;
 &lt;CODE&gt;/opt/splunk/var/run/splunk/dispatch&lt;/CODE&gt;&lt;BR /&gt;
and ran&lt;BR /&gt;
 &lt;CODE&gt;find . -name "alive.token"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;What i found out is , whenever the acceleration searches are running the cpu is hitting 100% on that particular indexer.&lt;/P&gt;

&lt;P&gt;My question is :&lt;/P&gt;

&lt;P&gt;1.Why my acceleration searches are only running on only one of two indexer's why not both collectively?&lt;/P&gt;

&lt;P&gt;If i see they are running on IDX01 , the IDX02 dispatch directory doesnot have any alive searches or cpu usage is very low.&lt;/P&gt;

&lt;P&gt;If i see they are running on IDX02 ,the IDX01dispatch directory doesnot have any alive searches or cpu usage is very low.&lt;/P&gt;

&lt;P&gt;2.I am trying to draft a search to count the number of jobs ran on any Indexer.&lt;/P&gt;

&lt;P&gt;I took the search_id from the dispatch folder and searched in splunk.&lt;BR /&gt;
I got events from _audit and _internal , the problem is I dont see any field saying on which indexer the search job has run.&lt;BR /&gt;
[as the _audit and _internal indexes are replicated among the cluster , i cant differentiate the internal logs of the indexer's]&lt;/P&gt;

&lt;P&gt;Please give your thoughts.&lt;/P&gt;

&lt;P&gt;P.S : it is a multisite cluster .&lt;BR /&gt;
SH01 and IDX01 are on site1&lt;BR /&gt;
SH02 and IDX02 are on site2&lt;/P&gt;

&lt;P&gt;I thought search affinity is the problem.&lt;BR /&gt;
But as per search affinity , if the search is triggered by SH01 it will run on IDX01 mostly.&lt;BR /&gt;
But here i see search jobs are triggered by both SH01 and SH02 [i have known this from the search jobs naming convention in the dispatch folder ]and running only on either of the indexers. (edited)&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 05:23:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-Searches-running-on-only-one-Indexer/m-p/419167#M167214</guid>
      <dc:creator>ramarcsight</dc:creator>
      <dc:date>2018-10-08T05:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: why Searches running on only one Indexer ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-Searches-running-on-only-one-Indexer/m-p/419168#M167215</link>
      <description>&lt;P&gt;A 2-node search cluster cannot survive any node failures, in fact 3 is the minimum cluster size for a search head cluster.&lt;/P&gt;

&lt;P&gt;The audit and internal logs should both have a host field which advises where the logs came from.&lt;/P&gt;

&lt;P&gt;If your running a search head cluster, than 1 of the 2 nodes will run the acceleration job, and if you have search head 1 running the job then it will run against indexer IDX01 (site1) and search head 2 (IDX02) &lt;EM&gt;if&lt;/EM&gt; the bucket is available in both sites.&lt;/P&gt;

&lt;P&gt;If for any reason the bucket is only available on IDX02 and the search is running on SH01, it will query IDX02 as the affinity is a preference.&lt;/P&gt;

&lt;P&gt;It is generally recommended to use site0 in a search head cluster, perhaps have a read of &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/DistSearch/DeploymultisiteSHC"&gt;Deploy a search head cluster in a multisite environment&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;And &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/DistSearch/SHCarchitecture"&gt;Search head clustering architecture&lt;/A&gt; in particular &lt;BR /&gt;
"Captain election process has deployment implications"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; A cluster must consist of a minimum of three members. A two-member cluster cannot tolerate any node failure. Failure of either member will prevent the cluster from electing a captain and continuing to function. Captain election requires majority (51%) assent of all members, which, in the case of a two-member cluster, means that both nodes must be running. You therefore forfeit the high availability benefits of a search head cluster if you limit it to two members.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Oct 2018 21:59:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-Searches-running-on-only-one-Indexer/m-p/419168#M167215</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2018-10-08T21:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: why Searches running on only one Indexer ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-Searches-running-on-only-one-Indexer/m-p/529138#M167216</link>
      <description>&lt;P&gt;Hi&amp;nbsp;ramarcsight,&lt;/P&gt;&lt;P&gt;Very old thread but did you manage to resolve this issue. Would be good if you are able to respond with any helpful information.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 13:19:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-Searches-running-on-only-one-Indexer/m-p/529138#M167216</guid>
      <dc:creator>payl_chdhry</dc:creator>
      <dc:date>2020-11-12T13:19:28Z</dc:date>
    </item>
  </channel>
</rss>

