Check that the versions of ElasticSearch on each node are the same. If they are not, then ES will not allocate replica copies of the index to 'older' nodes.
Using @Alcanzar's answer, you can get some diagnostic error messages back:
curl -XPOST 'http://localhost:9200/_cluster/reroute?pretty' -d '{
"commands": [
{
"allocate": {
"index": "logstash-2016.01.31",
"shard": 1,
"node": "arc-elk-es3",
"allow_primary": true
}
}
]
}'
result is:
{
"error" : "ElasticsearchIllegalArgumentException[[allocate] allocation of
[logstash-2016.01.31][1] on node [arc-elk-es3]
[Xn8HF16OTxmnQxzRzMzrlA][arc-elk-es3][inet[/172.16.102.48:9300]]{master=false} is not allowed, reason:
[YES(shard is not allocated to same node or host)]
[YES(node passes include/exclude/require filters)]
[YES(primary is already active)]
[YES(below shard recovery limit of [2])]
[YES(allocation disabling is ignored)]
[YES(allocation disabling is ignored)]
[YES(no allocation awareness enabled)]
[YES(total shard limit disabled: [-1] <= 0)]
*** [NO(target node version [1.7.4] is older than source node version [1.7.5]) ***
[YES(enough disk for shard on node, free: [185.3gb])]
[YES(shard not primary or relocation disabled)]]",
"status" : 400
}
How to determine the version number of ElasticSearch:
adminuser@arc-elk-web:/var/log/kibana$ curl -XGET 'localhost:9200'
{
"status" : 200,
"name" : "arc-elk-web",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "1.7.5",
"build_hash" : "00f95f4ffca6de89d68b7ccaf80d148f1f70e4d4",
"build_timestamp" : "2016-02-02T09:55:30Z",
"build_snapshot" : false,
"lucene_version" : "4.10.4"
},
"tagline" : "You Know, for Search"
}
In my case, I setup the apt-get
repository incorrectly and they got out of sync on the different servers. I corrected it on all the servers with:
echo "deb http://packages.elastic.co/elasticsearch/1.7/debian stable main" | sudo tee -a /etc/apt/sources.list
and then the usual:
sudo apt-get update
sudo apt-get upgrade
and a final server reboot.