<?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 Re: Question ) How does Cluster Master decide Primary searchable copy ? in Deployment Architecture</title>
    <link>https://community.splunk.com/t5/Deployment-Architecture/Question-How-does-Cluster-Master-decide-Primary-searchable-copy/m-p/311225#M11781</link>
    <description>&lt;P&gt;After some discussion with Splunk support I wrote this search to determine how many primary buckets per indexer in site0:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/cluster/master/buckets splunk_server=local 
| search `comment("This idea comes from Splunk support &amp;amp; https://answers.splunk.com/answers/234717/how-to-get-list-of-buckets-which-are-having-issues.html , attempt to determine the count of primary buckets per peer for site0. This report is designed to provide 1 example of a useful REST endpoint")` standalone=0 frozen=0
| rename primaries_by_site.site0 AS peerGUID
| join type=outer peerGUID [ rest /services/cluster/master/peers splunk_server=local
| fields active_* host* label title status site
| eval PeerName= site + ":" + label + ":" + host_port_pair
| rename title AS peerGUID
| rename site AS peerSite
| table peerGUID PeerName peerSite]
| stats count by PeerName
| chart sum(count) AS count by PeerName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note that needs to run from either your cluster master &lt;EM&gt;or&lt;/EM&gt; a node where the cluster master is a peer.&lt;/P&gt;

&lt;P&gt;For the full details try something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/cluster/master/buckets splunk_server=local 
| head 10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Feel free to run without the | head 10 but that may slowdown your browser &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
There are other primaries_by_site.* fields per-site FYI&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 18:07:52 GMT</pubDate>
    <dc:creator>gjanders</dc:creator>
    <dc:date>2020-09-29T18:07:52Z</dc:date>
    <item>
      <title>Question ) How does Cluster Master decide Primary searchable copy ?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Question-How-does-Cluster-Master-decide-Primary-searchable-copy/m-p/311222#M11778</link>
      <description>&lt;P&gt;As you may know in Non-multi-site Cluster there is only one set of “primary” searchable buckets that respond to searches&lt;BR /&gt;
With multi-site, each site can have searchable replicas that respond to searches- based on site affinity.&lt;BR /&gt;
Clarify using the bucket rest end - how can we tell which bucket will be considered Primary searchable .&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 06:27:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Question-How-does-Cluster-Master-decide-Primary-searchable-copy/m-p/311222#M11778</guid>
      <dc:creator>rbal_splunk</dc:creator>
      <dc:date>2017-10-19T06:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Question ) How does Cluster Master decide Primary searchable copy ?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Question-How-does-Cluster-Master-decide-Primary-searchable-copy/m-p/311223#M11779</link>
      <description>&lt;P&gt;In non muli-site clustering, its either 0x0, or 0xFFFFFFFF , basically primary or not primary. &lt;/P&gt;

&lt;P&gt;The individual bits are only relevant in multi-site clustering.&lt;BR /&gt;
The flags is a 64 bit bitmask, with the smallest bit corresponding to Primary for site0. The second smallest would be primary for site1, the third for site2, and so on....so 0x0 = primary for nothing (searches from any site will not get results for this bucket on this peer)&lt;/P&gt;

&lt;P&gt;Bucket marked 0x1 = searches that come from searchheads with site=0 will get results! (primary for site0)&lt;BR /&gt;
Bucket marked 0x2 = primary for site1, all site=site1 searches will get results from these buckets&lt;BR /&gt;
Bucket marked 0x3 == (0x1+0x2) primary for site0 + site1, so searches from site0 SearchHeads and site1 searchheads will get results for this bucket.&lt;/P&gt;

&lt;P&gt;On the cluster/master/buckets/BID endpoint, the masks should add up to whatever the mutl-site config is&lt;BR /&gt;
for example, if We have available_sites=site2,site3, then the mask will need to have 0x1 (site0), 0x4(site2), 0x8 (site3) distributed among its indexers. in this example, if search_factor=1, then only 1 bucket will be searchable and should get assigned all the flags (0x13)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:17:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Question-How-does-Cluster-Master-decide-Primary-searchable-copy/m-p/311223#M11779</guid>
      <dc:creator>rbal_splunk</dc:creator>
      <dc:date>2020-09-29T16:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Question ) How does Cluster Master decide Primary searchable copy ?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Question-How-does-Cluster-Master-decide-Primary-searchable-copy/m-p/311224#M11780</link>
      <description>&lt;P&gt;When I look at the bucket_flags using &lt;CODE&gt;| rest /services/cluster/master/buckets&lt;/CODE&gt;, I see the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;0x0
0x2
0x3
0x4
0x5
0x7
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is a multisite cluster with 2 sites; each site has 2 indexers. There have never been any more indexers or any other sites. The cluster is complete and valid; it is not in maintenance mode. What do these flags mean? I would expect to see 0x3 and 0x5 only...&lt;/P&gt;

&lt;P&gt;I do have some nonclustered buckets (with flags of 0x7) and some single-site buckets (with a variety of flags)&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 23:38:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Question-How-does-Cluster-Master-decide-Primary-searchable-copy/m-p/311224#M11780</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2018-02-13T23:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Question ) How does Cluster Master decide Primary searchable copy ?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Question-How-does-Cluster-Master-decide-Primary-searchable-copy/m-p/311225#M11781</link>
      <description>&lt;P&gt;After some discussion with Splunk support I wrote this search to determine how many primary buckets per indexer in site0:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/cluster/master/buckets splunk_server=local 
| search `comment("This idea comes from Splunk support &amp;amp; https://answers.splunk.com/answers/234717/how-to-get-list-of-buckets-which-are-having-issues.html , attempt to determine the count of primary buckets per peer for site0. This report is designed to provide 1 example of a useful REST endpoint")` standalone=0 frozen=0
| rename primaries_by_site.site0 AS peerGUID
| join type=outer peerGUID [ rest /services/cluster/master/peers splunk_server=local
| fields active_* host* label title status site
| eval PeerName= site + ":" + label + ":" + host_port_pair
| rename title AS peerGUID
| rename site AS peerSite
| table peerGUID PeerName peerSite]
| stats count by PeerName
| chart sum(count) AS count by PeerName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note that needs to run from either your cluster master &lt;EM&gt;or&lt;/EM&gt; a node where the cluster master is a peer.&lt;/P&gt;

&lt;P&gt;For the full details try something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/cluster/master/buckets splunk_server=local 
| head 10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Feel free to run without the | head 10 but that may slowdown your browser &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
There are other primaries_by_site.* fields per-site FYI&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:07:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Question-How-does-Cluster-Master-decide-Primary-searchable-copy/m-p/311225#M11781</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2020-09-29T18:07:52Z</dc:date>
    </item>
  </channel>
</rss>

