2016-08-24 3 views
3

샤드 드 환경에서 새 데이터베이스에 새 모음을 만들고 있습니다.mongodb에서 읽기 기본 설정과 일치하는 호스트를 찾을 수 없습니다.

coll.insertMany(list) 동안 다음 오류가 발생합니다.

Exception in thread "main" com.mongodb.MongoCommandException: 
Command failed with error 133: 'unable to target write op for collection dbname.collection:: caused by :: 
FailedToSatisfyReadPreference: Could not confirm non-existence of database "dbname" due to inability to query the config server primary :: caused by :: 
FailedToSatisfyReadPreference: could not find host matching read preference { mode: "primary" } for set csReplSet' on server ip:27017. 
The full response is { "ok" : 0, "code" : 133, "errmsg" : "unable to target write op for collection dbname.collection:: caused by :: 
FailedToSatisfyReadPreference: Could not confirm non-existence of database \"dbname\" due to inability to query the config server primary :: caused by :: 
FailedToSatisfyReadPreference: could not find host matching read preference { mode: \"primary\" } for set csReplSet" } 
+1

은 [기본 설정을 읽기] (https://docs.mongodb.com/manual/core/read-preference/) * 주 *는 것 같다 및 복제에서 사용 가능한 기본 노드가 없습니다 당신 쿼리 중입니다. 읽기 기본 설정을 * secondary * 또는 * primaryPreferred *로 변경할 수 있습니다. 그러나이 솔루션은 사용하는 Java MongoDB Driver 버전에 따라 다릅니다. 예외를 throw하는 Java 코드를 추가합니다. – tarashypka

+0

thanx ... 기본 복제본이 다운되었습니다. – chopra

답변

관련 문제