docker-compose.yml
version: '3'
services:
elasticsearch:
image: elasticsearch:7.16.3
restart: always
hostname: es1
container_name: es-single
volumes:
- ./es/data:/user/local/elasticsearch/data
- ./es/plugins:/usr/share/elasticsearch/plugins
- ./es/logs:/user/local/elasticsearch/logs
- ./es/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- discovery.type=single-node
ports:
- '9200:9200'
- '9300:9300'
privileged: true
elasticsearch.yml
node.name: node-1
path.data: /user/local/elasticsearch/data
path.logs: /user/local/elasticsearch/logs
bootstrap.memory_lock: true
http.port: 9200
目录结构
docker-compose.yml
es
| config
| elasticsearch.yml
| data
|***
| logs
|***
| plugins
**
|