使用Docker-Compose & Windows 10 Home时,MongoDB日志未被持久化。

我使用的是windows 10 home与docker工具箱。

在vbox设置中,默认设置的唯一共享文件夹。

enter image description here在使用下面的yaml时。

services:
  mongo:
    image: mongo
    restart: always
    volumes:
      - C:/Users/data:/data/db
    ports:
      - 27017:27017

  mongo-express:
    image: mongo-express
    restart: always
    ports:
      - 9000:8081

改变了每个人都能完全控制的文件夹的权限 在mongodb日志中得到以下错误。

mongo_1          | 2020-04-24T09:30:30.192+0000 E  STORAGE  [initandlisten] WiredTiger error (17) [1587720630:192587][1:0x7f12e9fe8b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1587720630:192587][1:0x7f12e9fe8b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists
mongo_1          | 2020-04-24T09:30:30.193+0000 E  STORAGE  [initandlisten] WiredTiger error (26) [1587720630:193681][1:0x7f12e9fe8b00], connection: __posix_fs_rename, 241: /data/db/WiredTiger.wt to /data/db/WiredTiger.wt.1: file-rename: rename: Text file busy Raw: [1587720630:193681][1:0x7f12e9fe8b00], connection: __posix_fs_rename, 241: /data/db/WiredTiger.wt to /data/db/WiredTiger.wt.1: file-rename: rename: Text file busy
mongo_1          | 2020-04-24T09:30:30.204+0000 E  STORAGE  [initandlisten] WiredTiger error (17) [1587720630:204261][1:0x7f12e9fe8b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1587720630:204261][1:0x7f12e9fe8b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists
mongo_1          | 2020-04-24T09:30:30.205+0000 E  STORAGE  [initandlisten] WiredTiger error (26) [1587720630:205347][1:0x7f12e9fe8b00], connection: __posix_fs_rename, 241: /data/db/WiredTiger.wt to /data/db/WiredTiger.wt.1: file-rename: rename: Text file busy Raw: [1587720630:205347][1:0x7f12e9fe8b00], connection: __posix_fs_rename, 241: /data/db/WiredTiger.wt to /data/db/WiredTiger.wt.1: file-rename: rename: Text file busy
mongo_1          | 2020-04-24T09:30:30.218+0000 E  STORAGE  [initandlisten] WiredTiger error (17) [1587720630:218021][1:0x7f12e9fe8b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1587720630:218021][1:0x7f12e9fe8b00], connection: __posix_open_file, 667: /data/db/WiredTiger.wt: handle-open: open: File exists
mongo_1          | 2020-04-24T09:30:30.219+0000 E  STORAGE  [initandlisten] WiredTiger error (26) [1587720630:219113][1:0x7f12e9fe8b00], connection: __posix_fs_rename, 241: /data/db/WiredTiger.wt to /data/db/WiredTiger.wt.1: file-rename: rename: Text file busy Raw: [1587720630:219113][1:0x7f12e9fe8b00], connection: __posix_fs_rename, 241: /data/db/WiredTiger.wt to /data/db/WiredTiger.wt.1: file-rename: rename: Text file busy
mongo_1          | 2020-04-24T09:30:30.221+0000 W  STORAGE  [initandlisten] Failed to start up WiredTiger under any compatibility version.
mongo_1          | 2020-04-24T09:30:30.221+0000 F  STORAGE  [initandlisten] Reason: 26: Text file busy
mongo_1          | 2020-04-24T09:30:30.221+0000 F  -        [initandlisten] Fatal Assertion 28595 at src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 860
mongo_1          | 2020-04-24T09:30:30.221+0000 F  -        [initandlisten]
mongo_1          |
mongo_1          | ***aborting after fassert() failure
mongo_1          |
mongo_1          |

在该文件夹内,我可以看到以下内容被创建。

enter image description here

任何想法,我做错了什么?

解决方案:

不支持

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

https:/github.comstrapistrapi-dockerissues80#issuecomment-464408049。

解决办法 – 运行cron备份

docker volume create mongodbdata



services:
  mongo:
    image: mongo
    restart: always
    volumes:
      - mongodbdata:/data/db
    ports:
      - 27017:27017

  mongo-backup:
    image: istepanov/mongodump:4.2
    volumes:
      - C:/Users/mongodbBackup:/backup
    environment:
      MONGO_URI: mongodb://user:pass@mongo:27017
      CRON_SCHEDULE: "* * * * *"
    depends_on:
      - mongo

给TA打赏
共{{data.count}}人
人已打赏
未分类

谁能找到下面给出的CNN模型代码中的神经元数量和Kernal大小?我想在图中显示层内的每个神经元。

2022-9-8 23:06:41

未分类

在Advance Custom Fields ACF Plugin Wordpress中使用php更改画廊的返回格式。

2022-9-8 23:17:36

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索