DockerCompose 搭建 ELK 7.1.1 + Filebeat 监控laravel框架日志

2019-06-24 11:27:35

目标, 收集Php Laravel框架 laravel.log 日志.

 

经多次部署 : https://www.cnblogs.com/fbtop/p/11005469.html (我的另一篇部署文章)

最终搞出了 ELK + F DockerCompose 文件,用于快速部署

 

 

根目录

4个(文件/文件夹)

elasticsearch
目录初始化里面没有任何数据。(会把它映射到容器内,为了持久化 elasticsearch 数据

filebeat
目录 有一个 filebeat.docker.yml 是filebeat运行配置文件

logstash
目录 有 logstash.yml 还有一个 conf.d
是logstash的配置文件

docker-compose.yml
dockerCompose 配置文件

docker-compose.yml

${PWD} 要替换为你们自己的路径

version: "3.7"
services:
  elasticsearch:
    container_name: elasticsearch
    image: elasticsearch:7.1.1
    ports:
      - 9200:9200
      - 9300:9300
    networks:
      - custom
    environment:
      - node.name=node-master
      - cluster.initial_master_nodes=node-master
    volumes:
      - ${PWD}/docker/elasticsearch/data:/usr/share/elasticsearch/data

  kibana:
    container_name: kibana
    image: kibana:7.1.1
    ports:
      - 5601:5601
    networks:
      - custom

  logstash:
    container_name: logstash
    image: logstash:7.1.1
    ports:
      - 5044:5044
    networks:
      - custom
    volumes:
      - ${PWD}/docker/logstash/logstash.yml:/usr/share/logstash/config/logstash.yml
      - ${PWD}/docker/logstash/conf.d/:/usr/share/logstash/conf.d/

  filebeat:
    container_name: filebeat
    image: store/elastic/filebeat:7.1.1
    command: --strict.perms=false
    networks:
      - custom
    volumes:
      - ${PWD}/docker/filebeat/filebeat.docker.yml:/usr/share/filebeat/filebeat.yml
      - /var/log/laravel/:/var/log/laravel/
      - /var/lib/docker/containers:/var/lib/docker/containers:ro
      - /var/run/docker.sock:/var/run/docker.sock

networks:
  custom:
运行 docker-compose up -d 

DockerCompose 搭建 ELK 7.1.1 + Filebeat 监控laravel框架日志_第1张图片

启动了

DockerCompose 搭建 ELK 7.1.1 + Filebeat 监控laravel框架日志_第2张图片

 

转载于:https://www.cnblogs.com/fbtop/p/11076017.html

你可能感兴趣的:(DockerCompose 搭建 ELK 7.1.1 + Filebeat 监控laravel框架日志)