version: '3.1'
services:
elasticsearch:
image: elasticsearch:7.13.3
container_name: elasticsearch
privileged: true
ports:
- "9200:9200"
- "9300:9300"
environment:
- ES_JAVA_OPTS=-Xms128m -Xmx1024m #设置使用jvm内存大小
- cluster.name=elasticsearch #设置集群名称
- discovery.type=single-node #以单一节点模式启动
- bootstrap.memory_lock=true
- http.cors.enabled=true
- http.cors.allow-origin=*
- TZ=Asia/Shanghai
deploy:
resources:
limits:
cpus: "2"
memory: 1000M
reservations:
memory: 200M
ulimits:
memlock:
soft: -1
hard: -1
/data/docker/es/plugins
/data/docker/es/data
/data/docker/es/logs
docker cp elasticsearch:/usr/share/elasticsearch/plugins /opt/docker/data/es/plugins
docker cp elasticsearch:/usr/share/elasticsearch/data /opt/docker/data/es/data
docker cp elasticsearch:/usr/share/elasticsearch/logs /opt/docker/data/es/logs
version: '3.1'
services:
elasticsearch:
image: elasticsearch:7.13.3
container_name: elasticsearch
privileged: true
ports:
- "9200:9200"
- "9300:9300"
environment:
- ES_JAVA_OPTS=-Xms128m -Xmx1024m #设置使用jvm内存大小
- cluster.name=elasticsearch #设置集群名称
- discovery.type=single-node #以单一节点模式启动
- bootstrap.memory_lock=true
- http.cors.enabled=true
- http.cors.allow-origin=*
- TZ=Asia/Shanghai
volumes:
- /opt/docker/data/es/plugins:/usr/share/elasticsearch/plugins #插件文件挂载
- /opt/docker/data/es/data:/usr/share/elasticsearch/data #数据文件挂载
- /opt/docker/data/es/logs:/user/share/elasticsearch/logs
deploy:
resources:
limits:
cpus: "2"
memory: 1000M
reservations:
memory: 200M
ulimits:
memlock:
soft: -1
hard: -1
http://服务器id:9200/