简体   繁体   English

Elasticsearch-添加节点而不复制吗?

[英]Elasticsearch - Adding node without replication?

I have a master/data Elasticsearch node. 我有一个主/数据Elasticsearch节点。 It has now reached 90% capacity and I need to provision additional space to continue adding more data. 现在它已达到90%的容量,我需要提供更多空间来继续添加更多数据。

I have created a new server with 700gb disk space, installed ES & Kibana, and now wish for this second server to provide additional space to / work with the master node. 我创建了一个具有700gb磁盘空间的新服务器,并安装了ES&Kibana,现在希望第二台服务器为主节点提供更多的空间来使用它。

My problem: 我的问题:

As it says on the ES website : 正如ES网站上所说:

When you add more nodes to a cluster, it automatically allocates replica shards. 当您将更多节点添加到群集时,它将自动分配副本分片。

My issue is that I do not wish to replicate the data from the master node, but instead just provide additional space using this second server which can then be queried by the master node. 我的问题是,我不想复制主节点上的数据,而只是使用第二个服务器提供额外的空间,然后由主节点查询。

My question: 我的问题:

What is the best way to achieve this? 实现此目标的最佳方法是什么? Is adding a node the incorrect thing to do here? 在此处添加节点是不正确的事情吗?

Using index-level shard allocation filtering , you can constrain a given index (or set of indexes) to stay on a given node (or set of nodes). 使用索引级分片分配过滤 ,可以约束给定索引(或索引集)以保留在给定节点(或节点集)上。

Simply run this: 只需运行以下命令:

PUT orders,orders_1,orders_2,orders_3,orders_4,orders_5/_settings
{
  "index.routing.allocation.require._name": "your-first-node-name"
}

Note that you can also use ._ip or ._host instead of ._name if you prefer. 请注意,如果愿意,也可以使用._ip._host代替._name

Then you can add a new node and let it join the cluster and nothing will rebalance, all your current shards will stay on your current node. 然后,您可以添加一个新节点,并使其加入群集,并且不会重新平衡,所有当前分片将保留在当前节点上。

And if you need to create a new index on the second node and want to make sure that it will stay on that node you can specify the same settings at index creation time: 并且,如果您需要在第二个节点上创建一个新索引,并希望确保它保留在该节点上,则可以在创建索引时指定相同的设置:

PUT new_orders
{
  "settings": {
      "index.routing.allocation.require._name": "your-second-node-name"
  }
}

The index called new_orders will be created on the second node and stay there. 名为new_orders的索引将在第二个节点上创建并保持在那里。

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

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