- elasticsearch7.8.1
- 镜像获取地址:https://www.docker.elastic.co/r/elasticsearch
空启动一个
docker run -d -p 9202:9200 -p 9302:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.8.1
单节点启动
明确需要挂载出来的文件
elasticsearch.yml
文件cluster.name: "docker-cluster"
network.host: 0.0.0.0
node.master: true
node.data: true
node.ingest: true
cluster.initial_master_nodes: ["127.0.0.1:9300"]
discovery.zen.minimum_master_nodes: 1
discovery.seed_hosts: ["127.0.0.1:9300"]
data
目录logs
目录plugins
目录docker run -d --name my-es -p 9201:9200 -p 9301:9300 -env='ES_JAVA_OPTS=-Xms256m -Xmx256m' -v /home/my-es/logs:/usr/share/elasticsearch/logs -v /home/my-es/config/es1.yml:/usr/share/elasticsearch/config/elasticsearch.yml -v /home/my-es/data:/usr/share/elasticsearch/data -v /home/my-es/plugins:/usr/share/elasticsearch/plugins docker.elastic.co/elasticsearch/elasticsearch:7.8.1
配置ik分词器
由于我这边把plugins目录
也挂载了