兩類數據節點, 不一樣的硬件配置node
標記節點架構
bin/elasticsearch -E node.name=hotNode -E cluster.name=ljktest -E path.data=hot_data -E node.attr.my_node_type=hot -d bin/elasticsearch -E node.name=warmNode -E cluster.name=ljktest -E path.data=warm_data -E node.attr.my_node_type=warm -d
查看是否生效curl http://localhost:9200/_cat/nodeattrs\?v
curl
node host ip attr value hotNode 127.0.0.1 127.0.0.1 ml.machine_memory 8589934592 hotNode 127.0.0.1 127.0.0.1 xpack.installed true hotNode 127.0.0.1 127.0.0.1 my_node_type hot hotNode 127.0.0.1 127.0.0.1 ml.max_open_jobs 20 warmNode 127.0.0.1 127.0.0.1 ml.machine_memory 8589934592 warmNode 127.0.0.1 127.0.0.1 ml.max_open_jobs 20 warmNode 127.0.0.1 127.0.0.1 xpack.installed true warmNode 127.0.0.1 127.0.0.1 my_node_type warm
配置索引到Hot Nodeelasticsearch
PUT logs-2019-09-23 { "settings": { "number_of_shards": 2, "number_of_replicas": 0, "index.routing.allocation.require.my_node_type":"hot" } }
查看索引GET /_cat/shards
ui
logs-2019-09-23 1 p STARTED 0 230b 127.0.0.1 hotNode logs-2019-09-23 0 p STARTED 0 230b 127.0.0.1 hotNode
配置索引到Warm Nodeurl
假設如今以前hot的索引,咱們要移動到warm節點上了。code
PUT logs-2019-09-23/_settings { "index.routing.allocation.require.my_node_type":"warm" }
查看索引索引
logs-2019-09-23 1 p STARTED 0 283b 127.0.0.1 warmNode logs-2019-09-23 0 p STARTED 0 283b 127.0.0.1 warmNode