Curl command to delete cluster settings

Hi Team,

Is there any API where i can utilize to delete the cluster settings?

I have configured the cluster settings to use sniff mode but when i tried to change that to proxy mode, i am getting error that its already configured with sniff mode and cannot be changed to proxy mode.

curl -X PUT "http://a.b.c.d:31777/_cluster/settings" -H 'Content-Type: application/json' -d'
> {
>   "persistent" : {
>     "cluster" : {
>       "remote" : {
>         "elasticsearch" : {
> "mode": "proxy",
>         "proxy_address": "x.y.z.4:31781"
>         }
>       }
>     }
>   }
> }'
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Setting \"cluster.remote.elasticsearch.seeds\" cannot be used with the configured \"cluster.remote.elasticsearch.mode\" [required=SNIFF, configured=PROXY]"}],"type":"illegal_argument_exception","reason":"Setting \"cluster.remote.elasticsearch.seeds\" cannot be used with the configured \"cluster.remote.elasticsearch.mode\" [required=SNIFF, configured=PROXY]"},"status":400}[dsadashivaia@target ~]$

Yes, you set unwanted settings to null using the very same API. See these docs for more information.

Thanks @DavidTurner

For other folks information adding sample payload as well:

curl -X PUT "http://x.y.z.e:9200/_cluster/settings" -H 'Content-Type: application/json' -d'
  "persistent" : {
  "cluster.*" : null 
1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.