如何知道 mongodb 是在 64 位模式还是 32 位模式下运行

如何知道 mongodb 是在 64 位模式还是 32 位模式下运行

我的程序员安装了 mongodb。然后不知怎么的,它不起作用。我运行

C:\mongod\bin>mongod
mongod --help for help and startup options
Sat Aug 11 22:57:50
Sat Aug 11 22:57:50 warning: 32-bit servers don't have journaling enabled by def
ault. Please use --journal if you want durability.
Sat Aug 11 22:57:50
Sat Aug 11 22:57:50 [initandlisten] MongoDB starting : pid=3800 port=27017 dbpat
h=/data/db 32-bit host=haryantoi5
Sat Aug 11 22:57:50 [initandlisten]
Sat Aug 11 22:57:50 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are
limited to about 2 gigabytes of data
Sat Aug 11 22:57:50 [initandlisten] **       see http://blog.mongodb.org/post/13
7788967/32-bit-limitations
Sat Aug 11 22:57:50 [initandlisten] **       with --journal, the limit is lower
Sat Aug 11 22:57:50 [initandlisten]
Sat Aug 11 22:57:50 [initandlisten] db version v2.0.7-rc1, pdfile version 4.5
Sat Aug 11 22:57:50 [initandlisten] git version: 9efe4cce272373b52b96de1309c1fbf
0c984305f
Sat Aug 11 22:57:50 [initandlisten] build info: windows sys.getwindowsversion(ma
jor=6, minor=0, build=6002, platform=2, service_pack='Service Pack 2') BOOST_LIB
_VERSION=1_42
Sat Aug 11 22:57:50 [initandlisten] options: {}
**************
Unclean shutdown detected.
Please visit http://dochub.mongodb.org/core/repair for recovery instructions.
*************
Sat Aug 11 22:57:50 [initandlisten] exception in initAndListen: 12596 old lock f
ile, terminating
Sat Aug 11 22:57:50 dbexit:
Sat Aug 11 22:57:50 [initandlisten] shutdown: going to close listening sockets..
.
Sat Aug 11 22:57:50 [initandlisten] shutdown: going to flush diaglog...
Sat Aug 11 22:57:50 [initandlisten] shutdown: going to close sockets...
Sat Aug 11 22:57:50 [initandlisten] shutdown: waiting for fs preallocator...
Sat Aug 11 22:57:50 [initandlisten] shutdown: closing all files...
Sat Aug 11 22:57:50 [initandlisten] closeAllFiles() finished
Sat Aug 11 22:57:50 dbexit: really exiting now

看来 mongod 是在 32 位上运行的。我有一台 64 位计算机,我想在 64 位环境中运行 mongodb。我该怎么做?

答案1

您的问题不在于 64 位和 32 位架构之间的差异。这是一个警告,服务器应该继续运行(尽管在 32 位下您的数据限制为 2Gb)。您真正要面对的是以下行:

Unclean shutdown detected.
Please visit http://dochub.mongodb.org/core/repair for recovery instructions.
*************
Sat Aug 11 22:57:50 [initandlisten] exception in initAndListen: 12596 old lock file, terminating

这意味着数据库被强制关闭,并且尚未自行清理。您需要运行“mongod --repair”来清理陈旧的锁并使数据库恢复正常。

http://www.mongodb.org/display/DOCS/Durability+and+Repair

请注意建议不要删除锁文件的部分。

相关内容