From three-node cluster to single-node

Hello guys,

I would like to know if there is any way to deploy a cluster node in an isolated way creating a new separated cluster.

The use case is the following, consider I have a three-node cluster with all data fully replicated, and I want to go from this deployment to a single deployment, with any of these nodes. A valid reason for this could be data synchronization problems between the nodes in the cluster.

Do you know if there is any configuration option or guideline for this?

Thank you in advance.

Hi @versatildefuy Felipe,

Where are you from?, I am from Castellon/Spain.

We took your question and decided it was great, so we will cover it with a tutorial/guide. I started working on it. It is a draft but soon we should have something useful. You can follow it, if you are interested, in https://github.com/crate/crate-tutorials/pull/2 .

How big is your data?

Saludos!

Hi Miguel, nice to meet you :smiley:

I am from Murcia/Spain.

I will follow your tutorial trying to provide some feedback.

Thank you for your response and your time creating the tutorial.

Hola Felipe,

Next door!, we had a fantastic weather this weekend.
Excellent, I would appreciate it!

Will keep you updated.

Hello Miguel,

I have been reading your tutorial and I found this interesting link in the documentation that I think is related.

For what I understood, the idea is to force the old master node to perform the bootstrap process again. My problem now is that I am deploying the cluster with docker and when I try to execute cluster-node inside a container the following error is thrown:

bootstrap_crate-node.1.jqv6b8in47v3@ns305208    | Error: Could not find or load main class org.elasticsearch.cluster.coordination.NodeToolCli
bootstrap_crate-node.1.jqv6b8in47v3@ns305208    | Caused by: java.lang.ClassNotFoundException: org.elasticsearch.cluster.coordination.NodeToolCli

Do you know how can I execute crate-node inside a docker container? Am I doing something wrong?

This is the docker-compose file I’m using:

version: '3.3'

services:

  crate-node:
    image: crate:4.0
    ports:
      - target: 4200
        published: 4200
        protocol: tcp
        mode: host
      - target: 4300
        published: 4300
        protocol: tcp
        mode: host
      - target: 5432
        published: 5432
        protocol: tcp
        mode: host
    volumes:
      - crate-data:/data
    command: ["crate-node", "unsafe-bootstrap"]

Thank you in advance

Hi Felipe,

On it.

Will get back asap

Hola Felipe,

It is related to the 4.0.12 release, I have created a tracker
https://github.com/orgs/crate/projects/1#card-32999853

update: there is a PR in place https://github.com/crate/crate/pull/9655
as soon as it is merged the docker images will be rebuilt, pushed.

I will back to you when that happens.

Best regards,

Hola Miguel,

thank you very much for your efforts.

I tried to follow the tutorial with docker crate:4.0.10 and it worked.

These are the commands I used to detach and force the bootstrapping:

docker run -it -v "$(pwd)/crate-data:/data" crate:4.0.10 crate-node unsafe-bootstrap -Cpath.home=/crate -Cpath.conf=/crate/config
docker run -it -v "$(pwd)/crate-data:/data" crate:4.0.10 crate-node detach-cluster -Cpath.home=/crate -Cpath.conf=/crate/config

After that I started the docker image with single-node configuration and a new cluster have been created.

I also tried to create a new cluster with the nodes that were in the first clúster and everything worked fine.

Hola Felipe,

Excellent, I am happy to hear.