Roma Rush
Roma Rush

Reputation: 4167

Elasticsearch nodes balancing

I have elasticsearch cluster with 4 nodes (ES 1.3.5):

1x c4.xlarge client node

master: false

data: false

3x of c4.xlarge

master: true

data: true

index.number_of_shards: 1

index.number_of_replicas: 2

discovery.zen.minimum_master_nodes: 2

App sends requests to the client node that should load-balance them to different cluster nodes (as i understand). But seems that only one cluster node (that picked as master) handling queries and taking all load.

enter image description here

How to balance this load to all nodes?

Upvotes: 1

Views: 2034

Answers (2)

Tejus Prasad
Tejus Prasad

Reputation: 6500

There are a few things that you can do to load-balance, but i'm also providing some steps improve the performance because just load-balancing will not give you efficiency(and i assume thats why you have a question about load balance).

  • Increase the number of shards because you need to have a minimum 4 shards because you have 4 nodes(shard=unit at which Elasticsearch distributes data around the cluster).
  • Look into the shard size and adjust and make changes as required (few GB to a few tens of GBs)
  • Ideally you need to allocate shards with a factor of 1.5 to 3 times the number of nodes in your initial configuration

Just for reference i'm providing a related and useful article from the creator of Elastic Search - https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster

Upvotes: 4

Pierre-Nicolas Mougel
Pierre-Nicolas Mougel

Reputation: 2279

You should increase your number of shard. One shard means that a single node will hold all your index. Consequently, when a query is sent, only a single node will handle the query.

Upvotes: 2

Related Questions