Elasticsearch集群冷熱分離 實際操作

2021-09-12 04:08:59 字數 1129 閱讀 6852

兩台物理機(40core,128g記憶體, 1t ssd, 1t*3 hdd),每台機器同時部署乙個hot node和cold node,共4個node。hot node使用ssd作為儲存介質,分配32g記憶體,接收實時日誌。cold node使用hdd盤作為儲存介質,分配16g記憶體,儲存歷史日誌(唯讀不寫)。每日固定時間進行熱->冷遷移。 

在 hot 組的兩個節點的 elasticsearch.yml 配置檔案 node 配置段中增加

node.tag: hot
在 cold 組的兩個節點的 elasticsearch.yml 配置檔案 node 配置段中增加

node.tag: cold
為了讓新建的的索引自動分配到 hot 節點,在 template 中增加索引的分配規則,如所有 logstash* 的索引匹配的模板叫 logstash ,在 logstash 模板下增加:

put /_template/logstash

}

「index.routing.allocation.include.tag」: 「hot」,表示新建索引將分配到 node.tag = hot 的節點下

pip install elasticsearch-curator==3.5
curator allocation --rule tag=cold --type include indices --time-unit days --older-than 40  --timestring '%y.%m.%d' --prefix logstash
curator allocation --rule tag=cold --type include indices --time-unit days --older-than 400 --timestring '%y.%m.%d' --prefix ocslog

curator allocation --rule tag=cold --type include indices --time-unit days --older-than 400 --timestring '%y.%m.%d' --prefix ocscdr

構建elasticsearch集群

初始化系統環境 在 etc security limits.conf 增加如下兩行 elasticsearch soft nofile 4096 elasticsearch hard nofile 65536 curl o elasticsearch 解壓軟體包 tar xvf elasticsea...

Elasticsearch集群搭建

1 主節點 儲存資料資訊 meta data 元資料 描述資料的資料,客戶端通過主節點獲取真正的資料位置,到資料節點datanode獲取資料分片 2 資料節點 只負責資料的讀和寫 3 負載均衡節點 當主節點連線的客戶端過多,可以引入負載均衡節點 分擔併發,既不是主節點,也不是資料節點 搭建另外兩台e...

Elasticsearch集群搭建

1 分發 scp 2.修改每一台機器的配置檔案 a 集群的名字 cluster.name my es b 節點名字 node.name node 1 c es儲存資料的路徑 path.data home zpark esdata data d es生成log資訊的路徑 path.logs home ...