当前位置:   article > 正文

docker-compose部署ELK_docker compose 安装elk

docker compose 安装elk
Elastic Stack
elasticsearch集群
mkdir ~/elasticsearch/data{
   01...03}
mkdir ~/elasticsearch/logs{
   01...03}
  • 1
  • 2
  • 3
  • 4
制作数字证书
# 启动一个临时容器
sudo docker run --name elasticsearch -exec -it --rm elasticsearch:7.14.1 /bin/bash
./bin/elasticsearch-certutil ca
./bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12 --out config/elastic-certificates.p12
chmod 644 config/elastic-certificates.p12
# 导出容器
sudo docker cp elasticsearch:/user/share/elasticsearch/config/elastic-certificates.p12 ~/elasticsearch/
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
docker-compose.yml
version: '3.8'

services:
  es01:
    image: elasticsearch:7.14.1
    container_name: es01
    privileged: true
    environment:
      - node.name=es01
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es02,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - xpack.security.enabled=true
      - xpack.security.transport.ssl.enabled=true
      - xpack.monitoring.collection.enabled=true
      - xpack.security.transport.ssl.verification_mode=certificate
      - xpack.security.transport.ssl.keystore.path=elastic-certificates.p12
      - xpack.security.transport.ssl.truststore.path=elastic-certificates.p12
      - "ES_JAVA_OPTS=-Xms32G -Xmx32G"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - ~/elasticsearch/data01:/usr/share/elasticsearch/data
      - ~/elasticsearches/log01:/usr/share/elasticsearch/logs
      - ~/elasticsearch/elastic-certificates.p12:/usr/share/elasticsearch/config/elastic-certificates.p12
    ports:
      - 9200:9200
    networks:
      - elastic
  es02:
    image: elasticsearch:7.14.1
    container_name: es02
    privileged: true
    environment:
      - node.name=es02
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - xpack.security.enabled=true
      - xpack.security.transport.ssl.enabled=true
      - xpack.monitoring.collection.enabled=true
      - xpack.security.tran
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号