Mongod Start
Originally wanted to write replica of the non-test mode of the cluster architecture, but it is the hand itch, the MongoDB 3.0 to download down, looked at the document after one or two eyes decided to write a little bit about the start of the topic, then write replica when basically using MongoDB 3.0 Way +YAML is configured to do it.
Mongod using MMAPV1 to start
This is the default startup mode. Mongod of the start parameters, originally wanted to have empty summary of, I le a go, some estimate this life also can not use the scene also do not know how to write, until I think about it again.
preparing the configuration file
storage: dbPath: C:\datam\db engine: mmapv1
Note that the engine this place can not write Oh, the default is MMAPV1. The remaining dozens of parameters do not write too much first.
Start
C:\MongoDB3\Server\3.0\bin>mongod -f C:\MongoDB3\Server\3.0\etc\conf\config.conf
After executing the above command:
2015-03-06T23:50:20.794+0800 I CONTROL [initandlisten] MongoDB starting : pid=1
4116 port=27017 dbpath=C:\datam\db 64-bit host=yanglu
2015-03-06T23:50:20.798+0800 I CONTROL [initandlisten] targetMinOS: Windows 7/W
indows Server 2008 R2
2015-03-06T23:50:20.799+0800 I CONTROL [initandlisten] db version v3.0.0
2015-03-06T23:50:20.800+0800 I CONTROL [initandlisten] git version: a841fd63943
65954886924a35076691b4d149168
2015-03-06T23:50:20.802+0800 I CONTROL [initandlisten] OpenSSL version: OpenSSL
1.0.1j-fips 15 Oct 2014
2015-03-06T23:50:20.803+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-06T23:50:20.804+0800 I CONTROL [initandlisten] allocator: system
2015-03-06T23:50:20.805+0800 I CONTROL [initandlisten] options: { config: "C:\M
ongoDB3\Server\3.0\etc\conf\config.conf", storage: { dbPath: "C:\datam\db", engi
ne: "mmapv1" } }
2015-03-06T23:50:20.916+0800 I JOURNAL [initandlisten] journal dir=C:\datam\dbjournal
2015-03-06T23:50:20.918+0800 I JOURNAL [initandlisten] recover : no journal fil
es present, no recovery needed
2015-03-06T23:50:20.953+0800 I JOURNAL [durability] Durability thread started
2015-03-06T23:50:20.954+0800 I JOURNAL [journal writer] Journal writer thread s
tarted
2015-03-06T23:50:21.167+0800 I INDEX [initandlisten] allocating new ns file C
:\datam\db\local.ns, filling with zeroes...
2015-03-06T23:50:21.564+0800 I STORAGE [FileAllocator] allocating new datafile
C:\datam\db\local.0, filling with zeroes...
2015-03-06T23:50:21.565+0800 I STORAGE [FileAllocator] creating directory C:\da
tam\db\_tmp
2015-03-06T23:50:21.570+0800 I STORAGE [FileAllocator] done allocating datafile
C:\datam\db\local.0, size: 64MB, took 0.002 secs
2015-03-06T23:50:21.590+0800 I NETWORK [initandlisten] waiting for connections
on port 27017
Blah, run up. It was like this before 3.0, nothing special.
Mongod using Wiredtiger to start
This is required to specify the startup mode.
preparing the configuration file
storage: dbPath: C:\dataw\db engine: wiredTiger
Note that the engine this place is set Wiredtiger oh.
Start
C:\MongoDB3\Server\3.0\bin>mongod -f C:\MongoDB3\Server\3.0\etc\conf\config.conf
After executing the above command:
C:\MongoDB3\Server\3.0\bin>mongod -f C:\MongoDB3\Server\3.0\etc\conf\config.conf
2015-03-06T23:59:56.445+0800 I CONTROL [initandlisten] MongoDB starting : pid=1
4076 port=27017 dbpath=C:\dataw\db 64-bit host=yanglu
2015-03-06T23:59:56.449+0800 I CONTROL [initandlisten] targetMinOS: Windows 7/W
indows Server 2008 R2
2015-03-06T23:59:56.449+0800 I CONTROL [initandlisten] db version v3.0.0
2015-03-06T23:59:56.449+0800 I CONTROL [initandlisten] git version: a841fd63943
65954886924a35076691b4d149168
2015-03-06T23:59:56.450+0800 I CONTROL [initandlisten] OpenSSL version: OpenSSL
1.0.1j-fips 15 Oct 2014
2015-03-06T23:59:56.450+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-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
impact of Storage format
Above I launch two mongod using:
C:\DATAM\DB:MMAPV1 mode
C:\dataw\db:wiredtiger mode
Two different folders, using two different storage modes, MongoDB 3.0 emphasizes that when the specified DBPath uses the storage engine and your engine is inconsistent, MongoDB is refused to start the OH.
–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 th e one specified by–storageengine, Mongod'll refuse to start.
Mmapv1 above start Wiredtiger
Let's try the engine for C:\DATAM\DB using Wiredtiger:
storage: dbPath: C:\datam\db engine: wiredTiger
Results:
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
It has been clearly written that we mistakenly used the Wiredtiger engine on top of the MMAPV1, unable to start.
Wiredtiger above start Mmapv1
Let's try the engine for C:\DATAW\DB using 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-07T00:10:09.777+0800 I CONTROL [initandlisten] MongoDB starting : pid=1
5152 port=27017 dbpath=C:\dataw\db 64-bit host=yanglu
2015-03-07T00:10:09.781+0800 I CONTROL [initandlisten] targetMinOS: Windows 7/W
indows Server 2008 R2
2015-03-07T00:10:09.784+0800 I CONTROL [initandlisten] db version v3.0.0
2015-03-07T00:10:09.784+0800 I CONTROL [initandlisten] git version: a841fd63943
65954886924a35076691b4d149168
2015-03-07T00:10:09.789+0800 I CONTROL [initandlisten] OpenSSL version: OpenSSL
1.0.1j-fips 15 Oct 2014
2015-03-07T00:10:09.790+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:10:09.792+0800 I CONTROL [initandlisten] allocator: system
2015-03-07T00:10:09.793+0800 I CONTROL [initandlisten] options: { config: "C:\M
ongoDB3\Server\3.0\etc\conf\config.conf", storage: { dbPath: "C:\dataw\db", engi
ne: "mmapv1" } }
2015-03-07T00:10:09.796+0800 I STORAGE [initandlisten] exception in initAndList
en: 28574 Cannot start server. Detected data files in C:\dataw\db created by sto
rage engine ‘wiredTiger‘. The configured storage engine is ‘mmapv1‘., terminatin
g
2015-03-07T00:10:09.798+0800 I CONTROL [initandlisten] dbexit: rc: 100
The result can be imagined, really is not to.
つづく???
MongoDB's reading Notes (via3.0) (00) _ "Overview" (_mongodb3.0) Mongod startup mode test Sledgehammer