DistributededitThe index operation is directed to the primary shard based on its route (see the Routing section above) and performed on the actual node containing this shard. After the primary shard completes the operation, if needed, the update is distributed to applicable replicas.Write ConsistencyeditTo prevent writes from taking place on the "wrong" side of a network partition, by default, index operations only succeed if a quorum (>replicas/2+1) of active shards are available. This default can be overridden on a node-by-node basis using the action.write_consistency setting. To alter this behavior per-operation, the consistency request parameter can be used.Valid write consistency values are one, quorum, and all.Note, for the case where the number of replicas is 1 (total of 2 copies of the data), then the default behavior is to succeed if 1 copy (the primary) can perform the write.The index operation only returns after all active shards within the replication group have indexed the document (sync replication).
replicationThe default value for replication issync.This causes the primary shard to wait for successful responses from the replica shards before returning.If you set replication to async, it will return success to the client as soon as the request has been executed on the primary shard. It will still forward the request to the replicas, but you will not know whether the replicas succeeded.This option is mentioned specifically to advise against using it. The defaultsync replication allows Elasticsearch to exert back pressure on whatever system is feeding it with data. Withasync replication, it is possible to overload Elasticsearch by sending too many requests without waiting for their completion.复制复制的缺省值是sync。在这种设定下,原始切片返回前,需要等待副本先返回。如果把replication设置为async,请求在原始切片上的执行成功后会立即返回成功给客户端。这种设定下,请求仍然会转发给副本,但是客户端不知道副本上是否成功。此选项特别建议,不要使用它。缺省的同步复制选项可以使Elasticsearch把压力反馈给客户端程序。异步复制的话,有可能使Elasticsearch过载。consistencyBy default, the primary shard requires aquorum, or majority, of shard copies (where a shard copy can be a primary or a replica shard) to be available before even attempting a write operation. This is to prevent writing data to the “wrong side” of a network partition. A quorum is defined as follows:int( (primary + number_of_replicas) / 2 ) + 1The allowed values for consistency areone (just the primary shard),all (the primary and all replicas), or the default quorum, or majority, of shard copies.Note that the number_of_replicas is the number of replicasspecified in the index settings, not the number of replicas that are currently active. If you have specified that an index should have three replicas, a quorum would be as follows:int( (primary + 3 replicas) / 2 ) + 1 = 3But if you start only two nodes, there will be insufficient active shard copies to satisfy the quorum, and you will be unable to index or delete any documents.一致性缺省的,即使尝试一个写操作,原始切片也需要“法定人数”的拷贝就绪。这是为了防止把数据写到“错误的网络区域”。
http://blog.csdn.net/silent1/article/details/44590657
https://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-index_.html