返回介绍

PART Ⅰ : 容器云OPENSHIFT

PART Ⅱ:容器云 KUBERNETES

PART Ⅲ:持续集成与持续部署

PART Ⅴ:日志/监控/告警

PART Ⅵ:基础

PART Ⅶ:数据存储、处理

PART VIII:CODE

PART X:HACKINTOSH

PART XI:安全

数据的路由分配

发布于 2024-06-08 21:16:46 字数 3023 浏览 0 评论 0 收藏 0

2、给节点打上标签

elasticsearch.yml

node.attr.size: medium

或启动命令

./bin/elasticsearch -Enode.attr.size=medium

3.

PUT test/_settings
{
  "index.routing.allocation.include.size": "big",
  "index.routing.allocation.include.rack": "rack1"
}

4.

](https://github.com/elastic/elasticsearch/edit/7.5/docs/reference/index-modules/allocation/filtering.asciidoc)

  • index.routing.allocation.include.{attribute}`**

    Assign the index to a node whose {attribute} has at least one of the comma-separated values.

  • index.routing.allocation.require.{attribute}

    Assign the index to a node whose {attribute} has all of the comma-separated values.

  • index.routing.allocation.exclude.{attribute}

    Assign the index to a node whose {attribute} has none of the comma-separated values.

内置的attribute:

_nameMatch nodes by node name
_host_ipMatch nodes by host IP address (IP associated with hostname)
_publish_ipMatch nodes by publish IP address
_ipMatch either _host_ip or _publish_ip
_hostMatch nodes by hostname
_idMatch nodes by node id
PUT test/_settings
{
  "index.routing.allocation.include._ip": "192.168.2.*"
}

5.

PUT loginmac-201905/_settings
{
  "index": {
    "routing": {
      "allocation": {
        "require": {
          "box_type": "warm"
        }
      }
    }
  }
}

6.

POST /_cluster/reroute
{
  "commands": [
    {
      "move": {
        "index": "loginmac-201905",
        "shard": 2,
        "from_node": "node-248",
        "to_node": "node-12"
      }
    }
  ]
}
  1. https://www.elastic.co/guide/en/elasticsearch/reference/7.5/shard-allocation-filtering.html

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文