簡體   English   中英

我們正在丟失彈性搜索集群中的數據

[英]we are losing data in elastic search cluster

我們使用 ElasticSearch 制作了一個 poc,但是在這樣做時,我們在集群環境中丟失了數據。 我們使用 ES 2.4.0。

誰能說我們缺少什么?

我們的場景是:

  1. 使用以下配置打開 Elastic Server-1 和 Server-2,它們在一個集群中。

  2. Server-1 上的索引文檔:

    curl -XPUT '20.20.20.5:9200/ert/post/1' -d ' { "user": "easlan", "postDate": "01-16-2015", "body": "在 ElasticSearch 集群中添加數據" , "title": "ElasticSearch 集群測試 - 1" }'

  3. 在 Server-1 或 Server-2 上查找索引文檔:結果總數為 1(如預期):

    curl -XGET '20.20.20.5:9200/ert/post/_search?q=user:easlan&pretty=true' curl -XGET '20.20.20.6:9200/ert/post/_search?q=user:easlan&pretty=true'

  4. 然后關閉 Server-1

  5. 在 Server-2 上索引新文檔:

    curl -XPUT '20.20.20.6:9200/ert/post/2' -d ' { "user": "easlan", "postDate": "01-16-2015", "body": "在 ElasticSearch 集群中添加數據" , "title": "ElasticSearch 集群測試 - 2" }'

  6. 在 Server-2 上查找索引文檔:結果總數為 2:

    curl -XGET '20.20.20.6:9200/ert/post/_search?q=user:easlan&pretty=true'

  7. 關閉 Server-2

  8. 打開服務器-1

  9. 在 Server-1 上查找索引文檔:結果總數為 1(正如預期的那樣,因為 server-2 已關閉):

    curl -XGET '20.20.20.5:9200/ert/post/_search?q=user:easlan&pretty=true'

  10. 然后再次打開 Server-2。 在 Server-1 或 Server-2 上查找索引文檔。 我們希望看到的結果總數為 2,但當我們查看時,結果為 1。 即使我們再次重新啟動其中的兩個,結果仍然是 1:

    curl -XGET '20.20.20.5:9200/ert/post/_search?q=user:easlan&pretty=true' curl -XGET '20.20.20.6:9200/ert/post/_search?q=user:easlan&pretty=true'

我們的配置:

*** Server-1 ****
cluster.name: ESCluster
node.master: true
node.name: "es1"
node.data: true
network.bind_host: ["127.0.0.1","20.20.20.5"]
network.publish_host: "20.20.20.5"
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["20.20.20.5","20.20.20.6"]
discovery.zen.minimum_master_nodes: 1

*** Server-2 ****
cluster.name: ESCluster
node.master: true
node.name: "es2"
node.data: true
network.bind_host: ["127.0.0.1","20.20.20.6"]
network.publish_host: "20.20.20.6"
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["20.20.20.5","20.20.20.6"]
discovery.zen.minimum_master_nodes: 1

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM