Hi again,
I tried the minimum_master_nodes method, but still it takes a lot of time reassigning shards once the rebooted server comes back up.
In my two-node test cluster (fewer shards, but enough to take a minute to reassign on rebooting on of the nodes) here is what I set before rebooting one of them:
/_cluster/settings?pretty
{
"persistent" : {
"discovery" : {
"zen" : {
"minimum_master_nodes" : "2"
}
}
},
"transient" : {
"cluster" : {
"routing" : {
"allocation" : {
"enable" : "none"
}
}
}
}
}
and I have the following health:
/_cluster/health?pretty
{
"cluster_name" : "mycluster",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 2,
"number_of_data_nodes" : 2,
"active_primary_shards" : 160,
"active_shards" : 320,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0
}
I then reboot one of the nodes, and until restarted I just get the 'master not discovered' error message when attempting to run the health command, which is what I expect.
Once the other node comes up, health shows:
/_cluster/health?pretty
{
"cluster_name" : "mycluster",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 2,
"number_of_data_nodes" : 2,
"active_primary_shards" : 160,
"active_shards" : 160,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 160
}
note that number of unassigned_shards is 160.
then enabling shard allocation again with:
/_cluster/settings -d '{"transient" : {"cluster.routing.allocation.enable" : "all"}}'
the shards start getting assigned, slowly, 2 at a time.
This isn't what I want, when the rebooted node rejoins the cluster I want the cluster to recognize that the rejoining node already has the shards assigned to it, that nothing is changed, and that there's no need to spend all this time reallocating them. There should be no need to copy shards between servers.
Is this possible?