20200616一篇es的好文:
3臺es集群
▷ elasticsearch 7.3.2
▷ filebeat 7.3.2
▷ kibana 7.3.2
es1的配置:
es2的配置:
es3的配置:
如果用的filebeat,蒐集的nginx日誌:
# 檔案輸入filebeat.inputs:
# 檔案輸入型別
- type: log
# 開啟載入
enabled: true
# 檔案位置
paths:
- /var/log/nginx/access.log
# 自定義引數
fields:
type: nginx_access # 型別是nginx_access,和上面fields.type是一致的
# 輸出至elasticsearch
output.elasticsearch:
# elasticsearch集群
hosts: ["",
"",""]
# 索引配置
indices:
# 索引名
- index: "nginx_access_%"
# 當型別是nginx_access時使用此索引
when.equals:
fields.type: "nginx_access"
# 關閉自帶模板
setup.template.enabled: false
# 開啟日誌記錄
logging.to_files: true
# 日誌等級
logging.level: info
# 日誌檔案
logging.files:
# 日誌位置
path: /opt/logs/filebeat/
# 日誌名字
name: filebeat
# 日誌輪轉期限,必須要2~1024
keepfiles: 7
# 日誌輪轉許可權
permissions: 0600
kibana的配置:
# 本節點訪問埠server.port: 5601
# 本節點ip
server.host: "192.168.1.21"
# 本節點名字
server.name: "192.168.1.21"
# elasticsearch集群ip
elasticsearch.hosts: ["",
"",""]
啟動服務:
# elasticsearch啟動(3臺es均啟動)
sudo -u elasticsearch /opt/elasticsearch/bin/elasticsearch
# filebeat啟動
/opt/filebeat/filebeat -e -c /opt/filebeat/filebeat.yml -d "publish"
# kibana啟動
sudo -u kibana /opt/kibana/bin/kibana -c /opt/kibana/config/kibana.yml
構建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 ...