HELP CONFIGURATION

I'm new to mongo-db, I tried setting up sharding by following the procedure on the mongo-db website. But I get some errors ... I will describe the steps that I have for setting up sharding ...... I tried outlines in windows-os ......

Step 1:

*) In the first machine, I created two folders in the following path c: / data / db / a; c: / data / db / config

*) Now I opened the command line and I used the following command to configure the shard server .......

C:/Program Files/mongodb-win32-i386-1.6.2/bin/mongod --shardsvr --dbpath c:/data/db/a --port 10000

Step 2:

*) On the second computer, I created two folders in the following path c: / data / db / b; c: / data / db / config

*) Again, I opened the command line, and I used the following command to configure the shard server .......

*) Now I opened the command line and I used the following command to configure the shard server .......

C:/Program Files/mongodb-win32-i386-1.6.2/bin/mongod --shardsvr --dbpath c:/data/db/a --port 10001

Step 3:

*) On the first machine, I opened a command prompt, and I used the following command to configure the config server ....

 C:/Program Files/mongodb-win32-i386-1.6.2/bin/mongod --configsvr --dbpath c:/data/db/config --port 20000 

Step 4:

*) , config-....

 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:

*) mongo .

   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

....... ........

, , ...

+3
1

, , ():

*) , 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/mongo.exe first-machine-ip: 27017/admin

+2

Source: https://habr.com/ru/post/1784505/


All Articles