安装好mongo,配好环境变量以后,
使用 mongod --dbpath C:\mongodbStore\dbTwo 命令启动本地mongo服务
结果却遇到了如下问题
C:\Users\Administrator>mongod --dbpath C:\mongodbStore\dbTwo2017-09-02T09:29:45.750+0800 I CONTROL [main]
2017-09-02T09:29:45.752+0800 W CONTROL [main] 32-bit servers don't have journal
ing enabled by default. Please use --journal if you want durability.
2017-09-02T09:29:45.752+0800 I CONTROL [main]
2017-09-02T09:29:45.765+0800 I CONTROL [main] Hotfix KB2731284 or later update
is installed, no need to zero-out data files
2017-09-02T09:29:45.772+0800 I CONTROL [initandlisten] MongoDB starting : pid=1
28 port=27017 dbpath=C:\mongodbStore\dbTwo 32-bit host=USER-20170813VL
2017-09-02T09:29:45.772+0800 I CONTROL [initandlisten] targetMinOS: Windows Vis
ta/Windows Server 2008
2017-09-02T09:29:45.772+0800 I CONTROL [initandlisten] db version v3.2.16
2017-09-02T09:29:45.773+0800 I CONTROL [initandlisten] git version: 056bf451281
14e44c5358c7a8776fb582363e094
2017-09-02T09:29:45.773+0800 I CONTROL [initandlisten] allocator: tcmalloc
2017-09-02T09:29:45.773+0800 I CONTROL [initandlisten] modules: none
2017-09-02T09:29:45.773+0800 I CONTROL [initandlisten] build environment:
2017-09-02T09:29:45.773+0800 I CONTROL [initandlisten] distarch: i386
2017-09-02T09:29:45.773+0800 I CONTROL [initandlisten] target_arch: i386
2017-09-02T09:29:45.773+0800 I CONTROL [initandlisten] options: { storage: { db
Path: "C:\mongodbStore\dbTwo" } }
2017-09-02T09:29:45.776+0800 I STORAGE [initandlisten] exception in initAndList
en: 28663 Cannot start server. The default storage engine 'wiredTiger' is not av
ailable with this build of mongod. Please specify a different storage engine exp
licitly, e.g. --storageEngine=mmapv1., terminating
2017-09-02T09:29:45.777+0800 I CONTROL [initandlisten] dbexit: rc: 100
==================
主要的出错信息
2017-09-02T09:29:45.776+0800 I STORAGE [initandlisten] exception in initAndList
en: 28663 Cannot start server. The default storage engine 'wiredTiger' is not av
ailable with this build of mongod. Please specify a different storage engine exp
licitly, e.g. --storageEngine=mmapv1., terminating
修改命令,添加storageEngine
C:\Users\Administrator>mongod --dbpath C:\mongodbStore\dbTwo --storageEngine=mmapv1
C:\Users\Administrator>mongod --dbpath C:\mongodbStore\dbTwo --storageEngine=mma
pv1
2017-09-02T09:33:30.773+0800 I CONTROL [main]
2017-09-02T09:33:30.774+0800 W CONTROL [main] 32-bit servers don't have journal
ing enabled by default. Please use --journal if you want durability.
2017-09-02T09:33:30.775+0800 I CONTROL [main]
2017-09-02T09:33:30.782+0800 I CONTROL [main] Hotfix KB2731284 or later update
is installed, no need to zero-out data files
2017-09-02T09:33:30.787+0800 I CONTROL [initandlisten] MongoDB starting : pid=7
048 port=27017 dbpath=C:\mongodbStore\dbTwo 32-bit host=USER-20170813VL
2017-09-02T09:33:30.787+0800 I CONTROL [initandlisten] targetMinOS: Windows Vis
ta/Windows Server 2008
2017-09-02T09:33:30.788+0800 I CONTROL [initandlisten] db version v3.2.16
2017-09-02T09:33:30.789+0800 I CONTROL [initandlisten] git version: 056bf451281
14e44c5358c7a8776fb582363e094
2017-09-02T09:33:30.790+0800 I CONTROL [initandlisten] allocator: tcmalloc
2017-09-02T09:33:30.791+0800 I CONTROL [initandlisten] modules: none
2017-09-02T09:33:30.792+0800 I CONTROL [initandlisten] build environment:
2017-09-02T09:33:30.792+0800 I CONTROL [initandlisten] distarch: i386
2017-09-02T09:33:30.793+0800 I CONTROL [initandlisten] target_arch: i386
2017-09-02T09:33:30.794+0800 I CONTROL [initandlisten] options: { storage: { db
Path: "C:\mongodbStore\dbTwo", engine: "mmapv1" } }
2017-09-02T09:33:30.825+0800 I CONTROL [initandlisten]
2017-09-02T09:33:30.826+0800 I CONTROL [initandlisten] ** WARNING: This 32-bit
MongoDB binary is deprecated
2017-09-02T09:33:30.828+0800 I CONTROL [initandlisten]
2017-09-02T09:33:30.828+0800 I CONTROL [initandlisten]
2017-09-02T09:33:30.830+0800 I CONTROL [initandlisten] ** NOTE: This is a 32 bi
t MongoDB binary.
2017-09-02T09:33:30.831+0800 I CONTROL [initandlisten] ** 32 bit builds a
re limited to less than 2GB of data (or less with --journal).
2017-09-02T09:33:30.834+0800 I CONTROL [initandlisten] ** Note that journ
aling defaults to off for 32 bit and is currently off.
2017-09-02T09:33:30.835+0800 I CONTROL [initandlisten] ** See http://doch
ub.mongodb.org/core/32bit
2017-09-02T09:33:30.838+0800 I CONTROL [initandlisten]
2017-09-02T09:33:30.840+0800 I INDEX [initandlisten] allocating new ns file C
:\mongodbStore\dbTwo\local.ns, filling with zeroes...
2017-09-02T09:33:30.933+0800 I STORAGE [FileAllocator] allocating new datafile
C:\mongodbStore\dbTwo\local.0, filling with zeroes...
2017-09-02T09:33:30.934+0800 I STORAGE [FileAllocator] creating directory C:\mo
ngodbStore\dbTwo\_tmp
2017-09-02T09:33:30.963+0800 I STORAGE [FileAllocator] done allocating datafile
C:\mongodbStore\dbTwo\local.0, size: 64MB, took 0.007 secs
2017-09-02T09:33:30.970+0800 I NETWORK [HostnameCanonicalizationWorker] Startin
g hostname canonicalization worker
2017-09-02T09:33:31.200+0800 W FTDC [initandlisten] Failed to initialize Per
formance Counters for FTDC: WindowsPdhError: PdhExpandCounterPathW failed with '
在计算机上找不到指定的对象。' for counter '\Processor(_Total)\% Idle Time'
2017-09-02T09:33:31.201+0800 I FTDC [initandlisten] Initializing full-time d
iagnostic data capture with directory 'C:/mongodbStore/dbTwo/diagnostic.data'
2017-09-02T09:33:31.203+0800 I NETWORK [initandlisten] waiting for connections
on port 27017
这次可以了。
附上stackoverflow 对此问题的解答
https://stackoverflow.com/questions/34243731/mongodb-cannot-start-server-the-default-storage-engine-wiredtiger-is-not-avai/35222910#35222910
Because you are using the MongoDB on a 32bit machine, the storage engine wiredTiger is not supported on 32bit machine. There are two solutions of this problem:
- upgrade your system to 64bit
- change your storage engine to the engines that are suitable for 32bit system,like mmapv1, and run mongod again.
建立好了Storage之后,第二次不加上--storageEngine=mmapv1 参数也可以正常启动了。。
C:\Users\Administrator>mongod --dbpath C:\mongodbStore\dbTwo
2017-09-02T09:36:23.651+0800 I CONTROL [main]
2017-09-02T09:36:23.652+0800 W CONTROL [main] 32-bit servers don't have journal
ing enabled by default. Please use --journal if you want durability.
2017-09-02T09:36:23.652+0800 I CONTROL [main]
2017-09-02T09:36:23.659+0800 I CONTROL [main] Hotfix KB2731284 or later update
is installed, no need to zero-out data files
2017-09-02T09:36:23.663+0800 I CONTROL [initandlisten] MongoDB starting : pid=4
192 port=27017 dbpath=C:\mongodbStore\dbTwo 32-bit host=USER-20170813VL
2017-09-02T09:36:23.663+0800 I CONTROL [initandlisten] targetMinOS: Windows Vis
ta/Windows Server 2008
2017-09-02T09:36:23.664+0800 I CONTROL [initandlisten] db version v3.2.16
2017-09-02T09:36:23.664+0800 I CONTROL [initandlisten] git version: 056bf451281
14e44c5358c7a8776fb582363e094
2017-09-02T09:36:23.664+0800 I CONTROL [initandlisten] allocator: tcmalloc
2017-09-02T09:36:23.664+0800 I CONTROL [initandlisten] modules: none
2017-09-02T09:36:23.664+0800 I CONTROL [initandlisten] build environment:
2017-09-02T09:36:23.664+0800 I CONTROL [initandlisten] distarch: i386
2017-09-02T09:36:23.664+0800 I CONTROL [initandlisten] target_arch: i386
2017-09-02T09:36:23.664+0800 I CONTROL [initandlisten] options: { storage: { db
Path: "C:\mongodbStore\dbTwo" } }
2017-09-02T09:36:23.666+0800 I - [initandlisten] Detected data files in C
:\mongodbStore\dbTwo created by the 'mmapv1' storage engine, so setting the acti
ve storage engine to 'mmapv1'.
2017-09-02T09:36:23.686+0800 I CONTROL [initandlisten]
2017-09-02T09:36:23.686+0800 I CONTROL [initandlisten] ** WARNING: This 32-bit
MongoDB binary is deprecated
2017-09-02T09:36:23.687+0800 I CONTROL [initandlisten]
2017-09-02T09:36:23.688+0800 I CONTROL [initandlisten]
2017-09-02T09:36:23.689+0800 I CONTROL [initandlisten] ** NOTE: This is a 32 bi
t MongoDB binary.
2017-09-02T09:36:23.690+0800 I CONTROL [initandlisten] ** 32 bit builds a
re limited to less than 2GB of data (or less with --journal).
2017-09-02T09:36:23.690+0800 I CONTROL [initandlisten] ** Note that journ
aling defaults to off for 32 bit and is currently off.
2017-09-02T09:36:23.691+0800 I CONTROL [initandlisten] ** See http://doch
ub.mongodb.org/core/32bit
2017-09-02T09:36:23.698+0800 I CONTROL [initandlisten]
2017-09-02T09:36:23.710+0800 I NETWORK [HostnameCanonicalizationWorker] Startin
g hostname canonicalization worker
2017-09-02T09:36:23.942+0800 W FTDC [initandlisten] Failed to initialize Per
formance Counters for FTDC: WindowsPdhError: PdhExpandCounterPathW failed with '
在计算机上找不到指定的对象。' for counter '\Processor(_Total)\% Idle Time'
2017-09-02T09:36:23.943+0800 I FTDC [initandlisten] Initializing full-time d
iagnostic data capture with directory 'C:/mongodbStore/dbTwo/diagnostic.data'
2017-09-02T09:36:23.945+0800 I NETWORK [initandlisten] waiting for connections
on port 27017