elasticsearch 安装部署

发布时间 2023-03-22 21:16:41作者: liwenchao1995

elasticsearch 安装部署

docker-compose 安装部署

version: '3.3'

services:
  dpss-base-elasticsearch:
    image: elasticsearch:7.17.6
    container_name: elasticsearch
    volumes:
      - "/dpss/data/dpss_base_data/es:/usr/share/elasticsearch/data"
      - "/dpss/data/dpss_base_data/plugins/es:/usr/share/elasticsearch/plugins"
	  - "/data/elasticsearch7/logs:/usr/share/elasticsearch/logs"
    extra_hosts:
      - "dpss-base-elasticsearch01:127.0.0.1"
    environment:
      - TZ=Asia/Shanghai
      - bootstrap.memory_lock=true
      - http.cors.enabled=true 
      - http.cors.allow-origin=*
      - xpack.security.enabled=true
      - xpack.monitoring.enabled=true
      - bootstrap.memory_lock=true
      - discovery.type=single-node
      - network.host=0.0.0.0
      - "ES_JAVA_OPTS=-Xms4096m -Xmx4096m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    networks:
      dpss-base-network:
        aliases:
          - dpss-base-elasticsearch
    ports:
      - 9200:9200
    healthcheck:
      test: ["CMD", "curl", "-f", "http://127.0.0.1:9200/_cat/health"]
      interval: 30s
      timeout: 20s
      retries: 3

networks:
  dpss-base-network:
    external: true