1

I know how copy an index in one server with Reindex API but now there are two servers (Elastic A and Elastic B) on two separated hosts like this:

Elastic A 
 |_ index a1
 |_ index a2

and

Elastic B 
 |_ index b1
 |_ index b2

I need to copy a1 to Elastic B and finally it's like this:

 Elastic B 
 |_ index b1
 |_ index b2
 |_ index a1

How can I do this? I'm waiting for any suggestion. Thanks, Mohammad.

mohammad asghari
  • 1,817
  • 1
  • 16
  • 23

2 Answers2

3

In order to force one index onto a given host you can use shard allocation filtering

PUT a1/_settings
{
  "index.routing.allocation.require._host": "ElasticB"
}

However, just note that if you do this and your index a1's shards have replicas, the replicas won't be assigned to any host and your cluster will be yellow.

Val
  • 207,596
  • 13
  • 358
  • 360
1

You can configure routing per attributes. But then you should have "logical" group of nodes

For instance you have some indexes which are archived you can move them to other machine since you know that you dont have to write very often so those machines could be a bit slower

PUT a1/_settings
{
  "routing.allocation.include.box_type": "archive",
}

Then assign attribute to nodes to your node inside of elasticsearch.yml

node.attr.box_type: archive
Vova Bilyachat
  • 18,765
  • 4
  • 55
  • 80