KV Store maintenance mode change can only be done on static captain.
You will not be able to put the KV Store into maintenance mode with a dynamic captain, to get around this you can temporarily change to a static captain using the following command
/opt/splunk/bin/splunk edit shcluster-config -mode member -captain_uri https://your-Captain-SH-address:8089 -election false
After this you should be able to check that dynamic_captain is 0 (splunk show shcluster-status) and then be able to enable maintenance mode.
Please let me know how you get on and consider upvoting/karma this answer if it has helped.
Regards
Will
Is there a rest call to set the election as false from the captain for each cluster member , instead of logging into each seach head member and running the command
/opt/splunk/bin/splunk edit shcluster-config -mode member -captain_uri https://your-Captain-SH-address:8089 -election false
Am trying to set the kvstore captain in maintenance mode, but when i try set the kvstore captain in maintenance mode, it says that maintenance mode can only be set on the "static captain"
I can switch to static captain using the following command successfully
splunk edit shcluster-config -mode captain -captain_uri <URI>:<management_port> -election false
But i have to set election to false on non-captain members for which am trying to the curl command which fails
curl -k -u username:password -X POST -d '{"mode":"member", "captain_uri":"https://captain.example.net:port","election":"false","target_uri":"https://member.example.net:port"}' https://member.example.net:port/services/shcluster/config/
<?xml version="1.0" encoding="UTF-8"?>
<response>
<messages>
<msg type="ERROR">Cannot perform action "POST" without a target name to act on.</msg>
</messages>
</response>
As per the documentation I can only see the get call (https://docs.splunk.com/Documentation/Splunk/9.4.2/RESTREF/RESTcluster#shcluster.2Fconfig)
Are there any other alternatives to set the election=false for the non-captain members remotely
Hi @Raja1
You cannot set a static captaincy using the POST request, instead use the following:
To switch to a static captain, reconfigure each cluster member to use a static captain:
splunk edit shcluster-config -mode captain -captain_uri <URI>:<management_port> -election false
splunk edit shcluster-config -mode member -captain_uri <URI>:<management_port> -election false
🌟 Did this answer help you? If so, please consider:
Your feedback encourages the volunteers in this community to continue contributing
@livehybrid , thank you for your response, unfortunately we need to set the election to false remotely on each member . So guess that is not possible with api call as we do not have POST.
Will look into other possibilities. Thank you again
Thank you for the suggestion. We were able to restore kvstore even without changing the dynamic captain
Hi @Raja1 Do you now get a different error? What do you see in Splunkd.log and mongod.log, or in the CLI output?
Thanks
@Raja1Can you clarify further? What exactly are you looking for ?