博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ElasticSearch 同步副本方式
阅读量:5931 次
发布时间:2019-06-19

本文共 3156 字,大约阅读时间需要 10 分钟。

hot3.png

ElasticSearch 同步副本方式 博客分类: 搜索引擎,爬虫
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

 

   

转载于:https://my.oschina.net/xiaominmin/blog/1599285

你可能感兴趣的文章
基于Apache axis2开发Java Web服务
查看>>
js活jQuery实现动态添加、移除css/js文件
查看>>
源码学习-Tomcat-02-一个简单的Servlet容器
查看>>
reactnative(2) - Navigator 使用案例
查看>>
《3+1团队》【Beta】Scrum meeting 1
查看>>
nyoj 740 “炫舞家“ST
查看>>
Generating WCF Proxy using SvcUtil.exe
查看>>
[转] HTML5中meta属性的使用详解
查看>>
sicily 1828 Minimal(dp)
查看>>
KMP算法
查看>>
CS100 Homework
查看>>
CPU选择intel还是amd
查看>>
【嵌入式开发】嵌入式 开发环境 (远程登录 | 文件共享 | NFS TFTP 服务器 | 串口连接 | Win8.1 + RedHat Enterprise 6.3 + Vmware11)...
查看>>
C++读取配置文件
查看>>
Oracle sql中start with,connect by伪语句用法
查看>>
493. Reverse Pairs
查看>>
Deep learning:四十(龙星计划2013深度学习课程小总结)
查看>>
无符号整型指定比特位置1
查看>>
枚举\位域\结构综合实验
查看>>
MySQL出错:ERROR 1045 (28000)的解决方法
查看>>