Elasticsearch Cluster, how to create 2 data nodes single node to primary shards and the other to replica?

Elasticsearch Cluster, what is the best configuration to create 2 data nodes single node to primary shards and the other to replica??

Elasticsearch will try to balance the shards, irrespective of if they are primary or replica.

@warkolm you mean that 2 nodes have the same configuration as data-node and elasticsearch balance replica by default

It balances all shards, irrespective of if they are primary or replica.

@warkolm OK but I need to create replica indecies in another data-node how I configure it?

Can you help me?

The only way to do that is to manually reassign/reroute shards and manually manage allocation.

We don't recommend doing this.

@warkolm OK but in case single data node is down what is the best solution to get data contained into this indecies?

Can you rephrase that please? I don't understand what you mean.

@warkolm sorry I mean that if data node is down what about data saved into indecies of this node

If you have a single node cluster, then you have no redundancy.

If you have 2 nodes, then your primary and replica shards will be assigned across both nodes in the cluster. So if one node goes down (doesn't matter which one), then the other node still has a complete copy of the data and you don't lose anything.

However we recommend a minimum of 3 nodes in a cluster, see here

@warkolm cluster with 3 master node and 2 data nodes contains all the same indexes and all of nodes master and data nodes included into the same AWS VPC
Is this the best cluster design??

The best depends on how much data you have, what sort of use case, etc etc.

I would probably start with 3 nodes, that are both master eligible and data nodes.

@warkolm OK I understand this
But if three nodes work as master and data, I think the three nodes should have highly specs ex. 32G RAM isn't it?

How much data is it?
What sort of data?
What sort of queries?

@warkolm At least 5G logs by day and queries aggregations to get data analytics
We have more indexes at least 50 index and retention is annually

Then you might need those at some point, but not immediately.

@warkolm you means we need to start with low specs and scale later due to data?

Yes.

@warkolm Very very thanks I will start to build our cluster and if I have any questions I will mention you back :pray: sorry for headache my buddy :wink::heart:

May I suggest you look at the following resources about sizing:

https://www.elastic.co/elasticon/conf/2016/sf/quantitative-cluster-sizing

And https://www.elastic.co/webinars/using-rally-to-get-your-elasticsearch-cluster-size-right

1 Like