美文网首页
ELK7.6.2版本安装(docker-compose)

ELK7.6.2版本安装(docker-compose)

作者: TechLogs | 来源:发表于2020-04-24 15:00 被阅读0次

安装环境要求

  1. centos7.6
  2. docker,docker-compose

编写docker-compose.yml及.env

  • 创建网络(终端执行)
docker network create elk --driver bridge
  • 环境变量文件(.env)
EKL_TAG=7.6.2
  • docker-compose.yml
# docker-compose.yml
# .env  <- EKL_TAG=7.6.2
# docker-compose --compatibility up -d
version: "3.1"
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:${EKL_TAG}
    ports:
      - "9200:9200"
      - "9300:9300"
    environment:
      discovery.type: single-node
    deploy:
      resources:
        limits:
          memory: 512M
  kibana:
    image: docker.elastic.co/kibana/kibana:${EKL_TAG}
    depends_on:
      - elasticsearch
    ports:
      - "5601:5601"
    deploy:
      resources:
        limits:
          memory: 512M
  logstash:
    image: docker.elastic.co/logstash/logstash:${EKL_TAG}
    depends_on:
      - elasticsearch
    ports:
      - "9600:9600"
    deploy:
      resources:
        limits:
          memory: 512M
    stdin_open: true
    tty: true
    entrypoint: logstash -e 'input { stdin{} }  output { elasticsearch {  hosts => ["elasticsearch:9200"] } }'

networks:
  default:
    external:
      name: elk #使用外部网络,要提前创建 docker network create elk --driver bridge

启动

docker-compose --compatibility up -d

相关文章

网友评论

      本文标题:ELK7.6.2版本安装(docker-compose)

      本文链接:https://www.haomeiwen.com/subject/jdjfwhtx.html