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

Hello;

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 https://www.elastic.co/guide/en/elasticsearch/reference/8.7/important-settings.html#initial_master_nodes`

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
Flemming

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-

I believe there is a bug in de code that logs the warning (elasticsearch/server/src/main/java/org/elasticsearch/cluster/coordination/ClusterBootstrapService.java at main · elastic/elasticsearch · GitHub). The assumption is made that bootstrapRequirements is filled with the cluster.initial_master_nodes setting, but in fact it is filled with the node.name setting in case of single node discovery

1 Like

Ohh right. Yes that looks like a bug indeed. Thanks @PeterNagel!

I opened Cluster bootstrap warning incorrectly emitted for `discovery.type: single-node` · Issue #96874 · elastic/elasticsearch · GitHub.

1 Like

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