docker es kibana 集群


docker-compose.yml

version: '3'
services:
  elasticsearch:
    image: elasticsearch:6.5.4
    container_name: elasticsearch
    hostname: elasticsearch
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - ./esdata1:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    networks:
      - esnet
  elasticsearch2:
    image: elasticsearch:6.5.4
    container_name: elasticsearch2
    hostname: elasticsearch2
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - "discovery.zen.ping.unicast.hosts=[elasticsearch,elasticsearch2,elasticsearch3]"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - ./esdata2:/usr/share/elasticsearch/data
    networks:
      - esnet
  elasticsearch3:
    image: elasticsearch:6.5.4
    container_name: elasticsearch3
    hostname: elasticsearch3
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - "discovery.zen.ping.unicast.hosts=[elasticsearch,elasticsearch2,elasticsearch3]"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - ./esdata3:/usr/share/elasticsearch/data
    networks:
      - esnet    
  kibana:
    image: kibana
    container_name: kibana
    ports:
      - 5601:5601
    environment:
      - ELASTICSEARCH_URL=http://elasticsearch:9200
    networks:
      - esnet

volumes:
  esdata1:
    driver: local
  esdata2:
    driver: local
  esdata3:
    driver: local  
networks:
  esnet:

docker-compose up -d


原文:https://www.jianshu.com/p/fdfead5acc23









posted on 2019-12-29 18:00  风声风语  阅读(968)  评论(0编辑  收藏  举报

导航