无法在Windows上启动docker mongo映像 [英] Unable to start docker mongo image on windows

查看:500
本文介绍了无法在Windows上启动docker mongo映像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

启动图像时出现以下错误:

When starting the image I get the following error:

 2019-02-27T17:09:41.095+0000 E STORAGE  [initandlisten] WiredTiger error (17) [1551287381:95206][1:0x7fae36fc4a40], connection: __posix_open_file, 715:
/data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1551287381:95206][1:0x7fae36fc4a40], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: File exists
2019-02-27T17:09:41.108+0000 I STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.6
2019-02-27T17:09:41.111+0000 E STORAGE  [initandlisten] WiredTiger error (1) [1551287381:111166][1:0x7fae36fc4a40], connection: __posix_open_file, 715:
/data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1551287381:111166][1:0x7fae36fc4a40], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
2019-02-27T17:09:41.149+0000 E STORAGE  [initandlisten] WiredTiger error (17) [1551287381:149030][1:0x7fae36fc4a40], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1551287381:149030][1:0x7fae36fc4a40], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: File exists
2019-02-27T17:09:41.153+0000 I STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.7
2019-02-27T17:09:41.156+0000 E STORAGE  [initandlisten] WiredTiger error (1) [1551287381:156133][1:0x7fae36fc4a40], connection: __posix_open_file, 715:
/data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1551287381:156133][1:0x7fae36fc4a40], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
2019-02-27T17:09:41.177+0000 E STORAGE  [initandlisten] WiredTiger error (17) [1551287381:177375][1:0x7fae36fc4a40], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1551287381:177375][1:0x7fae36fc4a40], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: File exists
2019-02-27T17:09:41.192+0000 I STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.8
2019-02-27T17:09:41.194+0000 E STORAGE  [initandlisten] WiredTiger error (1) [1551287381:194762][1:0x7fae36fc4a40], connection: __posix_open_file, 715:
/data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1551287381:194762][1:0x7fae36fc4a40], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
2019-02-27T17:09:41.200+0000 W STORAGE  [initandlisten] Failed to start up WiredTiger under any compatibility version.
2019-02-27T17:09:41.200+0000 F STORAGE  [initandlisten] Reason: 1: Operation not permitted
2019-02-27T17:09:41.201+0000 F -        [initandlisten] Fatal Assertion 28595 at src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 704

.env文件夹的值为

The .env folder value is

MONGO_SAVE_PATH=./database/db

数据库docker文件:

The DB docker file:

FROM mongo:latest
VOLUME ["/data/db"]
WORKDIR /data
EXPOSE 27017
CMD ["mongod"]

docker-compose.yml数据库容器

The docker-compose.yml DB container

services:
  my-mongo-db:
  build: ./database
  ports:
   - 32815:27017
  volumes:
- ./database/db:/data/db

我不确定如何解决此问题.但是,在Linux和Mac上,不会出现此问题.

I'm not sure how to fix this. However, on linux and Mac this issue doesn't appear.

推荐答案

警告(Windows& OS X):Windows和OS X上的默认Docker设置 使用VirtualBox VM托管Docker守护程序.不幸的是, VirtualBox用于在主机系统和主机之间共享文件夹的机制 Docker容器与内存映射文件不兼容 由MongoDB使用(请参阅vbox错误,docs.mongodb.org及相关内容) jira.mongodb.org错误).这意味着无法运行 将数据目录映射到主机的MongoDB容器.

WARNING (Windows & OS X): The default Docker setup on Windows and OS X uses a VirtualBox VM to host the Docker daemon. Unfortunately, the mechanism VirtualBox uses to share folders between the host system and the Docker container is not compatible with the memory mapped files used by MongoDB (see vbox bug, docs.mongodb.org and related jira.mongodb.org bug). This means that it is not possible to run a MongoDB container with the data directory mapped to the host.

从docker mongo GitHub上获得答案

保留数据的解决方法:

docker volume create --name=mongodata
docker run -d -p 27017:27017 -v mongodata:/data/db --name=mymongo mongodb:3.3

更多信息此处

这篇关于无法在Windows上启动docker mongo映像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆