• 欢迎访问开享网

elasticseach kibana docker集群

linux 7个月前 (08-10) 100次浏览 已收录 0个评论 扫描二维码

创建network

docker network create es

使用docker-compose建立elasticsearch集群

将以下内容写入docker-compose.yml

version: '2.2'
services:
  es0:
    image: docker.io/elasticsearch:7.0.1
    container_name: es0
    environment:
      - node.name=es0
      - discovery.seed_hosts=es1,es2
      - cluster.initial_master_nodes=es0,es1,es2
      - cluster.name=elasticsearch
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - /data/elasticsearch/data0:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    networks:
      - es
  es1:
    image: docker.io/elasticsearch:7.0.1
    container_name: es1
    environment:
      - node.name=es1
      - discovery.seed_hosts=es0,es2
      - cluster.initial_master_nodes=es0,es1,es2
      - cluster.name=elasticsearch
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - /data/elasticsearch/data1:/usr/share/elasticsearch/data
    networks:
      - es
  es2:
    image: docker.io/elasticsearch:7.0.1
    container_name: es2
    environment:
      - node.name=es2
      - discovery.seed_hosts=es0,es1
      - cluster.initial_master_nodes=es0,es1,es2
      - cluster.name=elasticsearch
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - /data/elasticsearch/data2:/usr/share/elasticsearch/data
    networks:
      - es

networks:
  es:

创建elasticsearch docker集群

docker-compose up -d

切换文件夹,如:cd kibana

创建kibana容器

将以下内容写入docker-compose.yml

version: '2'
services:
  kibana:
    image: docker.io/kibana:7.0.1
    container_name: kibana
    environment:
      SERVER_NAME: kibana
      ELASTICSEARCH_HOSTS: http://上面集群所在本机IP(非容器):9200
    ports:
      - 5601:5601

访问kibana

浏览器中访问:http://kibana容器所在本机IP:5601


开享网 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:elasticseach kibana docker集群
喜欢 (2)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址