elasticsearch+kibana的docker-compose安裝記錄


在某文件夾下新建文件elk.yml,內容如下:

version: '2.2'
services:
  es01:
    image: docker.io/elasticsearch:7.4.2
    container_name: es01
    environment:
      - node.name=es01
      - discovery.type=single-node
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"

    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - esdata01:/usr/share/elasticsearch/data
      - esconfig01:/usr/share/elasticsearch/config
    ports:
      - 9200:9200
    networks:
      - esnet
  
  kibana:
    image: docker.io/kibana:7.4.2
    container_name: kibana
    environment:
      SERVER_NAME: kibana
      ELASTICSEARCH_HOSTS: http://10.10.10.182:9200
      ELASTICSEARCH_URL: http://10.10.10.182:9200
    ports:
      - 5601:5601
    volumes:
      - kibana:/usr/share/kibana/config

volumes:
  esdata01:
    driver: local
  esconfig01:
    driver: local
  kibana:
    driver: local

networks:
  esnet:

運行命令:

docker-compose -f elk.yml start  # 開啟
docker-compose -f elk.yml stop  # 關閉
docker-compose -f elk.yml restart  # 重啟

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM