先安装docker,如果安装了宝塔面板可以直接在商店安装docker
通过管理器拉取镜像
或者通过命令行:
docker pull elasticsearch:7.7.0
随后启动镜像:
#启动镜像
docker run --name elasticsearch -d -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -e "discovery.type=single-node" -p 9200:9200 -p 9300:9300 elasticsearch:7.12.0
这样就成功啦!文章来源:https://www.toymoban.com/news/detail-533787.html
通过IP:9200 访问试试就可以了。文章来源地址https://www.toymoban.com/news/detail-533787.html
{
"name" : "5781e57a9abf",
"cluster_name" : "docker-cluster",
"cluster_uuid" : "thKY91ldRUq_ns5d7aridg",
"version" : {
"number" : "7.12.0",
"build_flavor" : "default",
"build_type" : "docker",
"build_hash" : "78722783c38caa25a70982b5b042074cde5d3b3a",
"build_date" : "2021-03-18T06:17:15.410153305Z",
"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"
}
到了这里,关于宝塔用docker安装Elasticsearch的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!