Cho*_*ang 5 database database-connection mongoose mongodb ubuntu-18.04
我正在尝试从Ubuntu服务器迁移。当我尝试在新环境(这是Windows 10 Ubuntu 18 bash子系统)中启动MongoDB时:
mongod --dbpath ./mongoData
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
2019-01-07T11:41:33.981+0800 I CONTROL [initandlisten] MongoDB starting : pid=2166 port=27017 dbpath=/mnt/d/QuizJungle/mongoData 64-bit host=PHANG
2019-01-07T11:41:33.982+0800 I CONTROL [initandlisten] db version v3.6.9
2019-01-07T11:41:33.983+0800 I CONTROL [initandlisten] git version: 167861a164723168adfaaa866f310cb94010428f
2019-01-07T11:41:33.983+0800 I CONTROL [initandlisten] allocator: tcmalloc
2019-01-07T11:41:33.983+0800 I CONTROL [initandlisten] modules: none
2019-01-07T11:41:33.984+0800 I CONTROL [initandlisten] build environment:
2019-01-07T11:41:33.984+0800 I CONTROL [initandlisten] distarch: x86_64
2019-01-07T11:41:33.985+0800 I CONTROL [initandlisten] target_arch: x86_64
2019-01-07T11:41:33.985+0800 I CONTROL [initandlisten] options: { storage: { dbPath: "/mnt/d/QuizJungle/mongoData" } }
2019-01-07T11:41:33.988+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=64863M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),cache_cursors=false,compatibility=(release="3.0",require_max="3.0"),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2019-01-07T11:41:34.496+0800 E STORAGE [initandlisten] WiredTiger error (5) [1546832494:496438][2166:0x7f3f529f0a40], connection: __posix_sync, 108: /mnt/d/QuizJungle/mongoData/: directory-sync: fdatasync: Input/output error
2019-01-07T11:41:34.496+0800 E STORAGE [initandlisten] WiredTiger error (-31804) [1546832494:496615][2166:0x7f3f529f0a40], connection: __wt_panic, 523: the process must exit and restart: WT_PANIC: WiredTiger library panic
2019-01-07T11:41:34.497+0800 F - [initandlisten] Fatal Assertion 28558 at src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp 376
2019-01-07T11:41:34.498+0800 F - [initandlisten]
***aborting after fassert() failure
2019-01-07T11:41:34.515+0800 F - [initandlisten] Got signal: 6 (Aborted).
0x7f3f54c25811 0x7f3f54c24a29 0x7f3f54c24f0d 0x7f3f517f2890 0x7f3f5141ee97 0x7f3f51420801 0x7f3f533a6886 0x7f3f5347124e 0x7f3f534e2511 0x7f3f5334489e 0x7f3f53344cbe 0x7f3f534ac4c3 0x7f3f534ac662 0x7f3f534acfdb 0x7f3f534a9620 0x7f3f53504436 0x7f3f534c7c47 0x7f3f534a65ae 0x7f3f5348298e 0x7f3f53452f8e 0x7f3f53437404 0x7f3f5363ade7 0x7f3f533403a8 0x7f3f53416ffc 0x7f3f533a8549 0x7f3f51401b97 0x7f3f534069b1
----- BEGIN BACKTRACE -----
{"backtrace":[{"b":"7F3F52A25000","o":"2200811","s":"_ZN5mongo15printStackTraceERSo"},{"b":"7F3F52A25000","o":"21FFA29"},{"b":"7F3F52A25000","o":"21FFF0D"},{"b":"7F3F517E0000","o":"12890"},{"b":"7F3F513E0000","o":"3EE97","s":"gsignal"},{"b":"7F3F513E0000","o":"40801","s":"abort"},{"b":"7F3F52A25000","o":"981886","s":"_ZN5mongo32fassertFailedNoTraceWithLocationEiPKcj"},{"b":"7F3F52A25000","o":"A4C24E"},{"b":"7F3F52A25000","o":"ABD511"},{"b":"7F3F52A25000","o":"91F89E","s":"__wt_err_func"},{"b":"7F3F52A25000","o":"91FCBE","s":"__wt_panic"},{"b":"7F3F52A25000","o":"A874C3"},{"b":"7F3F52A25000","o":"A87662"},{"b":"7F3F52A25000","o":"A87FDB"},{"b":"7F3F52A25000","o":"A84620","s":"__wt_open"},{"b":"7F3F52A25000","o":"ADF436","s":"__wt_block_manager_create"},{"b":"7F3F52A25000","o":"AA2C47","s":"__wt_schema_create"},{"b":"7F3F52A25000","o":"A815AE","s":"__wt_turtle_init"},{"b":"7F3F52A25000","o":"A5D98E","s":"wiredtiger_open"},{"b":"7F3F52A25000","o":"A2DF8E","s":"_ZN5mongo18WiredTigerKVEngineC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_PNS_11ClockSourceES8_mbbbb"},{"b":"7F3F52A25000","o":"A12404"},{"b":"7F3F52A25000","o":"C15DE7","s":"_ZN5mongo20ServiceContextMongoD29initializeGlobalStorageEngineEv"},{"b":"7F3F52A25000","o":"91B3A8"},{"b":"7F3F52A25000","o":"9F1FFC","s":"_ZN5mongo11mongoDbMainEiPPcS1_"},{"b":"7F3F52A25000","o":"983549","s":"main"},{"b":"7F3F513E0000","o":"21B97","s":"__libc_start_main"},{"b":"7F3F52A25000","o":"9E19B1"}],"processInfo":{ "mongodbVersion" : "3.6.9", "gitVersion" : "167861a164723168adfaaa866f310cb94010428f", "compiledModules" : [], "uname" : { "sysname" : "Linux", "release" : "4.4.0-17134-Microsoft", "version" : "#345-Microsoft Wed Sep 19 17:47:00 PST 2018", "machine" : "x86_64" }, "somap" : [ { "b" : "7F3F52A25000", "elfType" : 3, "buildId" : "2B0D1BCE9C6C49B9246DD60788791DE608E88305" }, { "b" : "7FFFDC8AD000", "path" : "linux-vdso.so.1", "elfType" : 3 }, { "b" : "7F3F523E0000", "path" : "/lib/x86_64-linux-gnu/libresolv.so.2", "elfType" : 3, "buildId" : "390E9CC4C215314B6D8ADE6D6E28F8518418039C" }, { "b" : "7F3F521D0000", "path" : "/lib/x86_64-linux-gnu/librt.so.1", "elfType" : 3, "buildId" : "9826FBDF57ED7D6965131074CB3C08B1009C1CD8" }, { "b" : "7F3F51FC0000", "path" : "/lib/x86_64-linux-gnu/libdl.so.2", "elfType" : 3, "buildId" : "25AD56E902E23B490A9CCDB08A9744D89CB95BCC" }, { "b" : "7F3F51C20000", "path" : "/lib/x86_64-linux-gnu/libm.so.6", "elfType" : 3, "buildId" : "A33761AB8FB485311B3C85BF4253099D7CABE653" }, { "b" : "7F3F51A00000", "path" : "/lib/x86_64-linux-gnu/libgcc_s.so.1", "elfType" : 3, "buildId" : "92E0BE1929D28508CF9C6D5754C7EB48C12255B3" }, { "b" : "7F3F517E0000", "path" : "/lib/x86_64-linux-gnu/libpthread.so.0", "elfType" : 3, "buildId" : "28C6AADE70B2D40D1F0F3D0A1A0CAD1AB816448F" }, { "b" : "7F3F513E0000", "path" : "/lib/x86_64-linux-gnu/libc.so.6", "elfType" : 3, "buildId" : "B417C0BA7CC5CF06D1D1BED6652CEDB9253C60D0" }, { "b" : "7F3F52600000", "path" : "/lib64/ld-linux-x86-64.so.2", "elfType" : 3, "buildId" : "64DF1B961228382FE18684249ED800AB1DCEAAD4" } ] }}
mongod(_ZN5mongo15printStackTraceERSo+0x41) [0x7f3f54c25811]
mongod(+0x21FFA29) [0x7f3f54c24a29]
mongod(+0x21FFF0D) [0x7f3f54c24f0d]
libpthread.so.0(+0x12890) [0x7f3f517f2890]
libc.so.6(gsignal+0xC7) [0x7f3f5141ee97]
libc.so.6(abort+0x141) [0x7f3f51420801]
mongod(_ZN5mongo32fassertFailedNoTraceWithLocationEiPKcj+0x0) [0x7f3f533a6886]
mongod(+0xA4C24E) [0x7f3f5347124e]
mongod(+0xABD511) [0x7f3f534e2511]
mongod(__wt_err_func+0x90) [0x7f3f5334489e]
mongod(__wt_panic+0x3F) [0x7f3f53344cbe]
mongod(+0xA874C3) [0x7f3f534ac4c3]
mongod(+0xA87662) [0x7f3f534ac662]
mongod(+0xA87FDB) [0x7f3f534acfdb]
mongod(__wt_open+0x4A0) [0x7f3f534a9620]
mongod(__wt_block_manager_create+0x66) [0x7f3f53504436]
mongod(__wt_schema_create+0x4A7) [0x7f3f534c7c47]
mongod(__wt_turtle_init+0x3CE) [0x7f3f534a65ae]
mongod(wiredtiger_open+0x1B8E) [0x7f3f5348298e]
mongod(_ZN5mongo18WiredTigerKVEngineC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_PNS_11ClockSourceES8_mbbbb+0x8BE) [0x7f3f53452f8e]
mongod(+0xA12404) [0x7f3f53437404]
mongod(_ZN5mongo20ServiceContextMongoD29initializeGlobalStorageEngineEv+0x637) [0x7f3f5363ade7]
mongod(+0x91B3A8) [0x7f3f533403a8]
mongod(_ZN5mongo11mongoDbMainEiPPcS1_+0x86C) [0x7f3f53416ffc]
mongod(main+0x9) [0x7f3f533a8549]
libc.so.6(__libc_start_main+0xE7) [0x7f3f51401b97]
mongod(+0x9E19B1) [0x7f3f534069b1]
----- END BACKTRACE -----
Aborted (core dumped)
Run Code Online (Sandbox Code Playgroud)
/ mongoData /只是一个空目录。我尝试对坏扇区进行磁盘扫描,但未发现错误。
如何成功启动MongoDB服务器?
目前还不完全清楚你是如何达到这种状态的。像使用不正确的权限创建数据目录这样的事情会以不同的方式出现错误。我怀疑这与您在平台之间迁移的方式有关。您是如何迁移的,但仍然使用空数据目录?
我的建议是,如果创建新的集合/数据库,请使用较新版本的数据库,因为 3.6.x 已经很旧了,到目前为止已经有近 5 年了。6.0于今年夏天发布。
话虽如此,您可以深入了解错误输出。看看这一行:
2019-01-07T11:41:34.496+0800 E STORAGE [initandlisten] WiredTiger error (5) [1546832494:496438][2166:0x7f3f529f0a40], connection: __posix_sync, 108: /mnt/d/QuizJungle/mongoData/: directory-sync: fdatasync: Input/output error
Run Code Online (Sandbox Code Playgroud)
这表明存储引擎WiredTiger出现I/O错误。具体来说,系统调用fdatasync()返回108.
fdatasync()WiredTiger 对于失败的调用有这样的说法:
* __posix_sync --
* Underlying support function to flush a file descriptor.
*
* Fsync calls (or fsync-style calls, for example, fdatasync) are not retried
* on failure, and failure halts the system.
*
* Excerpted from the LWN.net article https://lwn.net/Articles/752063/:
* In short, PostgreSQL assumes that a successful call to fsync() indicates
* that all data written since the last successful call made it safely to
* persistent storage. But that is not what the kernel actually does. When
* a buffered I/O write fails due to a hardware-level error, filesystems
* will respond differently, but that behavior usually includes discarding
* the data in the affected pages and marking them as being clean. So a read
* of the blocks that were just written will likely return something other
* than the data that was written.
*
* Given the shared history of UNIX filesystems, and the difficulty of knowing
* what specific error will be returned under specific circumstances, we don't
* retry fsync-style calls and panic if a flush operation fails.
Run Code Online (Sandbox Code Playgroud)
这些错误代码是特定于系统的,因此您可以通过 grep 系统标头或使用moreutils. 就我而言,在 Ubuntu 18.04 上,这会转换为ESHUTDOWN.
$ sudo apt-get install moreutils
$ errno -l | grep 108
ESHUTDOWN 108 Cannot send after transport endpoint shutdown
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
262 次 |
| 最近记录: |