2011-01-10 6 views
3

mongo-db를 처음 사용하고 있습니다. mongo-db 웹 사이트의 절차에 따라 샤딩을 구성하려고했으나 일부 ​​오류가 발생했습니다 ...... 내가 구성 샤딩에 대한 따랐다하는 ...... 나는 ...... 윈도우 운영 체제에서 샤딩을 시도SHARTING CONFIGURATION HELP

1 단계 :

*) 나는 두 개의 폴더, 즉 생성 된 첫 번째 컴퓨터에서 C :/data/db/a; c :/data/db/config

*) 이제 명령 프롬프트를 열고 샤드 서버를 구성하기 위해 다음 명령을 사용했습니다 ...

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

단계 2 :

*) 난 다음 경로 (C)에 두 폴더 즉 만들어진 초 기계/데이터/DB/B, C/데이터/DB/구성

*) 다시 명령 프롬프트를 연 다음 샤드 서버를 구성하기 위해 다음 명령을 사용했습니다 .......

*) 이제 명령 프롬프트를 열고 샤드 서버를 구성하기 위해 다음 명령을 사용했습니다 ..... ..

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

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 단계 내가 명령 프롬프트를 열고 난 설정 서버를 구성하는 명령을 다음 사용

*) I 첫번째 기계 내가 명령 프롬프트를 열고 내가 처음 컴퓨터에 대한 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 단계 :

다음 지금은 몽고 프로세스를 실행 *)

012,351 .. 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 

사람이 샤딩 나를 도울 수에 ...... 다음과 같이

*) 나는 나는 ....... 오류를 가지고 UR 회신을 기다리고 있어요 ........

사전 감사, Sampath 쿠마르 ...

답변

2

난 당신이 mongos (라우터)가 작동하는 방법을 오해하고 있다고 생각 :

*) 나는 처음으로 명령 프롬프트를 열었고 다음 명령을 사용하여 첫 번째 컴퓨터에 대한 mongos-server를 구성했습니다 ........ C :/Program Files/mongodb-win32-i386-1.6.2/bin/mongos --configdb first-machine-ip : 20000

이것은 아무것도 구성하지 않습니다. 샤딩 명령은 mongos에서 실행해야합니다. 첫째/프로그램 파일/MongoDB를-는 Win32-i386-1.6.2/빈/mongo.exe :

C : 해당 포트의 과정을 시작하지 않았기 때문에

다음 줄

는 이해되지 않는다 -machine-ip : 27017/admin

+0

안녕하세요, 솔루션에 감사드립니다 .... 내 설정에 따라 mongo 프로세스 구성을 설명 할 수 있습니까? – SampathKumar