【elasticsearch+kibana基于windows docker安装】

创建网络:es和kibana容器互联

bash 复制代码
docker network create es-net

加载镜像

bash 复制代码
docker pull elasticsearch:7.12.1

运行

bash 复制代码
docker run -d --name es -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -v ${你的路径}/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml -v ${你的路径}/data:/usr/share/elasticsearch/data -v ${你的路径}/plugins:/usr/share/elasticsearch/plugins --network es-net -d elasticsearch:7.12.1 

出现错误

bash 复制代码
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/run/desktop/mnt/host/d/docker/es/config/elasticsearch.yml" to rootfs at "/usr/share/elasticsearch/config/elasticsearch.yml": mount /run/desktop/mnt/host/d/docker/es/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml (via /proc/self/fd/14), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.

解决办法

改成如下:并在elasticsearch.yml 中添加配置:http.host: 0.0.0.0

重启容器

bash 复制代码
docker restart es

浏览器访问

bash 复制代码
locahost:9200

出现以上数据说明安装好了es.

安装kibana- 加载镜像

bash 复制代码
docker pull kibana:7.12.1

运行容器

bash 复制代码
docker run -d --name kibana -p 5601:5601 -e ELASTICSEARCH_HOSTS=http://es:9200 --network=es-net kibana:7.12.1

注意:eskibana版本要一致!

浏览器访问kibana

bash 复制代码
localhost:5601

参考文章

https://blog.csdn.net/qq_39363204/article/details/108547475

相关推荐
debug 小菜鸟28 分钟前
浏览器访问 AWS ECS 上部署的 Docker 容器(监听 80 端口)
docker·云计算·aws
SpikeKing1 小时前
Server - 使用 Docker 配置 PyTorch 研发环境
pytorch·docker·llm
斯普信云原生组2 小时前
Docker构建自定义的镜像
java·spring cloud·docker
小柏ぁ3 小时前
calico/node is not ready: BIRD is not ready: BGP not established with xxx
运维·docker·kubernetes
夏日米米茶4 小时前
Windows系统下npm报错node-gyp configure got “gyp ERR“解决方法
前端·windows·npm
虾球xz6 小时前
CppCon 2015 学习:CLANG/C2 for Windows
开发语言·c++·windows·学习
码上库利南6 小时前
Windows开机自动启动中间件
windows
nuczzz7 小时前
GPU虚拟化
docker·kubernetes·k8s·gpu·nvidia
fengyehongWorld7 小时前
Linux Docker的简介
linux·docker
Johny_Zhao7 小时前
2025年6月Docker镜像加速失效终极解决方案
linux·网络·网络安全·docker·信息安全·kubernetes·云计算·containerd·yum源·系统运维