目录
前言
- TencentOS Server 3.1
- Docker version 19.03.14, build 5eb3275d40
准备
-
docker 已安装。
安装 docker 参考:【Centos 8】【Centos 7】安装 docker
-
搜索可以使用的镜像。
shell> docker search elasticsearch NAME DESCRIPTION STARS OFFICIAL AUTOMATED elasticsearch Elasticsearch is a powerful open source sear... 6115 [OK] kibana Kibana gives shape to any kind of data --- str... 2622 [OK]
-
也可从docker hub上搜索镜像。
docker hub,docker hub-stage。
拉取ElasticSearch镜像
bash
shell> docker pull elasticsearch:7.12.0
7.12.0: Pulling from library/elasticsearch
7a0437f04f83: Pull complete
2b674c951ca3: Pull complete
06baeb69f25f: Pull complete
eeff01d19ce5: Pull complete
a994306398ca: Pull complete
2c002d76c1f6: Pull complete
6286f2196f9b: Pull complete
Digest: sha256:383e9fb572f3ca2fdef5ba2edb0dae2c467736af96aba2c193722aa0c08ca7ec
Status: Downloaded newer image for elasticsearch:7.12.0
docker.io/library/elasticsearch:7.12.0
安装ElasticSearch
-
创建并运行容器
docker run --name elasticsearch1 -p 9200:9200 -p 9300:9300 \ -e "discovery.type=single-node" \ -e ES_JAVA_OPTS="-Xms84m -Xmx512m" \ -d elasticsearch:7.12.0
-
检查是否安装成功
浏览器访问http://localhost:9200, 如果出现以下界面就是安装成功:
拉取elasticsearch-head镜像
docker pull mobz/elasticsearch-head:5
安装elasticsearch-head
-
创建容器
docker create --name elasticsearch-head -p 9100:9100 mobz/elasticsearch-head:5
-
启动容器
docker start elasticsearch-head
-
检查是否安装成功
浏览器打开 http://localhost:9100, 如果出现以下界面就是安装成功:
参考
https://blog.csdn.net/qq_40942490/article/details/111594267
https://www.cnblogs.com/jianxuanbing/p/9410800.html