我在控制台中运行mongod --storageEngine=mmapv1
一切都很好。它按标准使用C:\data\db
文件夹。
但是在我重新加载计算机并尝试相同命令后,它会抛出一个错误。
C:\mongodb\bin>mongod --storageEngine=mmapv1
2018-05-18T10:53:45.491+0300 I CONTROL [main]
2018-05-18T10:53:45.491+0300 W CONTROL [main] 32-bit servers don't have journal
ing enabled by default. Please use --journal if you want durability.
2018-05-18T10:53:45.491+0300 I CONTROL [main]
2018-05-18T10:53:45.491+0300 I CONTROL [main] Hotfix KB2731284 or later update
is not installed, will zero-out data files
2018-05-18T10:53:45.506+0300 I CONTROL [initandlisten] MongoDB starting : pid=2
396 port=27017 dbpath=C:\data\db\ 32-bit host=yaposhytiil-ara
2018-05-18T10:53:45.506+0300 I CONTROL [initandlisten] targetMinOS: Windows Vis
ta/Windows Server 2008
2018-05-18T10:53:45.506+0300 I CONTROL [initandlisten] db version v3.2.20
2018-05-18T10:53:45.506+0300 I CONTROL [initandlisten] git version: a7a144f40b7
0bfe290906eb33ff2714933544af8
2018-05-18T10:53:45.506+0300 I CONTROL [initandlisten] allocator: tcmalloc
2018-05-18T10:53:45.506+0300 I CONTROL [initandlisten] modules: none
2018-05-18T10:53:45.506+0300 I CONTROL [initandlisten] build environment:
2018-05-18T10:53:45.506+0300 I CONTROL [initandlisten] distarch: i386
2018-05-18T10:53:45.506+0300 I CONTROL [initandlisten] target_arch: i386
2018-05-18T10:53:45.506+0300 I CONTROL [initandlisten] options: { storage: { en
gine: "mmapv1" } }
2018-05-18T10:53:45.506+0300 W - [initandlisten] Detected unclean shutdow
n - C:\data\db\mongod.lock is not empty.
2018-05-18T10:53:45.528+0300 I STORAGE [initandlisten] **************
Unclean shutdown detected.
Please visit http://dochub.mongodb.org/core/repair for recovery instructions.
*************
2018-05-18T10:53:45.531+0300 I STORAGE [initandlisten] exception in initAndList
en: 12596 old lock file, terminating
2018-05-18T10:53:45.532+0300 I CONTROL [initandlisten] dbexit: rc: 100
据我了解,它锁定了访问数据。 我不会浪费你的时间,但我不知道如何谷歌... 是因为32位Windows,还是某些用户访问设置,或者我每次都要修复/删除db文件夹?