<?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: Correct way of testing forwarder_site_failover feature in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Correct-way-of-testing-forwarder-site-failover-feature/m-p/559695#M6424</link>
    <description>&lt;P&gt;I see that you have indexer discovery configured, which is great. When you have this configured, the forwarder will poll the master for a list of available indexers and it will use that list until the next polling cycle.&lt;/P&gt;&lt;P&gt;In order to test the failover using the iptables method you posted about, you would have to wait until the polling cycle expires. Only then would the forwarder get a new list of indexers from the master.&lt;/P&gt;&lt;P&gt;The polling frequency is based on an algorithm which is detailed in the documentation below (or you can set it manually).&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.1/Indexer/indexerdiscovery#Adjust_the_frequency_of_polling" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.2.1/Indexer/indexerdiscovery#Adjust_the_frequency_of_polling&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jul 2021 20:37:57 GMT</pubDate>
    <dc:creator>codebuilder</dc:creator>
    <dc:date>2021-07-15T20:37:57Z</dc:date>
    <item>
      <title>Correct way of testing forwarder_site_failover feature</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Correct-way-of-testing-forwarder-site-failover-feature/m-p/559653#M6414</link>
      <description>&lt;P&gt;We have a multi-site installation of Splunk and would like to test if the&amp;nbsp;forwarder_site_failover is working properly. In the forwarders output.conf we have the following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[indexer_discovery:master1]
pass4SymmKey = $secretstuff$
master_uri = https://yadayada:8089

[tcpout:group1]
indexerDiscovery = master1
useACK = false
clientCert = /opt/splunk/etc/auth/certs/s2s.pem
sslRootCAPath = /opt/splunk/etc/auth/certs/ca.crt

[tcpout]
forceTimebasedAutoLB = true
autoLBFrequency = 30
defaultGroup = group1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as the yadayada clustermaster server goes, we have the following config:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/opt/splunk/etc/apps/clustermaster_base_conf/default/server.conf     [clustering]
(...)
/opt/splunk/etc/apps/clustermaster_base_conf/default/server.conf     forwarder_site_failover = site1:site2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One thing that I was trying to figure out was the need to explicitly set site2:site1 or if the existing configuration was enough for failing over from site1 to site2 and from site2 to site1.&lt;BR /&gt;&lt;BR /&gt;My approach was to shut the connection between the forwarder and the site1 indexers by setting iptable rules in the indexers that DROP the connections from the forwarder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#e.g. iptables rule
iptables -I INPUT 1 -s &amp;lt;forwarder ip&amp;gt; -p tcp --dport 9997 -j DROP

#forwarder splunkd.log
07-15-2021 16:20:41.729 +0000 WARN  TcpOutputProc - Cooked connection to ip=&amp;lt;site1 indexer ip&amp;gt;:9997 timed out&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The iptables rules didn't make the forwarder failover so, i wonder if the failover process only kicks when the clustermaster loses the visibility over the indexers. In the live setup this seems more risky and less flexible.&lt;BR /&gt;&lt;BR /&gt;What is the recommended approach to perform this kind of testing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 20:04:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Correct-way-of-testing-forwarder-site-failover-feature/m-p/559653#M6414</guid>
      <dc:creator>PT_crusher</dc:creator>
      <dc:date>2021-07-15T20:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Correct way of testing forwarder_site_failover feature</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Correct-way-of-testing-forwarder-site-failover-feature/m-p/559695#M6424</link>
      <description>&lt;P&gt;I see that you have indexer discovery configured, which is great. When you have this configured, the forwarder will poll the master for a list of available indexers and it will use that list until the next polling cycle.&lt;/P&gt;&lt;P&gt;In order to test the failover using the iptables method you posted about, you would have to wait until the polling cycle expires. Only then would the forwarder get a new list of indexers from the master.&lt;/P&gt;&lt;P&gt;The polling frequency is based on an algorithm which is detailed in the documentation below (or you can set it manually).&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.1/Indexer/indexerdiscovery#Adjust_the_frequency_of_polling" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.2.1/Indexer/indexerdiscovery#Adjust_the_frequency_of_polling&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 20:37:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Correct-way-of-testing-forwarder-site-failover-feature/m-p/559695#M6424</guid>
      <dc:creator>codebuilder</dc:creator>
      <dc:date>2021-07-15T20:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Correct way of testing forwarder_site_failover feature</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Correct-way-of-testing-forwarder-site-failover-feature/m-p/559824#M6434</link>
      <description>&lt;P&gt;So I followed the link and explicitly set the &lt;EM&gt;polling_rate &lt;/EM&gt;to 10 in the cluster master. This would give me a polling cycle interval of roughly 4 minutes.&lt;/P&gt;&lt;P&gt;Regardless of this fact I just see the logs getting filled with&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;07-16-2021 15:55:33.324 +0100 WARN TcpOutputProc - Cooked connection to ip=&amp;lt;multiple site1 indexer IPs&amp;gt;:9997 timed out &lt;/LI-CODE&gt;&lt;P&gt;If i bump the&amp;nbsp;TcpOutputProc logs to DEBUG the state machine is transitioning between&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Connector::runCookedStateMachine in state=eInit&lt;/PRE&gt;&lt;P&gt;and&lt;/P&gt;&lt;PRE&gt;Connector::runCookedStateMachine in state=eV3ConnectTimedOut&lt;/PRE&gt;&lt;P&gt;but still, all attempts are made to site1, i don't feel that the failover is triggered at all.&lt;/P&gt;&lt;P&gt;If we change the server.conf of the forwarder and set the site to site2 it is able to send the logs via site2 indexers&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 15:00:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Correct-way-of-testing-forwarder-site-failover-feature/m-p/559824#M6434</guid>
      <dc:creator>PT_crusher</dc:creator>
      <dc:date>2021-07-16T15:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Correct way of testing forwarder_site_failover feature</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Correct-way-of-testing-forwarder-site-failover-feature/m-p/559853#M6435</link>
      <description>&lt;LI-CODE lang="markup"&gt;07-16-2021 17:07:58.143 +0000 DEBUG IndexerDiscoveryHeartbeatThread - Connector::runCookedStateMachine in state=eV3ConnectDone for &amp;lt;site2 indexer&amp;gt;:9997
07-16-2021 17:07:58.143 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState Ping failover connection to idx=&amp;lt;site2 indexer&amp;gt;:9997 successful.
07-16-2021 17:07:58.143 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState enable the failover to 4
07-16-2021 17:07:58.944 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState is enabled to fail over
07-16-2021 17:07:58.944 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState current connection status 10
07-16-2021 17:07:58.945 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState is not failing over to the failover site because the primary site is up
07-16-2021 17:08:01.850 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState is enabled to fail over
07-16-2021 17:08:01.850 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState current connection status 10
07-16-2021 17:08:01.850 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState is not failing over to the failover site because the primary site is up
07-16-2021 17:08:04.754 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState is enabled to fail over
07-16-2021 17:08:04.755 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState current connection status 10
07-16-2021 17:08:04.755 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState is not failing over to the failover site because the primary site is up
07-16-2021 17:08:07.611 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState is enabled to fail over
07-16-2021 17:08:07.611 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState current connection status 10
07-16-2021 17:08:07.611 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState is not failing over to the failover site because the primary site is up
07-16-2021 17:08:07.913 +0000 WARN TcpOutputProc - Cooked connection to ip=&amp;lt;site1 indexer&amp;gt;:9997 timed out
07-16-2021 17:08:10.518 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState is enabled to fail over
07-16-2021 17:08:10.518 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState current connection status 10
07-16-2021 17:08:10.518 +0000 DEBUG IndexerDiscoveryHeartbeatThread - TcpOutputGroupState is not failing over to the failover site because the primary site is up&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After setting &lt;EM&gt;IndexerDiscoveryHeartbeatThread&lt;/EM&gt; to DEBUG i confirmed my suspicious. Forwarder is not failingover because it thinks site1 is up&lt;/P&gt;&lt;P&gt;netstat -tunap | grep "&amp;lt;ip of the forwarder VM&amp;gt;" &amp;lt;------- no ESTABLISHED connections in any of site1 indexers&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 17:13:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Correct-way-of-testing-forwarder-site-failover-feature/m-p/559853#M6435</guid>
      <dc:creator>PT_crusher</dc:creator>
      <dc:date>2021-07-16T17:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Correct way of testing forwarder_site_failover feature</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Correct-way-of-testing-forwarder-site-failover-feature/m-p/561919#M9596</link>
      <description>&lt;P&gt;Turns out the it is up to the clustermaster to loose connectivity to the indexers.&lt;/P&gt;&lt;P&gt;Clustermaster will them instruct the forwarder to failover.&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 16:05:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Correct-way-of-testing-forwarder-site-failover-feature/m-p/561919#M9596</guid>
      <dc:creator>PT_crusher</dc:creator>
      <dc:date>2021-08-03T16:05:03Z</dc:date>
    </item>
  </channel>
</rss>

