🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] ## elassticsearch https://hub.docker.com/_/elasticsearch?tab=tags&page=1&ordering=last_updated ``` docker run -d --name es -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.12.1 docker pull kibana:7.12.1 ``` 可以看到status状态是up,说明已经在docker中成功运行了elasticseach 打开浏览器访问[http://localhost:9200/](http://localhost:9200/)  可以看到如下结果 ``` name "1b3e8e0a9c89" cluster_name "docker-cluster" cluster_uuid "YbSMS7UmQEqetpghWlV8tQ" version number "7.12.1" build_flavor "default" build_type "docker" build_hash "3186837139b9c6b6d23c3200870651f10d3343b7" 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" ``` ip地址换成你的linux主机的ip ## kibana https://hub.docker.com/_/kibana?tab=tags&page=1&ordering=last_updated ``` docker run -d --name kibana -e ELASTICSEARCH_URL=http://127.0.0.1:9200 -p 5601:5601 kibana:7.12.1 ``` http://localhost:5601/ 原来用的是`docker run -d --name kibana -e ELASTICSEARCH_URL=http://127.0.0.1:9200 -p 5601:5601 kibana:7.12.1` , kibana和es连不上,看 `docker logs kibana` 日志提示: kibana中设置es的ip不对的问题, 导致一直报: ``` {"type":"log","@timestamp":"2021-06-01T11:57:50+00:00","tags":["warning","elasticsearch"],"pid":7,"message":"Unable to revive connection: http://elasticsearch:9200/"} ``` 使用了`--link elasticsearch:elasticsearch`参数之后, kibana可以访问 es了: ``` docker run -d --name kibana --link es:elasticsearch -p 5601:5601 kibana:7.12.1 ```