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

**URL:** <https://discuss.elastic.co/t/how-to-avoid-warning-when-starting-with-discovery-type-set-to-single-node/334087>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [May 23, 2023, 7:27am UTC](https://discuss.elastic.co/t/how-to-avoid-warning-when-starting-with-discovery-type-set-to-single-node/334087 "2023-05-23T07:27:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fgjensen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fgjensen/32/62320_2.png) [@fgjensen](https://discuss.elastic.co/u/fgjensen)\
**Post date:** [May 23, 2023, 7:27am UTC](https://discuss.elastic.co/t/how-to-avoid-warning-when-starting-with-discovery-type-set-to-single-node/334087/1 "2023-05-23T07:27:11Z")

</div>

Hello;

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

```auto
[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.

```auto
{
  "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

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 23, 2023, 7:59am UTC](https://discuss.elastic.co/t/how-to-avoid-warning-when-starting-with-discovery-type-set-to-single-node/334087/2 "2023-05-23T07:59:30Z")

</div>

> [@fgjensen](#):
>
> I have removed the cluster.initial\_master\_nodes property and added discovery.type: single-node, but the warning persists.

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.

---

<div class="post-metadata">

**Author:** ![fgjensen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fgjensen/32/62320_2.png) [@fgjensen](https://discuss.elastic.co/u/fgjensen)\
**Post date:** [May 23, 2023, 8:49am UTC](https://discuss.elastic.co/t/how-to-avoid-warning-when-starting-with-discovery-type-set-to-single-node/334087/3 "2023-05-23T08:49:16Z")

</div>

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-

---

<div class="post-metadata">

**Author:** ![PeterNagel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peternagel/32/122304_2.png) [@PeterNagel](https://discuss.elastic.co/u/PeterNagel)\
**Post date:** [June 15, 2023, 1:38pm UTC](https://discuss.elastic.co/t/how-to-avoid-warning-when-starting-with-discovery-type-set-to-single-node/334087/4 "2023-06-15T13:38:49Z")

</div>

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](https://github.com/elastic/elasticsearch/blob/main/server/src/main/java/org/elasticsearch/cluster/coordination/ClusterBootstrapService.java)). 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

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [June 15, 2023, 1:55pm UTC](https://discuss.elastic.co/t/how-to-avoid-warning-when-starting-with-discovery-type-set-to-single-node/334087/5 "2023-06-15T13:55:02Z")

</div>

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](https://github.com/elastic/elasticsearch/issues/96874).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 13, 2023, 1:55pm UTC](https://discuss.elastic.co/t/how-to-avoid-warning-when-starting-with-discovery-type-set-to-single-node/334087/6 "2023-07-13T13:55:31Z")

</div>

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