<?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 How to clean a clustered index? in Deployment Architecture</title>
    <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94161#M3457</link>
    <description>&lt;P&gt;What's the best way to completely clean an index in a clustered environment?&lt;/P&gt;</description>
    <pubDate>Tue, 08 Mar 2022 17:33:19 GMT</pubDate>
    <dc:creator>dart</dc:creator>
    <dc:date>2022-03-08T17:33:19Z</dc:date>
    <item>
      <title>How to clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94161#M3457</link>
      <description>&lt;P&gt;What's the best way to completely clean an index in a clustered environment?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 17:33:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94161#M3457</guid>
      <dc:creator>dart</dc:creator>
      <dc:date>2022-03-08T17:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94162#M3458</link>
      <description>&lt;P&gt;Would cleaning it on each of the nodes not propagate to the replicas?&lt;/P&gt;

&lt;P&gt;Or would it be better/possible to set replication/search factor to 1, and then (after a little while, perhaps) clean the index on the nodes?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2013 13:53:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94162#M3458</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-15T13:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94163#M3459</link>
      <description>&lt;P&gt;Currently, there is not really a good way to do this as cleaning the event data from an index will just get replicated back from another cluster node.&lt;/P&gt;

&lt;P&gt;That being said, there are two not quite so nice ways of doing it.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;With a user that has the can_delete permissions, pipe all the event data to be removed to the delete command. Naturally, this means that all the caveats for using the delete command apply. (Data is not removed from disk, etc.)&lt;/LI&gt;
&lt;LI&gt;Make sure you stop indexing data to the index your are about to clean and alter your data retention policy to be extremely short. This will roll all the buckets to frozen and hence clear out the index. Once all the data has been removed from the index on all the peers, the retention policy can be set back to its original settings in order to allow for new data to be indexed.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;For the 1st option, you may find the following link useful:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/Indexer/RemovedatafromSplunk#How_to_delete" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.3/Indexer/RemovedatafromSplunk#How_to_delete&lt;/A&gt;&lt;BR /&gt;
For the 2nd options, take a look at the documentation here:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/Indexer/Setaretirementandarchivingpolicy" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.3/Indexer/Setaretirementandarchivingpolicy&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:14:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94163#M3459</guid>
      <dc:creator>Rob</dc:creator>
      <dc:date>2020-09-28T14:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94164#M3460</link>
      <description>&lt;P&gt;By design, it is meant to be difficult to delete data in a cluster. The point of clustering is to make data resistant to loss by copying and replicating it. So besides these suggestions, you would have to stop all indexers and clean the indexes on each one manually to remove all the replicas to prevent recovery.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2013 04:45:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94164#M3460</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-07-03T04:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94165#M3461</link>
      <description>&lt;P&gt;The only problem with cleaning each indexer node with the entire cluster down is that the cluster master may not have any knowledge of the data being unavailable.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2013 05:44:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94165#M3461</guid>
      <dc:creator>Rob</dc:creator>
      <dc:date>2013-07-03T05:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94166#M3462</link>
      <description>&lt;P&gt;The cluster master does not keep the knowledge of the data location without the indexer nodes. If they are all down, then all that the CM knows is that there is no data available anywhere. When the indexers recover, they tell the master that none of them have any data, and that is all the CM knows. The CM's job is not to track each piece of data, but to ensure that any piece of data that is reported to exist is sufficiently replicated, and to tell the search head where they are. It gets the knowledge to do this from the indexers.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2013 14:49:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94166#M3462</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-07-03T14:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94167#M3463</link>
      <description>&lt;P&gt;What would happen if I run on each indexer at nearly same time Splunk offline command,&lt;BR /&gt;
and than run ./splunk clean eventdata -index &lt;INDEX_NAME&gt; command on each indexer?&lt;/INDEX_NAME&gt;&lt;/P&gt;

&lt;P&gt;When data is removed I would start every indexer.&lt;BR /&gt;
This actions would take less than 10 minutes, so the master node would not detect indexer failure.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2013 08:18:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94167#M3463</guid>
      <dc:creator>manjosk8</dc:creator>
      <dc:date>2013-07-08T08:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94168#M3464</link>
      <description>&lt;P&gt;@manjosk8 &lt;/P&gt;

&lt;P&gt;The problem you will run in to is that the cluster master may retain the info on data availability of the peers. In turn this will cause the search head to look for data where it no longer exists.&lt;/P&gt;

&lt;P&gt;The bigger issue is that the actions taking 10min or less would be insufficient. On start the buckets are checked and replication begins. Also, the default peer heartbeat is 30 or 60 seconds depending on the version of Splunk you are running. &lt;/P&gt;

&lt;P&gt;In the end, these actions would either create a faulty cluster setup or it would not delete the data as expected.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2013 18:52:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94168#M3464</guid>
      <dc:creator>Rob</dc:creator>
      <dc:date>2013-08-14T18:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94169#M3465</link>
      <description>&lt;P&gt;OK, I now have a ton of PROD data going into my 5 indexers and while this will work, your master node will get very angry when you shut down your indexers.&lt;/P&gt;

&lt;P&gt;I think if you turn off the feeds at your forwarder and they can queue everything, you might be OK but I'm not testing it!&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;This process seems to work.&lt;/P&gt;

&lt;P&gt;On my master node, I'm pushing inputs.conf and indexes.conf. I only have test data so I just delete these files &lt;STRONG&gt;&lt;EM&gt;AFTER&lt;/EM&gt;&lt;/STRONG&gt; the clean. If you have other indexes, just delete the pertinent info after the clean and then apply the cluster bundle.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;MASTER:&lt;/STRONG&gt; /opt/splunk/etc/master-apps/_cluster/local/inputs.conf&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;MASTER:&lt;/STRONG&gt; /opt/splunk/etc/master-apps/_cluster/local/indexes.conf&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;INDEXER:&lt;/STRONG&gt; /opt/splunk/etc/slave-apps/_cluster/local/inputs.conf&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;INDEXER:&lt;/STRONG&gt; /opt/splunk/etc/slave-apps/_cluster/local/indexes.conf&lt;/LI&gt;
&lt;/UL&gt;

&lt;HR /&gt;

&lt;P&gt;Shut down splunk on the indexers and the master node.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;/opt/splunk/bin/splunk stop&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Run the clean command on the indexers.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;/opt/splunk/bin/splunk clean eventdata -index test_log&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Wait for clean to complete. I only had a couple hours of data so it only took a minute.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Edit or remove the files that you're pushing from the master node.&lt;BR /&gt;
I just deleted mine since I only had test data.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;MASTER (edit or remove)&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;rm /opt/splunk/etc/master-apps/_cluster/local/inputs.conf&lt;/LI&gt;
&lt;LI&gt;rm /opt/splunk/etc/master-apps/_cluster/local/indexes.conf&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;INDEXERS (edit or remove)&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;rm /opt/splunk/etc/slave-apps/_cluster/local/inputs.conf&lt;/LI&gt;
&lt;LI&gt;rm /opt/splunk/etc/slave-apps/_cluster/local/indexes.conf&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Start splunk on the indexers and the master node.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;/opt/splunk/bin/splunk start&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Apply the cluster bundle from the master node.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;/opt/splunk/bin/splunk apply cluster-bundle --answer-yes&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Check the status of cluster bundle from the master node.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;/opt/splunk/bin/splunk show cluster-bundle-status&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 22 Aug 2013 12:05:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94169#M3465</guid>
      <dc:creator>dfronck</dc:creator>
      <dc:date>2013-08-22T12:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94170#M3466</link>
      <description>&lt;P&gt;This worked for me. It's a shame there is no easy way to clean clustered indexes. The master server should have been able to do this. I hope it's coming in a later version.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2013 13:44:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94170#M3466</guid>
      <dc:creator>mikaelbje</dc:creator>
      <dc:date>2013-08-28T13:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94171#M3467</link>
      <description>&lt;P&gt;Option 2 worked for me, and in my case a rolling restart wasn't even initiated.&lt;/P&gt;</description>
      <pubDate>Mon, 05 May 2014 04:21:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94171#M3467</guid>
      <dc:creator>1StopBloke</dc:creator>
      <dc:date>2014-05-05T04:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94172#M3468</link>
      <description>&lt;P&gt;Place the cluster master into maintenance mode first. &lt;EM&gt;New&lt;/EM&gt; data will be replicated as normal, but if an indexer is unavailable for a while, the cluster master will &lt;EM&gt;not&lt;/EM&gt; trigger replication activity to "fix" the bucket counts for the data from the missing indexer.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2015 12:53:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94172#M3468</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2015-05-11T12:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94173#M3469</link>
      <description>&lt;P&gt;The above methods are likely fine for smaller environments, but not very easy to address in larger or "overworked" clusters.  I've deployed a new index file to the indexer WITHOUT the index to be cleaned (apply cluster-bundle), wait for the system to stablize, then use the OS to delete the index files (default /opt/splunk/var/lib/indexname).  Once stabilized, deploy the original index file.&lt;/P&gt;

&lt;P&gt;I have not had problems (like the delete command crashing the whole system) with this approach, it seems to be as fast and probably more efficient than the that techniques I've tried.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2015 19:15:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94173#M3469</guid>
      <dc:creator>gbowden_pheaa</dc:creator>
      <dc:date>2015-11-23T19:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94174#M3470</link>
      <description>&lt;P&gt;I know its quite an old post but i recently had to to this in a production environment and wanted to share my experience here:&lt;/P&gt;

&lt;P&gt;We had to clean a specific index in a multisite indexer cluster following these steps:&lt;BR /&gt;
./splunk offline command on each indexer&lt;BR /&gt;
./splunk clean eventdata --index yourindex&lt;BR /&gt;
./splunk start on all indexers&lt;/P&gt;

&lt;P&gt;This procedure worked fine for us, the master had to rebalance some stuff but didnt' had any remarkable errors or warnings and fixed all buckets as it should.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2016 13:16:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94174#M3470</guid>
      <dc:creator>claudio_manig</dc:creator>
      <dc:date>2016-11-25T13:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94175#M3471</link>
      <description>&lt;P&gt;I downvoted this post because do not use | delete to clean an index.&lt;/P&gt;</description>
      <pubDate>Sun, 27 Nov 2016 02:56:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94175#M3471</guid>
      <dc:creator>dxu_splunk</dc:creator>
      <dc:date>2016-11-27T02:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94176#M3472</link>
      <description>&lt;P&gt;I am super super late but thought I'd add an easy fix for me. I basically just changed the retention policy on the Cluster Master and then pushed out. Checked the indexes shortly after and wa-la..all clean. &lt;/P&gt;

&lt;P&gt;[onboarding]&lt;BR /&gt;
homePath = volume:primary/onboarding/db&lt;BR /&gt;
coldPath = volume:primary/onboarding/colddb&lt;BR /&gt;
thawedPath = $SPLUNK_DB/onboarding/thaweddb&lt;BR /&gt;
repFactor = auto&lt;BR /&gt;
maxDataSize = auto_high_volume&lt;BR /&gt;
maxHotSpanSecs = 86401&lt;BR /&gt;
&lt;STRONG&gt;frozenTimePeriodInSecs = 10&lt;BR /&gt;
rotatePeriodInSecs = 10&lt;BR /&gt;
maxHotIdleSecs = 180&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps someone.&lt;/P&gt;

&lt;P&gt;Happy Splunking.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:51:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/94176#M3472</guid>
      <dc:creator>sahr</dc:creator>
      <dc:date>2020-09-29T14:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clean a clustered index?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/588090#M25332</link>
      <description>&lt;P&gt;Just to update this thread and share that this stills working&lt;BR /&gt;&lt;BR /&gt;My context:&lt;BR /&gt;&lt;BR /&gt;I deployed recently a cluster env. and did not noticed that i my filesystem was getting close to the limit&lt;BR /&gt;I realized when all my indexers status=AutomaticDetention&lt;BR /&gt;As i was aware that the data was useless i followed your approach and worked&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 17:09:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-clean-a-clustered-index/m-p/588090#M25332</guid>
      <dc:creator>FFZ</dc:creator>
      <dc:date>2022-03-08T17:09:19Z</dc:date>
    </item>
  </channel>
</rss>

