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

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:

      - discovery.type=single-node
      - node.name=my-elasticsearch-01
      - cluster.name=my-elastic-cluster
      - network.host=
      - 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?


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

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?

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.

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