How to setup a cluster from scratch

Hi,

I have been using elasticsearch for a long time. Our initial cluster was setup in 5.x days (installation procedures have been 'lost') and we have performed rolling upgrade ever since. Currently the cluster is 8.8 with no security (It is on an isolated firewalled network segment).

Recently I tried to setup a new multi node cluster (3 master + 2 data) from scratch for ES 8.6 and I couldn't figure out the correct order in which nodes should be started/configured/installed

The setup I have in mind is 3 masters esmaster[123] (10.0.0.1,2,3) and 2 data esdata[12] (10.0.0.11,12)

I tried to do something like

  • Install elasticsearch on esmaster1.
  • Set node.roles to master and set cluster.initial_master_nodes to [10.0.0.1].

It started OK but since primary shards are unallocated, I cannot run any query (_cat/nodes) or generate enrollment token for other nodes

Do I set the role to default (data + master) on this node, then add further nodes (using the generated token) and then take away the data role from esmaster1? Or is there some other ways by which I can go about the cluster building phase?

I am really sorry for this basic question but I cannot find the answer in the docs.

You need to configure your 3 master nodes and 1 data node and start them at basically the same time, after that you can add the other data node, but there is no issue if you configure all your nodes and start them at the same time.

But how to do that without enrollment token?

Not sure how to do it using enrollment tokens, never used it, I always spin-up clusters using the traditional way where you configure the elasticsearch.yml file and start your cluster.

In the traditional way you basically just configure the cluster initial master nodes, the SSL certificates for the transport protocol communication and start your node.

If it helps I made a small tutorial on how to spin-up a 3 node cluster on version 8 that you can find here.

Thanks for the link. It helps in understanding the startup process.

I think enrollment tokens are supposed to automate this workflow but not sure how they would be used in this scenario.

As a separate question, when certificates (esp CA ones expire) how do we refresh them in entire cluster?

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