修改 elasticsearch.yml
node.attr.box_type: "type" # type为该node类型 自定义
通过Kibana 配置index属性
# test-*索引命名的, 都将其数据放到 type 节点上
PUT _template/test
{
"index_patterns": "test-*",
"settings": {
"index.number_of_replicas": "0",
"index.routing.allocation.require.box_type": "type"
}
}
# 设置已有的index 到指定node上
PUT /test-2018.10.18/_settings
{
"settings": {
"index.routing.allocation.require.box_type": "hot",
"index.number_of_replicas": "0"
}
}