ElasticSearch-Docker
安装 elasticsearch
下载镜像
1
docker pull elasticsearch:6.5.3
运行容器
1
docker run -d -p 9200:9200 -p 9300:9300 --name elasticsearch-6.5.3 elasticsearch:6.5.3
进入容器
1
docker exec -it elasticsearch-6.5.3 /bin/bash
安装 ik 分词器
1
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.5.3/elasticsearch-analysis-ik-6.5.3.zip
修改 es 配置文件:
vi ./config/elasticsearch.yml
1
2
3
4
5
6
7
8
9
10
11cluster.name: "docker-cluster"
network.host: 0.0.0.0
# minimum_master_nodes need to be explicitly set when bound on a public IP
# set to 1 to allow single node clusters
# Details: https://github.com/elastic/elasticsearch/pull/17288
discovery.zen.minimum_master_nodes: 1
# just for elasticsearch-head plugin
http.cors.enabled: true
http.cors.allow-origin: "*"退出容器:
exit
停止容器:
docker stop elasticsearch-6.5.3
启动容器:
docker start elasticsearch-6.5.3
安装 elasticsearch-head
1 | docker run --name=elasticsearch-head -d -p 9100:9100 docker.io/mobz/elasticsearch-head:5 |
- UI 界面(看数据)
http://localhost:9100 - elasticsearch-head 遇到问题
https://www.jianshu.com/p/fec0d22ddf8d - 参考文章
https://www.jianshu.com/p/3c90f144775f
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 王文哲的博客!