The requested URL was not found on this server. 不管你信不信,反正我是没找到

node属性(tag)如何设置,查资料看到了好几种方法很混乱

Elasticsearch | 作者 Loading Zhang | 发布于2018年04月04日 | 阅读数:4955

为了将数据冷热分离,要给node设置属性,网上查了半天看到有好几种设置的方法,查阅官方文档也没有明确的章节有所说明那些可不可用。罗列一下我查到的几种:
  1. 官方文档上看到的根据node大小分:Shard allocation filtering。在启动是加参数node.attr.size,然后在索引里面设置"index.routing.allocation.include.size"
  2. 网上看到较多的是设置node.tag,然后在索引里面设置index.routing.allocation.include.tag
  3. 还有点elastic blog里面看到的node.attr.box_type,然后在索引里设置index.routing.allocation.require.box_type。“Hot-Warm” Architecture in Elasticsearch 5.x|

可能还有其他的,暂时想不起来了...
请问这三种是否都可以使用,有没有什么区别,还是说node.attr.xxx是可以自己定义的?
已邀请:

yayg2008

赞同来自:

tag,分为设置跟使用。
设置的话,在elasticsearch.yaml里面加,也可以在启动命令上加,名字可以自己取。eg: node.attr.disk: ssd  ,自定义disk属性,标识该节点磁盘类型为ssd。
使用就更方便了,
PUT test/_settings
{
"index.routing.allocation.include.disk": "ssd"
}

官方文档:
https://www.elastic.co/guide/e ... .html
 

要回复问题请先登录注册