Not enough active copies to meet write consistency of [QUORUM] (have 2, needed 3)

I am using Elasticsearch 1.7.x, and am getting this error

ERROR: 503 RemoteTransportException[[secondary][inet[/]][indices:data/write/bulk[s]]]; nested: UnavailableShardsException[[pulse20160225_224749][2] Not enough active copies to meet write consistency of [QUORUM] (have 2, needed 3). Timeout: [1m], request: org.elasticsearch.action.bulk.BulkShardRequest@411a4081];  (and 29 others) while loading line id=bb.73260:7325705.2 into index "pulse20160225_224749":

I have 3 replicas declared for this index, and obviously not all of them are available. I am fine with there being only one copy of a shard on the cluster for extended periods. (FYI replication takes hours over a slow connection, which I am fine with).

I have tried

[ec2-user@ip-172-31-0-80 ~]$ curl -XPUT http://localhost:9200/pulse20160225_224749/_settings -d"{\"index.recovery.initial_shards\": 1}"

and, I have tried

[ec2-user@ip-172-31-0-80 ~]$ curl -XPUT http://localhost:9200/_cluster/settings -d"{\"persistent\": {\"index.recovery.initial_shards\": 1}}"

but both do nothing. What am I doing wrong?


The index.recovery.initial_shards setting that you were modifying is only used during cluster startup to decide if cluster saw enough copies of the shard to start recovery. I think the setting that you are looking for is "write consistency". By default, if you the cluster is supposed to have 3 copies of a shard, any write operation against this shard will not take place unless you have at least 2 copies of this shard available. If you don't care about the number of available copies, just set it to one.