简体   繁体   English

Elasticsearch:范围索引中的数据本身

[英]Elasticsearch: Scope data in index to itself

I am trying to keep data in a certain index local to itself. 我试图将数据保存在本地的特定索引中。 I am wondering which elasticsearch setting do I need to apply in order to do so. 我想知道我需要应用哪种弹性搜索设置。 Specifically, I would like the data in my index to NOT replicate to other nodes. 具体来说,我希望索引中的数据不复制到其他节点。

Rephrase the question: Is there a way to keep data in an index local to itself (for ALL nodes)? 重新表述问题:是否有办法将数据保留在其自身的本地索引中(对于所有节点)?

node1 --> foobar_index ---> {"data" : "asdf"} node1-> foobar_index ---> {“ data”:“ asdf”}

node2 --> foobar_index ---> {"data" : "qwerty"} node2-> foobar_index ---> {“ data”:“ qwerty”}

node3 --> foobar_index ---> {"data" : "zxcv"} node3-> foobar_index ---> {“ data”:“ zxcv”}

If you want to simply not replicate your indices, ie have a shard present on only one node, you can set the number of replicas to 0. Beware, though, that if one of your nodes goes down or gets corrupted, you might lose data. 如果您只想不复制索引,即仅在一个节点上存在一个碎片,则可以将副本数设置为0。但是请注意,如果您的某个节点发生故障或损坏,则可能会丢失数据。

curl -XPUT 'localhost:9200/foobar_index/_settings' -d '
{
    "index" : {
        "number_of_replicas" : 0
    }
}'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM