# Elasticsearch in Docker : WARN "this node is locked into cluster UUID" on container restart

**URL:** <https://discuss.elastic.co/t/elasticsearch-in-docker-warn-this-node-is-locked-into-cluster-uuid-on-container-restart/333105>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [May 10, 2023, 4:40pm UTC](https://discuss.elastic.co/t/elasticsearch-in-docker-warn-this-node-is-locked-into-cluster-uuid-on-container-restart/333105 "2023-05-10T16:40:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruno44](https://avatars.discourse-cdn.com/v4/letter/b/e19adc/32.png) [@Bruno44](https://discuss.elastic.co/u/Bruno44)\
**Post date:** [May 10, 2023, 4:40pm UTC](https://discuss.elastic.co/t/elasticsearch-in-docker-warn-this-node-is-locked-into-cluster-uuid-on-container-restart/333105/1 "2023-05-10T16:40:55Z")

</div>

Hello,  
I use Elasticsearch 8.7.1 in an official Docker container.  
I export the data (/usr/share/elasticsearch/data/) to the host to keep indexing data.  
If I delete the container (for update for example), when I recreate it with the same configuration parameters, I see the following alert in the logs:  
`log.level": "WARN", "message":"this node is locked into cluster UUID [zRB-tYxKTzCKz19RMWeTng] but [cluster.initial_master_nodes] is set to [my-elasticsearch-01]; remove this setting to avoid possible data loss caused by subsequent cluster bootstrap attempts;`  
I specify that the "cluster.initial\_master\_nodes" parameter is not declared, neither in the elasticsearch.yml configuration file, nor in my docker-compose file.  
Here are the parameters I include in my docker-compose file:

```auto
      - discovery.type=single-node
      - node.name=my-elasticsearch-01
      - cluster.name=my-elastic-cluster
      - network.host=0.0.0.0
      - xpack.security.enabled=false
      - xpack.security.transport.ssl.enabled=false
      - xpack.license.self_generated.type=basic
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"

```

I notice that I don't get this alert if I don't export the data to the host or delete the data before recreating the container.  
I have the impression that it does not accept my old data.  
What is going on ?  
How do I get Elasticsearch to accept my old index data?

THANKS !

---

<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 11, 2023, 6:47am UTC](https://discuss.elastic.co/t/elasticsearch-in-docker-warn-this-node-is-locked-into-cluster-uuid-on-container-restart/333105/2 "2023-05-11T06:47:02Z")

</div>

> [@Bruno44](#):
>
> I specify that the "cluster.initial\_master\_nodes" parameter is not declared, neither in the elasticsearch.yml configuration file, nor in my docker-compose file.

It's declared somewhere. To avoid this warning, work out where and remove it.

---

<div class="post-metadata">

**Author:** ![Bruno44](https://avatars.discourse-cdn.com/v4/letter/b/e19adc/32.png) [@Bruno44](https://discuss.elastic.co/u/Bruno44)\
**Post date:** [May 11, 2023, 12:41pm UTC](https://discuss.elastic.co/t/elasticsearch-in-docker-warn-this-node-is-locked-into-cluster-uuid-on-container-restart/333105/3 "2023-05-11T12:41:45Z")

</div>

In the container: `grep "initial_master_nodes" /usr/share/elasticsearch/* -ral` returns nothing. I checked the environment variables in the image and in the container: no match either. My compose file does not contain this parameter. Is there any other place to look?

---

<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 11, 2023, 1:41pm UTC](https://discuss.elastic.co/t/elasticsearch-in-docker-warn-this-node-is-locked-into-cluster-uuid-on-container-restart/333105/4 "2023-05-11T13:41:05Z")

</div>

Not sure, sorry, Docker does make this kind of thing hard to track down. But Elasticsearch is seeing the value `my-elasticsearch-01` which definitely looks like something you've configured rather than something it might invent.

---

<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:** [June 8, 2023, 1:41pm UTC](https://discuss.elastic.co/t/elasticsearch-in-docker-warn-this-node-is-locked-into-cluster-uuid-on-container-restart/333105/5 "2023-06-08T13:41:15Z")

</div>

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