设为首页 加入收藏

TOP

mongoDB的读书笔记(via3.0)(00)_【概览】(02)_mongoDB3.0中的mongod启动方式小试牛刀(二)
2015-11-21 01:45:35 来源: 作者: 【 】 浏览:1
Tags:mongoDB 读书 笔记 via3.0 概览 _mongoDB3.0 mongod 启动 方式 小试牛刀
listen] build info: windows sys. getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Servic e Pack 1') BOOST_LIB_VERSION=1_49 2015-03-06T23:59:56.451+0800 I CONTROL [initandlisten] allocator: system 2015-03-06T23:59:56.453+0800 I CONTROL [initandlisten] options: { config: "C:\M ongoDB3\Server\3.0\etc\conf\config.conf", storage: { dbPath: "C:\dataw\db", engi ne: "wiredTiger" } } 2015-03-06T23:59:56.457+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=3G,session_max=20000,eviction=(threads_max=4),statistics=(fast ),log=(enabled=true,archive=true,path=journal,compressor=snappy),checkpoint=(wai t=60,log_size=2GB),statistics_log=(wait=0), 2015-03-06T23:59:56.942+0800 I NETWORK [initandlisten] waiting for connections on port 27017

Storage format的影响

上面我启动两个mongod使用的是:
C:\datam\db : mmapv1模式
C:\dataw\db : wiredTiger模式
两个不同的文件夹,使用的两个不同的存储模式,mongoDB的3.0中强调,当指定的dbpath使用的存储引擎和你的engine不一致的时候,mongoDB是拒绝启动的哦。

?storageEngine string
Default: mmapv1

New in version 3.0.0.

Specifies the storage engine for the mongod database. Valid options include mmapv1 and wiredTiger.

If you attempt to start a mongod with a storage.dbPath that contains data files produced by a storage engine other than the one specified by ?storageEngine, mongod will refuse to start.

mmapv1上面启动wiredTiger

我们试试对C:\datam\db 使用wiredTiger的引擎:

storage:
   dbPath: C:\datam\db
   engine: wiredTiger

结果:

C:\MongoDB3\Server\3.0\bin>mongod -f C:\MongoDB3\Server\3.0\etc\conf\config.conf

2015-03-07T00:07:04.052+0800 I CONTROL  [initandlisten] MongoDB starting : pid=1
1576 port=27017 dbpath=C:\datam\db 64-bit host=yanglu
2015-03-07T00:07:04.056+0800 I CONTROL  [initandlisten] targetMinOS: Windows 7/W
indows Server 2008 R2
2015-03-07T00:07:04.056+0800 I CONTROL  [initandlisten] db version v3.0.0
2015-03-07T00:07:04.056+0800 I CONTROL  [initandlisten] git version: a841fd63943
65954886924a35076691b4d149168
2015-03-07T00:07:04.057+0800 I CONTROL  [initandlisten] OpenSSL version: OpenSSL
 1.0.1j-fips 15 Oct 2014
2015-03-07T00:07:04.057+0800 I CONTROL  [initandlisten] build info: windows sys.
getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Servic
e Pack 1') BOOST_LIB_VERSION=1_49
2015-03-07T00:07:04.058+0800 I CONTROL  [initandlisten] allocator: system
2015-03-07T00:07:04.059+0800 I CONTROL  [initandlisten] options: { config: "C:\M
ongoDB3\Server\3.0\etc\conf\config.conf", storage: { dbPath: "C:\datam\db", engi
ne: "wiredTiger" } }
2015-03-07T00:07:04.062+0800 I STORAGE  [initandlisten] exception in initAndList
en: 28574 Cannot start server. Detected data files in C:\datam\db created by sto
rage engine 'mmapv1'. The configured storage engine is 'wiredTiger'., terminatin
g
2015-03-07T00:07:04.063+0800 I CONTROL  [initandlisten] dbexit:  rc: 100

2015-03-07T00:07:04.062+0800 I STORAGE [initandlisten] exception in initAndList
en: 28574 Cannot start server. Detected data files in C:\datam\db created by sto
rage engine ‘mmapv1’. The configured storage engine is ‘wiredTiger’., terminatin
g

上面已经很明确写出了我们错误地在mmapv1的上面使用wiredTiger的引擎,无法启动。

wiredTiger上面启动mmapv1

我们试试对C:\dataw\db 使用mmapv1的引擎:

storage:
   dbPath: C:\dataw\db
   engine: mmapv1
C:\MongoDB3\Server\3.0\bin>mongod -f C:\MongoDB3\Server\3.0\etc\conf\config.conf

2015-03-07T
首页 上一页 1 2 3 下一页 尾页 2/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇重命名表空间和删除表空间 下一篇深入浅出Redis(三)高级特性:管..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: