docker 启动mongoDB失败

发布于 2022-09-12 03:33:44 字数 5154 浏览 59 评论 0

安装的网上的包,DNMP 每次mongoDB启动的时候,环境是Docker Desktop。总是报错:

mongodb    | 2020-05-06T11:11:11.286+0800 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
mongodb    | 2020-05-06T11:11:11.290+0800 I  CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=940cb84a9a5b
mongodb    | 2020-05-06T11:11:11.290+0800 I  CONTROL  [initandlisten] db version v4.1.13
mongodb    | 2020-05-06T11:11:11.290+0800 I  CONTROL  [initandlisten] git version: 441714bc4c70699950f3ac51a5cac41dcd413eaa
mongodb    | 2020-05-06T11:11:11.290+0800 I  CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1  11 Sep 2018
mongodb    | 2020-05-06T11:11:11.290+0800 I  CONTROL  [initandlisten] allocator: tcmalloc
mongodb    | 2020-05-06T11:11:11.290+0800 I  CONTROL  [initandlisten] modules: none
mongodb    | 2020-05-06T11:11:11.290+0800 I  CONTROL  [initandlisten] build environment:
mongodb    | 2020-05-06T11:11:11.290+0800 I  CONTROL  [initandlisten]     distmod: ubuntu1804
mongodb    | 2020-05-06T11:11:11.290+0800 I  CONTROL  [initandlisten]     distarch: x86_64
mongodb    | 2020-05-06T11:11:11.290+0800 I  CONTROL  [initandlisten]     target_arch: x86_64
mongodb    | 2020-05-06T11:11:11.290+0800 I  CONTROL  [initandlisten] options: { net: { bindIp: "*" }, security: { authorization: "enabled" } }
mongodb    | 2020-05-06T11:11:11.297+0800 I  STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=1445M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),verbose=(checkpoint_progress),
mongodb    | 2020-05-06T11:11:11.815+0800 E  STORAGE  [initandlisten] WiredTiger error (17) [1588734671:815007][1:0x7fe22c5c0ac0], connection: __posix_open_file, 712: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1588734671:815007][1:0x7fe22c5c0ac0], connection: __posix_open_file, 712: /data/db/WiredTiger.wt: handle-open: open: File exists
mongodb    | 2020-05-06T11:11:11.832+0800 I  STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.48
mongodb    | 2020-05-06T11:11:11.836+0800 E  STORAGE  [initandlisten] WiredTiger error (1) [1588734671:836121][1:0x7fe22c5c0ac0], connection: __posix_open_file, 712: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1588734671:836121][1:0x7fe22c5c0ac0], connection: __posix_open_file, 712: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
mongodb    | 2020-05-06T11:11:11.860+0800 E  STORAGE  [initandlisten] WiredTiger error (17) [1588734671:859961][1:0x7fe22c5c0ac0], connection: __posix_open_file, 712: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1588734671:859961][1:0x7fe22c5c0ac0], connection: __posix_open_file, 712: /data/db/WiredTiger.wt: handle-open: open: File exists
mongodb    | 2020-05-06T11:11:11.868+0800 I  STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.49
mongodb    | 2020-05-06T11:11:11.901+0800 E  STORAGE  [initandlisten] WiredTiger error (1) [1588734671:901550][1:0x7fe22c5c0ac0], connection: __posix_open_file, 712: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1588734671:901550][1:0x7fe22c5c0ac0], connection: __posix_open_file, 712: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
mongodb    | 2020-05-06T11:11:11.918+0800 E  STORAGE  [initandlisten] WiredTiger error (17) [1588734671:918955][1:0x7fe22c5c0ac0], connection: __posix_open_file, 712: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1588734671:918955][1:0x7fe22c5c0ac0], connection: __posix_open_file, 712: /data/db/WiredTiger.wt: handle-open: open: File exists
mongodb    | 2020-05-06T11:11:11.923+0800 I  STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.50
mongodb    | 2020-05-06T11:11:11.928+0800 E  STORAGE  [initandlisten] WiredTiger error (1) [1588734671:928205][1:0x7fe22c5c0ac0], connection: __posix_open_file, 712: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1588734671:928205][1:0x7fe22c5c0ac0], connection: __posix_open_file, 712: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
mongodb    | 2020-05-06T11:11:11.931+0800 W  STORAGE  [initandlisten] Failed to start up WiredTiger under any compatibility version.
mongodb    | 2020-05-06T11:11:11.932+0800 F  STORAGE  [initandlisten] Reason: 1: Operation not permitted
mongodb    | 2020-05-06T11:11:11.932+0800 F  -        [initandlisten] Fatal Assertion 28595 at src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 766
mongodb    | 2020-05-06T11:11:11.932+0800 F  -        [initandlisten]
mongodb    |
mongodb    | ***aborting after fassert() failure
mongodb    |
mongodb    |
mongodb exited with code 14

这是为什么呢?
这个文件权限全都是现在这个:image.png
麻烦有大佬能给解答一下

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岁月苍老的讽刺 2022-09-19 03:33:44

需要使用docker的卷,否则会报无权限错误。

docker volume create --name mongodata

docker run -it -d --name mongo -v mongodata:/data/db
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文