快速启动 elasticsearch

文档说明:只记录关键地方;
试验环境: linux debian 11

elasticsearch + elasticsearch-head

elasticsearch-head 可能需要解决跨域问题,可以使用nginx 反向代理或者 socat 转发 解决。


version: "3"
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.17.7
    container_name: "es01"
    hostname: "es01"
    ports:
      - "9200:9200"
      - "9300:9300"
    environment:
      - discovery.type=single-node
      - node.name=es01
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    volumes:
      - ./data:/usr/share/elasticsearch/data
      - ./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
  elasticsearch-head: # webUI
    image: mobz/elasticsearch-head:5-alpine
    ports:
      - "9100:9100"

elasticsearch.yml 文件

cluster.name: "docker-cluster"
network.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"

elasticsearch-reset-password


docker exec -it es01 /usr/share/elasticsearch/bin/elasticsearch-reset-password

启动、关闭、查看日志

# 启动
docker-compose -f docker-compose.yaml up -d 
# 关闭
docker-compose -f docker-compose.yaml down --remove-orphans
# 查看日志
docker-compose -f docker-compose.yaml logs -f 

参考文档

  1. elasticsearch latest docker
  2. elasticsearch docker 7.17.7
  3. elasticsearch-head -- webUI
  4. elasticsearch webUI Dejavu
  5. elasticsearch webUI ElasticHD
  6. ElasticSearch可视化客户端
  7. 自建拉取registry.k8s.io、k8s.gcr.io、gcr.io、quay.io、ghcr.io 容器镜像的服务
  8. Elasticsearch与Relational DB对应关系
posted @ 2022-10-25 22:24  jingjingxyk  阅读(85)  评论(0编辑  收藏  举报