Dynamically adding a replica node doesn't do anything

(Flavio Pompermaier) #1

Hi to all,
I was playing with ES in order to test dynamic scaling. I have a working cluster with some indices and I want to start replicating one of them. I tried to use curl -XPUT 'master-node:9200/my_index/_settings' -d '{ "index" : { "number_of_replicas" : 1}}' but the other node doesn't start syncing the data.
I tried also with number_of_replicas = 2 but the replica node doesn't download anything but the _state folder for each index.

Am I doing something wrong or is it normal? I tried also to force the flush through my_index/_flush/synced but nothing happens..

(Mark Walkom) #2

There's no such thing as a replica node, ES balances the shards (primary or replica) across all nodes in the cluster.

(Flavio Pompermaier) #3

So there's no way to force ES to start replicating an index in the cluster once I need it?

(Mark Walkom) #4

Yes, you can add a replica to an index if it doesn't exist.

(Flavio Pompermaier) #5

So why in my test cluster the added node didn't start synchronizing the data from the master?

(David Pilato) #6

Did the node join the cluster?

(Flavio Pompermaier) #7

Yes, it did. When the node join the cluster it creates all indexes folders in the data directory but they stay empty (except for the _state directory).

(David Pilato) #8

Did you change elasticsearch settings? May be your node is a master node only?

(system) #9