先编写docker-compose.es.yml

version: '3'
services:
  elasticsearch:
    image: elasticsearch:7.5.1
    container_name: elasticsearch
    networks:
    - net-es
    volumes:
    - ../data/elasticsearch/data:/usr/share/elasticsearch/data  #这里将elasticsearch的数据文件映射本地,以保证下次如果删除了容器还有数据
    environment:
    - discovery.type=single-node
    ports:
    - "9200:9200"

  elastichd:
    image: containerize/elastichd:latest
    container_name: elasticsearch-hd
    networks:
    - net-es
    ports:
      - "9800:9800"
    depends_on:
      - "elasticsearch"
    links:
      - "elasticsearch:demo"

#这里要注意,es和eshd要在相同网络才能被links
networks:
  net-es:
    external: false

启动代码:

docker-compose -f docker-compose.es.yml up

启动后访问http://localhost:9800打开elastichd

输入elasticsearch地址点connect即可

使用docker-compose快速搭建本地ElasticSearch7和Elastichd环境

 

相关文章:

  • 2021-12-09
  • 2021-07-03
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-23
  • 2021-07-29
猜你喜欢
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2021-11-29
相关资源
相似解决方案