转载

如何检查当前mongodb是否启用了WiredTiger存储引擎?

dbDao 百度贴吧:http://tieba.baidu.com/dbdao

MongoDB技术学习QQ群: 421431253

如何检查当前mongodb是否启用了WiredTiger存储引擎?

可以至少通过以下2种方法 验证:

1、在Linux/OSX上执行如下的命令

WIREDTIGER_CONFIGURED=`ps -ef|grep mongod|grep -i storageengine|grep -ic wiredtiger` echo ${WIREDTIGER_CONFIGURED}

如果返回为1则说明当前系统中运行着一个以WiredTiger为存储引擎的mongod

2、在Linux/OSX上执行如下的命令

echo "db.serverStatus()"| mongo|grep wiredTiger

若返回信息中有wiredTiger,则说明该mongo连接到了一个启用了wiredTiger存储引擎的mongod.

注意对于启用了wiredTiger的文件路径–dbpath,无法再使用默认mmapv1存储引擎打开,例如:

ac:mongodata maclean$ mongod --storageEngine wiredTiger --dbpath  /Users/maclean/mongodata 2015-05-06T11:35:32.372+0800 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=4G,session_max=20000,eviction=(threads_max=4),statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0), 2015-05-06T11:35:32.997+0800 I CONTROL  [initandlisten] MongoDB starting : pid=16590 port=27017 dbpath=/Users/maclean/mongodata 64-bit host=ac.local 2015-05-06T11:35:32.998+0800 I CONTROL  [initandlisten] db version v3.0.2 2015-05-06T11:35:32.998+0800 I CONTROL  [initandlisten] git version: nogitversion 2015-05-06T11:35:32.998+0800 I CONTROL  [initandlisten] build info: Darwin yosemitevm.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49 2015-05-06T11:35:32.998+0800 I CONTROL  [initandlisten] allocator: system 2015-05-06T11:35:32.999+0800 I CONTROL  [initandlisten] options: { storage: { dbPath: "/Users/maclean/mongodata", engine: "wiredTiger" } } 2015-05-06T11:35:33.045+0800 I NETWORK  [initandlisten] waiting for connections on port 27017   如上启用了--storageEngine wiredTiger 可以正常运行    如果用mmapv1引擎则报错  ac:mongodata maclean$ mongod --storageEngine mmapv1 --dbpath  /Users/maclean/mongodata 2015-05-06T11:36:34.037+0800 I STORAGE  [initandlisten] exception in initAndListen: 28574 Cannot start server. Detected data files in /Users/maclean/mongodata created by storage engine 'wiredTiger'. The configured storage engine is 'mmapv1'., terminating 2015-05-06T11:36:34.037+0800 I CONTROL  [initandlisten] dbexit:  rc: 100

相关文章 | Related posts:

  1. 在Windows 7上安装MongoDB 2.6.7 注意:Windows并不适合学习和部署MongoDB ,本文仅仅是介绍在Windows7上如何安装MongoD […]...
  2. MongoDB的Namespace dbDao 百度贴吧:http://tieba.baidu.com/dbdao MongoDB技术学习QQ群: […]...
  3. APOUC 2015台北 User groups:   APOUC台北第一天     Tom Kyte & […]...
  4. 诗檀软件成功帮助云南某旅游企业恢复断电受损的Oracle数据库 诗檀软件在年前成功帮助云南某旅游企业恢复断电受损的数据库 用户网站后台数据库在部署HA之前意外断电后无法OPE […]...
  5. 某企业ASM存储变更导致ASM DISKGROUP上的多套库出现损坏 某南方变更ASM所使用底层存储的RAID盘后,ASM 马上出现fail I/O问题,该环境中ASM Diskg […]...
正文到此结束
Loading...