Is there a way to ask ES what settings it's using?

I'm trying to figure out if there is any programmatic way to tell what settings an ES cluster is using. In particular, I can't seem to get at the settings it gets from elasticsearch.yml. I'm looking at cluster-level and index-level settings and I don't see what I expect. Is there any way to get ES to tell me this stuff? I ultimately want to use the java API, but I can't even find a way to do it through the REST API.

The background here is that I need my program to behave differently depending on the cluster's shard allocation settings. For example, if I want to make a new index, I need it to do something different if allocation is turned off. I have shard allocation turned off in my elasticsearch.yml, but nothing in cluster settings or index settings seems to say anything about that, so I can't tell programmatically whether allocation is allowed or not.

1 Like

Some of this was asked in Update settings on cluster level

But you want to avoid setting shard allocation to off in your .yml, otherwise the only way to change this is to restart your cluster :frowning:

Okay, so it sounds like what I want is currently impossible, since it's basically the same thing this open issue is asking for:

Good to know.