欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

Elasticsearch寫一致性在5.x版本之后已經(jīng)被廢棄掉

1 問題緣由

最近繼續(xù)在探索es的更多內(nèi)容,查閱了相關(guān)資料(包括博客文章跟其它一些教程),學(xué)習(xí)到寫一致性原理的相關(guān)知識(shí),其本身并不難理解,但是一定要在實(shí)踐中經(jīng)過驗(yàn)證才會(huì)有更深的體會(huì),就像在項(xiàng)目過使用過es做各種聚合統(tǒng)計(jì)搜索分析,跟沒使用過,差別還是很大的。
于是在es 5.4的版本上進(jìn)行測(cè)試:

創(chuàng)新新互聯(lián),憑借十多年的成都網(wǎng)站制作、成都網(wǎng)站設(shè)計(jì)經(jīng)驗(yàn),本著真心·誠心服務(wù)的企業(yè)理念服務(wù)于成都中小企業(yè)設(shè)計(jì)網(wǎng)站有上千案例。做網(wǎng)站建設(shè),選創(chuàng)新互聯(lián)公司

PUT myblog/article/1?consistency=all
{
  "title":"test"
}

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "request [/myblog/article/1] contains unrecognized parameter: [consistency]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "request [/myblog/article/1] contains unrecognized parameter: [consistency]"
  },
  "status": 400
}

可以看到并不能識(shí)別consistency,然后我繼續(xù)使用5.2、5.6和老版本1.7進(jìn)行測(cè)試,發(fā)現(xiàn)5.x的版本都是不行的,但是1.7的可以。所以想到很有可能寫一致性在es 5.x版本之后應(yīng)該是已經(jīng)廢棄掉的。
于是上網(wǎng)查找一下資料,搜索出來的結(jié)果,文檔竟然幾乎都是來自同一份源文檔,基于es 5.2的版本,但是卻還是把這個(gè)寫一致性帶上。
所以沒有辦法,只能查閱官方文檔。

2 寫一致性在es 5.x版本已經(jīng)廢棄掉

官方文檔對(duì)于es 5.x的變化說明如下:
writeConsistencyLevel removed on write requestsedit
In previous versions of Elasticsearch, the various write requests had a setWriteConsistencyLevel method to set the shard consistency level for write operations. However, the semantics of write consistency were ambiguous as this is just a pre-operation check to ensure the specified number of shards were available before the operation commenced. The write consistency level did not guarantee that the data would be replicated to those number of copies by the time the operation finished. The setWriteConsistencyLevel method on these write requests has been changed to setWaitForActiveShards, which can take a numerical value up to the total number of shard copies or ActiveShardCount.ALL for all shard copies. The default is to just wait for the primary shard to be active before proceeding with the operation. See the section on wait for active shards for more details.

This change affects IndexRequest, IndexRequestBuilder, BulkRequest, BulkRequestBuilder, UpdateRequest, UpdateRequestBuilder, DeleteRequest, and DeleteRequestBuilder.

可以查看:https://www.elastic.co/guide/en/elasticsearch/reference/5.6/breaking_50_java_api_changes.html#_writeconsistencylevel_removed_on_write_requests

3 es 6.x?

后續(xù)在es 6.x是否還會(huì)有其它變化?
當(dāng)然目前我不會(huì)去查閱es 6.x的相關(guān)資料,因?yàn)楣疽仓皇莿倧膃s 1.x 2.x升級(jí)到5.6,并且很大一部分項(xiàng)目還是使用舊的,所以目標(biāo)很明確,后面更多是會(huì)關(guān)注es 5.x版本的,因?yàn)闀r(shí)間精力都是十分有限的。
就像現(xiàn)在spark已經(jīng)是2.x了,但是由于公司使用的最新版本是1.6.3,所以對(duì)于spark,我個(gè)人的精力,包括spark的開發(fā)習(xí)慣,也都還是基于spark 1.6的。
當(dāng)然,后續(xù)也肯定會(huì)把精力放到新的版本上。

分享標(biāo)題:Elasticsearch寫一致性在5.x版本之后已經(jīng)被廢棄掉
本文URL:http://www.chinadenli.net/article4/pespie.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站改版商城網(wǎng)站面包屑導(dǎo)航網(wǎng)站營銷虛擬主機(jī)網(wǎng)站設(shè)計(jì)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都app開發(fā)公司