0
votes

I am using elasticsearch 0.90.0 in my production environment. Currently, I am using only a single server (along with jetty plugin to restrict write access).

Now I want a cluster of two servers consisting of one old server (with data) and one new server. Now, I need my data on both of my servers, so that in case if anyone of them fails, data can be fetched from another. What should I do? Will the normal configuration work? Can I copy data folder from one server to another and expect it to work properly when placed in a cluster? Or should I clone elasticsearch folder itself on my second machine?

By normal configuration, I mean this:-

cluster.name: elasticsearch
node.name: "John"
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: []

Please help!

1
If you have the default configuration, your node should be setup with one replica. If you add another node, the replica shards of your indexes should be automatically copied over to the new cluster node, thus offering you failover capability. Have a read here on more about this.Andrei Stefan
That means, I don't need to copy my data manually. But if I do, will it help to speed up syncing process of nodes?Prakhar Mishra
Your nodes will be managed by ES. That means ES will take care of copying, syncing and searching across nodes/shards/replicas. What ES does is more than just copying, is automatic failover, automatic syncing, automatic balancing of load.Andrei Stefan

1 Answers

0
votes

You should not have to copy data manually.

If you kept the default settings, adding one more node to the cluster should trigger :

  • creation of one replica by existing shard on your new node
  • rebalancing of the primary shards between your two nodes

You will have to add the adresses of your nodes as hosts as you have enabled unicast communication.

I recommend you to make some tests with ElasticSearch instances on your personal computer in order to check this behavior.