web-dev-qa-db-ja.com

Windowsでdocker mongoイメージを開始できません

イメージを開始すると、次のエラーが発生します。

 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フォルダーの値は

MONGO_SAVE_PATH=./database/db

DB Dockerファイル:

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

Docker-compose.yml DBコンテナー

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

これを修正する方法がわかりません。ただし、LinuxおよびMacでは、この問題は発生しません。

11
David

Docker-composeを使用している場合、以下は上記の答えを複製する方法です。

services:
  mongodb_container:
    ...
    volumes:
      - mongodata:/data/db
volumes:
  mongodata:

上記のサンプルは、mongodbストレージに必要なymlファイルの一部のみを示していることに注意してください。

0
charitha