docker 安装es

docker-compose.yml

   

version: '2'
services:
  elasticsearch:
    container_name: elasticsearch
    image: elasticsearch:6.5.4
    ports:
      - "9200:9200"
      - "9300:9300"
    volumes:
      - "F:/esdocker/da/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml"
      - "F:/esdocker/da/data:/usr/share/elasticsearch/data"
      - "F:/esdocker/da/plugins:/usr/share/elasticsearch/plugins"
    environment:
      - "ES_JAVA_OPTS=-Xms256m -Xmx512m"
      - "discovery.type=single-node"
      - "COMPOSE_PROJECT_NAME=elasticsearch-server"
    restart: always
  head:
    image: bolingcavalry/elasticsearch-head:6
    container_name: head
    ports:
      - 9100:9100

  

  elasticsearch.yml  

http.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"
cluster.name: my-cluster
transport.host: 0.0.0.0
bootstrap.system_call_filter: false
network.host: 0.0.0.0

最后执行:docker-compose.exe -d up

 

posted @ 2020-12-31 11:33  开顺  阅读(219)  评论(0编辑  收藏  举报