Elasticsearch必知必会格物系列->Docker下安装 - Elasticsearch
前期准备
docker环境...
0_镜像_查询
[root@iZ2zeca7jric8sx4f3n7spZ ~]# docker search elasticsearch
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
elasticsearch Elasticsearch is a powerful open source sear… 5022 [OK]
nshou/elasticsearch-kibana Elasticsearch-7.12.1 Kibana-7.12.1 129 [OK]
1_镜像_拉取
#请加版本号
docker pull elasticsearch:7.12.1
2_容器_启动
docker run --name es_1 -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -d elasticsearch:7.12.1
#验证
curl localhost:9200
如果能看到以下信息则说明我们的es是已经安装好了的
{
"name": "91t19ff5684d",
"cluster_name": "docker-cluster",
"cluster_uuid": "3pL_sli-R6q6K9LilT7JqW",
"version": {
"number": "7.12.1",
"build_flavor": "default",
"build_type": "docker",
"build_hash": "3186837139b9c6b6d23c3200870658470d3343b7",
"build_date": "2021-04-20T20:56:39.040728659Z",
"build_snapshot": false,
"lucene_version": "8.8.0",
"minimum_wire_compatibility_version": "6.8.0",
"minimum_index_compatibility_version": "6.0.0-beta1"
},
"tagline": "You Know, for Search"
}
3_服务器_配置
如果你是在服务器上安装,
想要对外访问还必须打开你服务器的9200端口.
报错_0_镜像拉取必须加版本号
$ docker pull elasticsearch
Using default tag: latest
Error response from daemon: manifest for elasticsearch:latest not found: manifest unknown: manifest unknown
解决方案 --> 加上版本号即可
所以docker pull elasticsearch
默认等于执行docker pull elasticsearch:latest
$ docker pull elasticsearch:latest
Error response from daemon: manifest for elasticsearch:latest not found: manifest unknown: manifest unknown
但是我又试了下docker pull hello-world:latest
就是可以拉取的,
反正elasticsearch镜像肯定和其它镜像有点不太一样...
然后我去DockerHub中查看了下,
这两个镜像的区别,发现elasticsearch中根本没有"latest"标签...
正确写法↓
docker pull elasticsearch:7.12.1