It’s best to set all cluster-wide settings with the settings API and use the
elasticsearch.yml file only for local configurations. This way you can be sure that
the setting is the same on all nodes. If, on the other hand, you define different
settings on different nodes by accident using the configuration file, it is very
difficult to notice these discrepancies.

You can find the list of settings that you can dynamically update in Modules.