下载镜像elasticsearch
docker search elasticsearch
docker pull elasticsearch
启动镜像
docker run --name my-elasticsearch -p 9200:9200 -p 9300:9300 -e "ES_JAVA_OPTS=-Xms1g -Xmx1g" -d 5acf0e8da90b
需要配置内存大小,否则默认2g,启动失败
访问curl 127.0.0.1:9200
{
"name" : "j9yOQY_",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "XJTr4Y8bRJKFK3N-tHnrCQ",
"version" : {
"number" : "5.6.12",
"build_hash" : "cfe3d9f",
"build_date" : "2018-09-10T20:12:43.732Z",
"build_snapshot" : false,
"lucene_version" : "6.6.1"
},
"tagline" : "You Know, for Search"
}
安装head插件,打开管控台
docker pull mobz/elasticsearch-head:5 docker run -d --name my-es_admin -p 9100:9100 mobz/elasticsearch-head:5
访问192.168.99.100:9100
第一次打开时,连接的服务地址是localhost:9200,修改为docker所在的ip。此时出现连接失败,需要修改镜像的elasticsearch.yml文件,添加
http.cors.enabled: true
http.cors.allow-origin: "*"
然后重新启动es镜像和es-head两个容器
docker restart my-es docker restart my-es-head
下载镜像
docker search kibana docker pull kibana docker inspect yu23rdjsfdflnfds
查询最新版本为5.6.12
启动镜像
docker run --name my-kibana -e ELASTICSEARCH_URL=http://192.168.99.100:9200 -p 5601:5601 -d a674d23325b0
访问http://192.168.99.100:5601
原文链接:https://blog.csdn.net/chang_li/article/details/89669871