: ("1 w") : 나는 블루 - 그린 배포를 사용하여 배포 만이 응용 프로그램은 연결에 실패
cf push $APP-new
cf map-route $APP-new $DOMAIN --hostname $APP
cf unmap-route $APP $DOMAIN --hostname $APP || true
cf unmap-route $APP-new $DOMAIN --hostname $APP-new
cf delete -f $APP
cf rename $APP-new $APP
을 내 응용 프로그램에서 나는 WriteConcern를 지정하지 않는, 그래서 그것은 단지 주요 가정
마다 cf bind-service
또는 cf unbind-service
으로 Servicebroker (Cloud Foundry 구성 요소)은 새로운 임의 생성 생성 인증 정보를 생성합니다 (cf env $APP
참조). MongoEnterprise 서비스를 통해 Service Broker는 Ops Manager API에 연결하고 새로운 User를 mongod 복제본에 배포합니다.
옵스 관리자가 사용자 (
createUser
)를 배포

그는 쓰기를 인정하는 적어도 하나 개의 보조 요구를 의미 WriteConcern "대부분"를 사용합니다.
COMMAND [conn53768] command rs_$DBNAME.$cmd command: createUser { createUser: "$USERNAME", pwd: "xxx", digestPassword: false, roles: [ { role: "readWrite", db: "rs_$DBNAME" } ], writeConcern: { w: "majority" } } keyUpdates:0 writeConflicts:0 numYields:0 reslen:138 locks:{ Global: { acquireCount: { r: 2, w: 2 } }, Database: { acquireCount: { W: 2 } }, Collection: { acquireCount: { w: 2 } } } protocol:op_query 9811ms
이 문제가 발생하기 전에 몇 시간을 수행 한 mongorestore
, 탓으로 createUser
명령으로 인해 전경 바쁜 건물 인덱스 있었다 세컨더리의 승인의 부족으로 시간 초과 된 가능성이있다 및 배경. 색인 빌드 (기본 mongorestore
옵션)는 기본에서 먼저 완료되고 완료되면 보조에서 진행됩니다. 이는 createUser
동안 보조 직원의 지연 시간을 설명합니다.
인덱스 빌드는 인덱스 및 데이터 크기에 따라 매우 오랜 시간이 걸릴 수 있습니다. 우리는 인덱스 구축에 관한 많은 고객 불만이 너무 오래 걸린다 고 들었습니다.
다음은 색인 빌드의 로그입니다. Ops Manager에서 고객은 모든 복제 세트 구성원에서 약간 지연된 스트리밍 mongodb.log
(opsmanager.service.consul)을 볼 수 있습니다. WriteConcern와 모든 :
...
2017-02-15T10:40:06.199+0000 I INDEX [repl writer worker 10] build index done. scanned 1108917 total records. 672 secs
2017-02-15T10:50:08.553+0000 I INDEX [repl writer worker 4] build index done. scanned 1108917 total records. 602 secs
2017-02-15T11:01:13.888+0000 I INDEX [repl writer worker 7] build index done. scanned 1108917 total records. 665 secs
...
2017-02-15T15:01:37.405+0000 I INDEX [repl index builder 176] build index done. scanned 1109531 total records. 659 secs
2017-02-15T15:01:37.406+0000 I INDEX [repl index builder 170] build index done. scanned 1109531 total records. 659 secs
2017-02-15T15:16:20.139+0000 I INDEX [repl index builder 170] build index done. scanned 1109699 total records. 882 secs
그
이
Automation Agent에서 오류가 있습니다
[2017/02/15 13:33:36.297] [.error] [cm/mongoctl/authctl.go:updateUser26Style:697] [101] <rs_$DB_NAME> [13:33:36.297] Error updating 2.6-style user = AuthUser([email protected]_$DB_NAME,roles=AuthRoles(1:{"Rolename":"readWrite","Db":"rs_$DB_NAME"}),interned=true,identity=2) in db = rs_$DB_NAME : <rs_$DB_NAME> [13:33:36.297] Timed out (timeout=-1ns) trying to runCommandWithTimeout(dbName=rs_$DB_NAME, cmd=[{"Name":"updateUser","Value":"$USER"},{"Name":"pwd","Value":"$PASSWORD"},{"Name":"digestPassword","Value":false},{"Name":"roles","Value":[{"db":"rs_$DB_NAME","role":"readWrite"}]}])
[2017/02/15 13:33:36.297] [.error] [cm/mongoctl/authctl.go:UpsertUser:516] [101] <rs_$DB_NAME> [13:33:36.297] Error upserting 2.6-style user = AuthUser([email protected]_$DB_NAME,roles=AuthRoles(1:{"Rolename":"readWrite","Db":"rs_$DB_NAME"}),interned=true,identity=2) : <rs_$DB_NAME> [13:33:36.297] Error updating 2.6-style user = AuthUser([email protected]_$DB_NAME,roles=AuthRoles(1:{"Rolename":"readWrite","Db":"rs_$DB_NAME"}),interned=true,identity=2) in db = rs_$DB_NAME : <rs_$DB_NAME> [13:33:36.297] Timed out (timeout=-1ns) trying to runCommandWithTimeout(dbName=rs_$DB_NAME, cmd=[{"Name":"updateUser","Value":"$USER"},{"Name":"pwd","Value":"$PASSWORD"},{"Name":"digestPassword","Value":false},{"Name":"roles","Value":[{"db":"rs_$DB_NAME","role":"readWrite"}]}])
[2017/02/15 13:33:36.297] [.error] [cm/action/adjustusers.go:adjustUsers:52] [101] <rs_$DB_NAME> [13:33:36.297] Error upserting user = AuthUser([email protected]_$DB_NAME,roles=AuthRoles(1:{"Rolename":"readWrite","Db":"rs_$DB_NAME"}),interned=true,identity=2). Trying to proceed though. : <rs_$DB_NAME> [13:33:36.297] Error upserting 2.6-style user = AuthUser([email protected]_$DB_NAME,roles=AuthRoles(1:{"Rolename":"readWrite","Db":"rs_$DB_NAME"}),interned=true,identity=2) : <rs_$DB_NAME> [13:33:36.297] Error updating 2.6-style user = AuthUser([email protected]_$DB_NAME,roles=AuthRoles(1:{"Rolename":"readWrite","Db":"rs_$DB_NAME"}),interned=true,identity=2) in db = rs_$DB_NAME : <rs_$DB_NAME> [13:33:36.297] Timed out (timeout=-1ns) trying to runCommandWithTimeout(dbName=rs_$DB_NAME, cmd=[{"Name":"updateUser","Value":"$USER"},{"Name":"pwd","Value":"$PASSWORD"},{"Name":"digestPassword","Value":false},{"Name":"roles","Value":[{"db":"rs_$DB_NAME","role":"readWrite"}]}])
[2017/02/15 13:33:36.381] [.error] [cm/executor/executor.go:ExecutePlan:184] <rs_$DB_NAME> [13:33:36.381] Postcondition failed for step AdjustUsers because
[The value of 'currentState.UsersRight' = false, but it should be true]. Outcome=3
요약 (Manager가 관리 VM에 Autoamtion 에이전트와 HTTP를 통해 말하는 본부, 자동화 에이전트는 기본 프로토콜 mongod로 말) 기본은 정상적으로 작동하지만 WriteConcern 대다수 시간이 지나면 인덱스 빌드를 차단합니다.
cf push $APP-new
# only old app active
# test new app
curl --fail --silent --output /dev/null https://$APP-new.$DOMAIN/status
cf map-route $APP-new $DOMAIN --hostname $APP
# both apps active
cf apps
cf routes
cf unmap-route $APP $DOMAIN --hostname $APP || true
# only new app active
cf unmap-route $APP-new $DOMAIN --hostname $APP-new
cf delete -f $APP
cf rename $APP-new $APP
cf apps
이 예는 있다고 가정합니다