拉取镜像
拉取镜像,此处以版本7.7.0为例
# docker pull elasticsearch:7.7.0
执行结果如下:
# docker pull elasticsearch:7.7.0
7.7.0: Pulling from library/elasticsearch
524b0c1e57f8: Pull complete
4f79045bc94a: Pull complete
5bfd159f5e06: Pull complete
e00e3b68a158: Pull complete
33b005156da6: Pull complete
a4bd47222680: Pull complete
6433b34e08c2: Pull complete
fc6ab638f272: Pull complete
ca0dbaf72840: Pull complete
Digest: sha256:ce6d341f95af5c1fdefae53789d92b6dd978f605ade2eea41381162d21c9f938
Status: Downloaded newer image for elasticsearch:7.7.0
docker.io/library/elasticsearch:7.7.0
启动镜像
single-node启动
# docker run --name elasticsearch -d -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -e "discovery.type=single-node" -p 9200:9200 -p 9300:9300 elasticsearch:7.7.0
浏览器访问http://ip:9200,如果出现以下界面就是安装成功
{
"name" : "b9b6c5ab5673",
"cluster_name" : "docker-cluster",
"cluster_uuid" : "hK_W17VTS-aEc02KetTGBA",
"version" : {
"number" : "7.7.0",
"build_flavor" : "default",
"build_type" : "docker",
"build_hash" : "81a1e9eda8e6183f5237786246f6dced26a10eaf",
"build_date" : "2020-05-12T02:01:37.602180Z",
"build_snapshot" : false,
"lucene_version" : "8.5.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}