当前位置: 首页 > article >正文

docker compose一键启动ES集群和kibana

集群启用了XPACK后,只有第一次可以启动成功。要是宕机了。就启动不了了。(除非删除data目录所有数据)生产环境 启用了后 建议配置 自定义证书。

services:
  es01:
    image: "docker.elastic.co/elasticsearch/elasticsearch:7.17.25"
    container_name: es01
    ports:
      - "9200:9200"
      - "9300:9300"
    privileged: true
    environment:
      node.name: es01
      discovery.seed_hosts: es01,es02,es03
      cluster.initial_master_nodes: es01
      cluster.name: myescluster
      node.master: true
      node.data: true
      http.cors.enabled: true
      bootstrap.memory_lock: true
      http.cors.allow-origin: "*"
      ES_JAVA_OPTS: -Xms512m -Xmx512m
      xpack.security.enabled: true
      ingest.geoip.downloader.enabled: false
      ELASTIC_PASSWORD: password
    volumes:
      - "/usr/local/es_cluster/node_1/data:/usr/share/elasticsearch/data"
      - "/usr/local/es_cluster/node_1/logs:/usr/share/elasticsearch/logs"
      - "/usr/local/es_cluster/node_1/plugins:/usr/share/elasticsearch/plugins"
    networks:
      - es-network
    ulimits:
      memlock:
        soft: -1
        hard: -1
  es02:
    image: "docker.elastic.co/elasticsearch/elasticsearch:7.17.25"
    container_name: es02
    ports:
      - "9201:9200"
      - "9301:9300"
    privileged: true
    environment:
      node.name: es02
      discovery.seed_hosts: es01,es02,es03
      cluster.name: myescluster
      node.master: true
      node.data: true
      http.cors.enabled: true
      bootstrap.memory_lock: true
      http.cors.allow-origin: "*"
      ES_JAVA_OPTS: -Xms512m -Xmx512m
      xpack.security.enabled: true
      ingest.geoip.downloader.enabled: false
      ELASTIC_PASSWORD: password
    volumes:
      - "/usr/local/es_cluster/node_2/data:/usr/share/elasticsearch/data"
      - "/usr/local/es_cluster/node_2/logs:/usr/share/elasticsearch/logs"
      - "/usr/local/es_cluster/node_2/plugins:/usr/share/elasticsearch/plugins"
    networks:
      - es-network
    ulimits:
      memlock:
        soft: -1
        hard: -1
  es03:
    image: "docker.elastic.co/elasticsearch/elasticsearch:7.17.25"
    container_name: es03
    ports:
      - "9202:9200"
      - "9302:9300"
    privileged: true
    environment:
      node.name: es03
      discovery.seed_hosts: es01,es02,es03
      cluster.name: myescluster
      node.master: true
      node.data: true
      http.cors.enabled: true
      bootstrap.memory_lock: true
      http.cors.allow-origin: "*"
      ES_JAVA_OPTS: -Xms512m -Xmx512m
      xpack.security.enabled: true
      ingest.geoip.downloader.enabled: false
      ELASTIC_PASSWORD: password
    volumes:
      - "/usr/local/es_cluster/node_3/data:/usr/share/elasticsearch/data"
      - "/usr/local/es_cluster/node_3/logs:/usr/share/elasticsearch/logs"
      - "/usr/local/es_cluster/node_3/plugins:/usr/share/elasticsearch/plugins"
    networks:
      - es-network
    ulimits:
      memlock:
        soft: -1
        hard: -1
  kibana:
    image: docker.elastic.co/kibana/kibana:7.17.25
    container_name: kibana
    depends_on:
      - es01
      - es02
      - es03
    ports:
      - "5601:5601"
      - "9600:9600"
    environment:
      SERVERNAME: kibana
      ELASTICSEARCH_HOSTS: '["http://es01:9200","http://es02:9200","http://es03:9200"]'
      ES_JAVA_OPTS: -Xmx512m -Xms512m
      ELASTICSEARCH_USERNAME: elastic
      ELASTICSEARCH_PASSWORD: password
      xpack.security.enabled: true
      I18N_LOCALE: zh-CN
      SERVER_PUBLICBASEURL: "http://ip:5601"
    networks:
      - es-network
networks:
  es-network:
    driver: bridge

http://www.kler.cn/a/415976.html

相关文章:

  • STM32 ADC --- 知识点总结
  • 深入讲解Spring Boot和Spring Cloud,外加图书管理系统实战!
  • 【数据资产】数据资产管理体系概述
  • HCIA笔记6--路由基础
  • Cesium K-means自动聚合点的原理
  • UI控件使用说明
  • C底层 函数栈帧
  • pcb线宽与电流
  • 从el-cascader的options选项中,选择各级的名字, 并拼接成字符串
  • 23种设计模式-抽象工厂(Abstract Factory)设计模式
  • 11.21c++中的函数
  • week 6 - SQL Select II
  • 【Leecode】Leecode刷题之路第61天之旋转链表
  • 基于nxp LS1046+fpga的嵌入式系统中虚拟化设备的设计与实现
  • [python脚本处理文件入门]-17.Python如何操作Excel文件的读写
  • Lyapunov方法发展简史
  • WPS 文本——在修订模式中、并且保留所有批注的情况下,如何显示全部文本的最终状态
  • D2761 适合在个人电脑、便携式音响等系统中作音频限幅用。
  • Java开发网络安全常见问题
  • (C语言) 8大翻译阶段
  • 宠物空气净化器推荐2024超详细测评 希喂VS霍尼韦尔谁能胜出
  • vue3-新增API组件
  • mac上的建议xftp 工具
  • oracle将select作为字段查询
  • Leetcode 每日一题 104.二叉树的最大深度
  • 论文阅读 - Labeled Datasets for Research on Information Operations