Detach node from a cluster in docker

Hello everyone!

I have a little question about the elasticsearch-node tool: Is it possible to use it in any way to detach a node from a cluster that exists in a docker container?

So far the tool throws an exception that a node cannot be detached if it is still running, which sounds reasonable. I tried shutting down the node inside the container, but it results in the container being shut down.

Thanks in advance for your answers!

Welcome to our community! :smiley:

What are you trying to achieve with this?

Hi Mark.
Because i lost all master nodes and want recollect cluster.

If you have lost all masters then you have lost the cluster, there is no recovering unless you have a backup.

But all my data nodes are still alive. And i suppose that this command can help to me to add my fata node to new mater node.
"elasticsearch-node detach-cluster"

You cannot attach a data node to a new master. If you have lost all master nodes and can not bring them back up you need to recreate the cluster and restore data from a snapshot.

I don't have any backup.
And this article says me that i can try to restore my data

But i can't run this command from docker container.

Can't you attach to the container in order to run the command?

To run command i need stop elasticsearch service. But when i stopping service docker container is closed...

Ah yes, that is true. Then I do not think you can recover the data in the cluster.

 docker run --name detach -p 9200:9200 -p 9300:9300 -v /your_volume_with_elastic_data -v /your__elastic_config -it **--entrypoint /bin/bash** elasticsearch:7.10.1

This right command to run docker. After that you can run bin/elasticsearch-nodes detach-cluster or other similar commands.

1 Like

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