- If you still have primary or secondary and only some of them went out of sync, then use the method in the doc:
https://docs.splunk.com/Documentation/Splunk/latest/Admin/ResyncKVstore
- If you think the KVStore cluster is broken, such as no primary or secondary at all and need recovery then follow the below;
This could happen because you didn't have shcluster captain when the search was started. That's why the KVStore is in starting, not able to make it to "Ready" because SHC captain is the one should tell KVStore which members are available for ReplicaSet.
Follow the steps below to correct the situation: 1. Do backup $SPLUNK_HOME from all members!!! 2. Stop all SHC instances. 3. Run the command from all members $ rm -rf $SPLUNK_HOME/var/run/splunk/_raft/* $ splunk clean kvstore --cluster > This is not deleting database but deleting cluster info. 4. Choose one member, where you think KVStore worked before. Edit as below, in "$SPLUNK_HOME/etc/system/local/server.conf" [shclustering] replication_factor=1 5. Start this member 6. Bootstrap SHC with just this member $ ./bin/splunk bootstrap shcluster-captain -servers_list "https://THIS_MEMBER_URL:8089" -auth admin:password 7. Verify SHC status $ ./splunk show shcluster-status 8. Verify KVStore status, shoudl see 'ready' , $ curl -k -s https://localhost:8089/services/server/info | grep kvStore
OR $./splunk show kvstore-status 9. Stop this instance and change replication_factor to whatever it was before. in "$SPLUNK_HOME/etc/system/local/server.conf" [shclustering] replication_factor=what it was before 10. Clean folder $SPLUNK_HOME/var/run/splunk/_raft/ on this instance. Or run, "$ splunk clean raft" 11. Start ALL instances. 12. Bootstrap SHC with all members. $ ./bin/splunk bootstrap shcluster-captain -servers_list "https://server1:8089,https://server2:8089,https://server3:8089,https://server4:8089" -auth admin:changeme > replace the server1~4 with your member info. 13. Verify SHC status $ ./splunk show shcluster-status 14. Verify KVStore status from all members $ curl -k -s https://localhost:8089/services/server/info | grep kvStore OR $./splunk show kvstore-status
15. If any data or collections are found to be missing then restore it from any latest good backup by using restore command, details found in the doc below;
https://docs.splunk.com/Documentation/Splunk/8.0.5/Admin/BackupKVstore
... View more