简体   繁体   English

MongoDB 容器在 Windows 10 中失败

[英]MongoDB Container Fails Windows 10

I've checked around and I haven't found this issue yet on stack overflow.我已经检查过,但在堆栈溢出时还没有发现这个问题。 If you find it;如果你找到了; link it and I'll close this one.链接它,我会关闭这个。

Environment:环境:

  • Windows 10 (latest) 5/6/2019 Windows 10(最新)5/6/2019
  • C Drive Shared C盘共享
  • Executed cmds from admin console从管理控制台执行 cmds

Action:行动:

docker run -d -p 27017:27017 -v C:/data/mongo:/data/db --name mongo mongo

Expected Results:预期成绩:

Mongo container to be running in background. Mongo 容器在后台运行。

What happens:发生什么了:

Failure with below logs以下日志失败

2019-05-06T16:28:25.980+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=2583M,session_max=20000,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),
2019-05-06T16:28:26.525+0000 E STORAGE  [initandlisten] WiredTiger error (1) [1557160106:524990][1:0x7f3937620a80], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1557160106:524990][1:0x7f3937620a80], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
2019-05-06T16:28:26.544+0000 E STORAGE  [initandlisten] WiredTiger error (17) [1557160106:544574][1:0x7f3937620a80], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1557160106:544574][1:0x7f3937620a80], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: File exists
2019-05-06T16:28:26.548+0000 I STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.1
2019-05-06T16:28:26.549+0000 E STORAGE  [initandlisten] WiredTiger error (1) [1557160106:549461][1:0x7f3937620a80], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1557160106:549461][1:0x7f3937620a80], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
2019-05-06T16:28:26.561+0000 E STORAGE  [initandlisten] WiredTiger error (17) [1557160106:561653][1:0x7f3937620a80], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: File exists Raw: [1557160106:561653][1:0x7f3937620a80], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: File exists
2019-05-06T16:28:26.564+0000 I STORAGE  [initandlisten] WiredTiger message unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.2
2019-05-06T16:28:26.566+0000 E STORAGE  [initandlisten] WiredTiger error (1) [1557160106:566631][1:0x7f3937620a80], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted Raw: [1557160106:566631][1:0x7f3937620a80], connection: __posix_open_file, 715: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
2019-05-06T16:28:26.568+0000 W STORAGE  [initandlisten] Failed to start up WiredTiger under any compatibility version.
2019-05-06T16:28:26.568+0000 F STORAGE  [initandlisten] Reason: 1: Operation not permitted
2019-05-06T16:28:26.568+0000 F -        [initandlisten] Fatal Assertion 28595 at src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 704
2019-05-06T16:28:26.568+0000 F -        [initandlisten]

***aborting after fassert() failure

VirtualBox Shared Folders are not supported by mongodb . mongodb不支持 VirtualBox 共享文件夹。

IMPORTANT重要的

MongoDB requires a filesystem that supports fsync() on directories. MongoDB 需要一个支持目录 fsync() 的文件系统。 For example, HGFS and Virtual Box's shared folders do not support this operation.例如,HGFS 和 Virtual Box 的共享文件夹不支持此操作。

In case you are using Docker Desktop, When you install Docker Desktop on Windows, it requires and automatically enables Hyper-V, a hypervisor from Microsoft.如果您使用的是 Docker Desktop,当您在 Windows 上安装 Docker Desktop 时,它需要并自动启用 Hyper-V,一个来自 Microsoft 的管理程序。 Hyper-V replaces your Windows OS as the host on the computer, and your Windows OS becomes a virtual machine. Hyper-V 将您的 Windows 操作系统替换为计算机上的主机,您的 Windows 操作系统将成为虚拟机。

I had this " ***aborting after fassert() failure " running MongoDB on Windows.我在 Windows 上运行 MongoDB 时遇到了这个“***aborting after fassert() failure”。

My log included:我的日志包括:

log file journal\wiredtiger log.0000000007 corrupted: bad magic number 1869181810: wt_try_salvage: database corruption detected

I tried many things, but the only way to solve this problem was deleting all files on \\mongodb\\data\\journal folder and restarting MongoDB.我尝试了很多方法,但解决此问题的唯一方法是删除 \\mongodb\\data\\journal 文件夹中的所有文件并重新启动 MongoDB。

No data was lost.没有数据丢失。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM