自学内容网 自学内容网

docker搭建elasticsearch服务

  1. 创建docker-compose.yml
version: '1.0'
# 服务配置
services:
  elasticsearch:
    container_name: es01
    image: docker.elastic.co/elasticsearch/elasticsearch:8.12.2
    restart: unless-stopped
    environment:
      - "ES_JAVA_OPTS=-Xms1024m -Xmx1024m"
      - "TZ=Asia/Shanghai"
      - "discovery.type=single-node"
      - "ELASTIC_PASSWORD=123456"
    ports:
      - "9200:9200"
      - "9300:9300"
    volumes:
      # - /home/elasticsearch/config:/usr/share/elasticsearch/config
      - /home/elasticsearch/data:/usr/share/elasticsearch/data
      - /home/elasticsearch/plugins:/usr/share/elasticsearch/plugins
    networks:
      - elastic_net
  kibana:
    container_name: kibana01
    image: docker.elastic.co/kibana/kibana:8.12.2
    restart: unless-stopped
    environment:
      - "TZ=Asia/Shanghai"
      - "I18N_LOCALE=zh-CN"
      - "ELASTICSEARCH_HOSTS=http://elasticsearch:9200"
      - "ELASTICSEARCH_USERNAME=test"
      - "ELASTICSEARCH_PASSWORD=123456"
    ports:
      - "5601:5601"
        #volumes:
        #- /home/kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml
    networks:
      - elastic_net
    depends_on:
      - elasticsearch
# 网络配置
networks:
  elastic_net:
    driver: bridge
  1. 创建compose-up.sh
docker-compose -f /home/data/docker-compose.yml up -d

echo "执行成功 $?"

查看版本
下载elasticsearch

https://www.elastic.co/downloads/past-releases#elasticsearch

下载kibana

https://www.elastic.co/downloads/past-releases#kibana

下载ik分词器

https://release.infinilabs.com/analysis-ik/stable/

下载解析文档插件

https://www.elastic.co/guide/en/elasticsearch/plugins/7.6.2/index.html


原文地址:https://blog.csdn.net/weixin_44570041/article/details/144136251

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!