我是新來蒙戈-DB,我試圖通過以下的過程中蒙戈-DB網絡site..But我得到了一些錯誤配置分片......我將介紹的步驟我所遵循的配置分片......我試圖拆分在視窗操作系統......分片配置的幫助
步驟1:
*)在第一機I在所創建的兩個文件夾即下面的路徑c:/ data/db/a; c:/ data/db/config
*)現在我打開命令提示符並使用以下命令配置分片服務器.......
C:/Program Files/mongodb-win32-i386-1.6.2/bin/mongod --shardsvr --dbpath c:/data/db/a --port 10000
步驟2:
*)在第二機i的下列路徑C創建的兩個文件夾,即:/數據/分貝/ B; C:/數據/分貝/配置
*)我再次打開命令提示符,然後我用下面的命令來配置碎片服務器.......
*)現在我打開命令提示符,然後我用下面的命令來配置碎片服務器..... ..
C:/Program Files/mongodb-win32-i386-1.6.2/bin/mongod --shardsvr --dbpath c:/data/db/a --port 10001
步驟3:
*)在第一機器我打開命令提示和我用下面的命令來配置配置服務器....
C:/Program Files/mongodb-win32-i386-1.6.2/bin/mongod --configsvr --dbpath c:/data/db/config --port 20000
步驟4:
*)在第二機器我打開命令提示和我用下面的命令來配置配置服務器....
C:/Program Files/mongodb-win32-i386-1.6.2/bin/ mongod --configsvr --dbpath c:/data/db/config --port 20001
步驟5:
*)我第一機器我打開命令提示和我用下面的命令來配置mongos服務器用於第一機器........
C:/Program Files/mongodb-win32-i386-1.6.2/bin/ mongos --configdb first-machine-ip:20000
*)同樣我打開另一個命令提示和我用下面的命令配置mongos服務器對於第二機器........
C:/Program Files/mongodb-win32-i386-1.6.2/bin/ mongos --configdb Second-machine-ip:20001
步驟6:
*)現在我運行蒙戈過程如下..
C:/Program Files/mongodb-win32-i386-1.6.2/bin/ mongo.exe first-machine-ip:27017/admin
步驟7:
*)要添加&使分片我也遵循以下.......
> use admin
switched to db admin
> db.runCommand({ addshard : "10.0.0.137:10000" })
{ "shardAdded" : "shard0000", "ok" : 1 }
> db.runCommand({ addshard : "10.0.0.180:10001" })
{ "shardAdded" : "shard0001", "ok" : 1 }
> db.runCommand({ enablesharding : "test" })
{ "ok" : 1 }
> db.runCommand({ shardcollection : "test.block_seek_pos", key : {file_GUID : 1} })
{ "collectionsharded" : "test.people", "ok" : 1 }
步驟8步驟:
*)現在我已經配置了一個普通的備份。
*)一旦備份完成我檢查了所有的命令提示符下打印......
*)我得到的錯誤如下......在mongos進程終端....
>>mongos db version v1.6.2, pdfile version 4.5 starting (--help for usage)
>>git version: aef371ecf5d2a824f16ccdc3b745f3702165602f
>>sys info: windows (5, 1, 2600, 2, 'Service Pack 3') BOOST_LIB_VERSION=1_35
>>waiting for connections on port 27017
>>[websvr] web admin interface listening on port 28017
>>couldn't find database [sgserver] in config db
>>can't find a shard to put new db on
>>DBException in process: can't find a shard to put new db on
>>couldn't find database [sgserver] in config db
>>can't find a shard to put new db on
>>DBException in process: can't find a shard to put new db on
>>couldn't find database [sgserver] in config db
>>can't find a shard to put new db on
>>DBException in process: can't find a shard to put new db on
>>going to add shard: { _id: "shard0000", host: "first-machine-ip:10000" }
>>going to add shard: { _id: "shard0001", host: "second-machine-ip:10001" }
>>couldn't find database [test] in config db
>>put [test] on: shard0000:first-machine-ip:10000
>>enabling sharding on: test
>>CMD: shardcollection: { shardcollection: "test.people", key: { file_GUID: 1.0 } }
>>enable sharding on: test.people with shard key: { file_GUID: 1.0 }
>>no chunks for:test.people so creating first: ns:test.people at: shard0000:first-machine->>ip:10000 lastmod: 1|0 min: { file_GUID: MinKey } max: { file_GUID: MaxKey }
>>couldn't find database [sgserver] in config db
>>put [sgserver] on: shard0001:second-machine-ip:10001
>>creating WriteBackListener for: first-machine-ip:10000
>>creating WriteBackListener for: second-machine-ip:10001
任何人都可以幫我這個分片.......我正在等待烏拉圭回合的答覆........
先感謝, 薩姆帕斯庫馬爾...
您好,感謝您的解決方案.... u能解釋蒙戈流程配置按我的設置........ – SampathKumar 2011-01-13 05:30:27