How to avoid long distance relocation with i.r.allocation.require.disk and node.attr.datacenter

Hello!

I’m going to build a cluster with primaries in DC1 and a replicas in DC2 (separated via node.attr.datacenter). After 30days, i.r.allocation.require.disk changes from ssd to hdd and the shards are moved. How can I ensure that the relocation happens within each datacenter to avoid cross-datacenter traffic?

I haven’t found it in docs and I’m not sure how or if this is enforced.

best regards,
maaax

Have you tried shard allocation forced awareness:

cluster.routing.allocation.awareness.attributes: zone
cluster.routing.allocation.awareness.force.zone.values: zone1,zone2

, I think these settings can prevent shard relocation across zones.

Thx! I will try!