ElasticSearch clone the cluster from existing

I have 2 nodes ES cluster(on GCP platform), I want to clone this and need to create a new cluster.

I have taken the image of the current Node1 and 2 then create the VMs.

Then modified these settings as per the new cluster on the elasticsearch.yml file.

discovery.seed_hosts
cluster.initial_master_nodes
network.host
node.name

Then started the Elasticsearch service. Node 2 is started(but in red), and Node 1 started but giving this error.

[172.0.0.2]  no known master node, scheduling a retry
[172.0.0.2] master not discovered or elected yet, an election requires a node with id [b6ayR48yTHq6cBvdugYWKA], have discovered [{172.0.0.2}{XdhyvbwLQQWBiawK4BX0Ag}{rcJ4blk5Tz2PZuEiViirNg}{172.0.0.2}{172.0.0.2:9300}{dim}] which is not a quorum; discovery will continue using [172.0.1.2:9300] from hosts providers and [{172.0.0.2}{XdhyvbwLQQWBiawK4BX0Ag}{rcJ4blk5Tz2PZuEiViirNg}{172.0.0.2}{172.0.0.2:9300}{dim}] from last-known cluster state; node term 31, last-accepted version 15139 in term 31

Not sure how to solve this.

when you clone you mean copy everything including data dir of elastic?

I believe when you did that uuid is wrong. because hostname/ip etc.. are different.

best thing you could do to clone is startup new cluster (new name/ip etc..) and then copy all index (snapshot/restore)

1 Like

Yes I copied everything. I don't how Node 2 was running fine.

That is not a supported way to set up a cluster. You should set up a brand new cluster and import data via snapshot and restore.

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