1、安装jdk

elasticsearch 7之后,必须用jdk11

2、安装es

国内镜像:https://mirrors.huaweicloud.com/elasticsearch/

3、安装kibana

国内镜像:https://mirrors.huaweicloud.com/kibana/

4、filebeat收集nginx日志,并上传到es,最后在kibana展示

(1)安装 Filebeat
sudo rpm -vi filebeat-6.8.5-x86_64.rpm
(2)filebeat上传文件到es
修改 /etc/filebeat/filebeat.yml 以设置连接信息:
output.elasticsearch:
hosts: ["<es_url>"]
username: “elastic”
password: “”
setup.kibana:
host: “<kibana_url>”
其中, 是 elastic 用户的密码,<es_url> 是 Elasticsearch 的 URL,<kibana_url> 是 Kibana 的 URL。
(3)启用 nginx 模块
sudo filebeat modules enable nginx
(4)收集nginx日志
在/etc/filebeat/modules.d/nginx.yml中修改设置
elk搭建
(5)启动filebeat
sudo filebeat setup
sudo service filebeat start
sudo service filebeat status
(6)生成es索引
/etc/filebeat下
执行 filebeat.exe -e -c filebeat.yml,观察es的索引多了filebeat-日期格式样式的索引

相关文章:

  • 2021-09-10
  • 2018-04-23
  • 2022-01-19
  • 2022-02-17
  • 2021-12-05
  • 2022-01-11
  • 2021-05-01
猜你喜欢
  • 2021-08-21
  • 2021-12-30
  • 2021-05-15
相关资源
相似解决方案