How to avoid warning when starting with discovery.type set to single node


I have upgraded a single-node Elasticsearch from version 7.17 to 8.7. When the node starts up it logs this warning:

[WARN ][o.e.c.c.ClusterBootstrapService] [elasticsearch] this node is locked into cluster UUID [H6ToZxhPRAerFe-iPlqE8A] but [cluster.initial_master_nodes] is set to [elasticsearch]; remove this setting to avoid possible data loss caused by subsequent cluster bootstrap attempts; for further information see`

I have removed the cluster.initial_master_nodes property and added discovery.type: single-node, but the warning persists.

Next, I have looked at the various scripts delivered with Elasticsearch in the bin-direktory, but I do not find any suitable to remove the cluster_uuid from the cluster state.

  "name" : "elasticsearch",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "H6ToZxhPRAerFe-iPlqE8A",
  "version" : {
    "number" : "8.7.1",

How do I get rid of the warning?

Best regards

The warning indicates that you have not removed cluster.initial_master_nodes. Maybe you adjusted the wrong elasticsearch.yml file, or maybe it is being passed in on the command line. In any case, that's what you must do to fix the warning.

Thanks @DavidTurner Elastic runs in Docker so maybe I was fooled and not editing the right elasticsearch.yml file on the fly.

I make a new image and update the post with the result-