- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
新部署的应用程序的凭据被 MongoDB 拒绝并显示“身份验证失败”。 MongoDB Ops Manager 已经停留在“AdjustUsers”几个小时了。
验证者:
cf service-connector 8080 opsmanager.service.consul:8080
打开浏览器 http://localhost:8080并使用在门户网站上获得的 mongodb 服务 key 登录:
"ops_manager_url": "http://opsmanager.service.consul:8080",
"ops_manager_user": "xxx",
"ops_manager_password": "xxx",
我最近使用 mongorestore 恢复了大约 20GB 的数据:
cf service-connector 27020 xxx-0.service.consul:33602
mongorestore --gzip --port 27020 --username xxx --password xxx --db rs_xxx /backup/mongodump/ > mongorestore.log 2>&1 &
其他已经存在的应用程序没有问题。只有我使用蓝绿部署部署的应用无法连接:
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,所以我假设它只是主要的(“w: 1”)
最佳答案
对于每个cf bind-service
或cf unbind-service
Servicebroker (一个 Cloud Foundry 组件)创建新的随机生成的凭证(用 cf env $APP
查看它)。通过我们的 MongoEnterprise 服务产品,Service Broker 连接到 Ops Manager API 并将新用户部署到 mongod 副本集。
当 Ops Manager 部署用户 (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),所有副本集成员都有一点延迟。
...
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 的错误(Ops Manager 通过 HTTP 与托管 VM 上的 Autoamtion Agent 对话,然后 Automation Agent 使用 native 协议(protocol)与 mongod 对话)
[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($USER@rs_$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($USER@rs_$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($USER@rs_$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($USER@rs_$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($USER@rs_$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($USER@rs_$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
总结:WriteConcern primary 的一切工作正常,但 WriteConcern majority 超时,导致阻塞索引构建。
关于mongodb - 应用程序无法连接到带有 "Authentication failed"的 MongoDB Enterprise,Ops Manager 卡在 "AdjustUsers",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42387318/
我正在KERAS CNN中工作,以检测视网膜图像中的糖尿病性视网膜病变。但是,当我尝试使用此代码预处理图像..: def estimate_radius(img): mx = img[img.
为什么这样实现: T& T::operator+=(const T&) { // ... implementation ... return *this; } T operator+(cons
这是我的图像混合代码,但 cv2.addweighted() 函数有问题: import cv2 import numpy as np img1 = cv2.imread('1.png') img2
我正在设置一个搜索API,就是搜索; id、type、originCity、destinationCity、departmentDate、reason、accommodation、approvalSt
这两个特征(std::ops::Add,core::ops::Add)提供相同的功能,并且它们都使用相同的示例(都使用std::ops::Add)。他们的实现者集有所不同。 应该默认使用std::op
我要提出条件 (A 和 B)和(C 或 D 或 E 或 F) 当我尝试做的时候 where: { [Op.and]: [{ A, B, [Op.or]: [{
我对 Sequelize 有这个问题: 我正在尝试进行 3 参数研究,如果其中一个参数为空,则不应考虑该参数。 const users = await User.findAll({ where:
Herb Sutter 的 Guru of the Week #4, "Class Mechanics" ,教导重载运算符的“a op b”形式应该根据“a op= b”形式实现(参见解决方案中的第
基准代码: func BenchmarkSth(b *testing.B) { var x []int b.ResetTimer() for i := 0; i < b.N;
我在使用 sequelize 获取正确的查询时遇到问题。 我有一个表示条目 id 的数组,可以这样说 - userVacationsIds = [1,2,3] 我做了这样的第一个查询
这两个特征(std::ops::Add,core::ops::Add)提供相同的功能,并且它们都使用相同的示例(都利用 std::ops::Add)。他们的一组实现者有些不同。 是否应该默认使用 st
为什么 std::numeric 算法似乎更喜欢 op 而不是 op=?例如,这里是 std::accumulate 在 LLVM 中的实现: template inline _LIBCPP_INL
这是基准测试的代码片段: // bench_test.go package main import ( "testing" ) func BenchmarkHello(b *testing.B
我使用 Sequelize 来查询我的数据库。 我在查询中使用 Op.and 和 Op.ne: const Op = require('sequelize'); let subLevels = awa
我有一个关于链表和模板的作业,其中有带有奇怪参数的函数,这些参数是强制性的。我找不到关于它的在线文档,感谢任何提供的 Material 。 我曾尝试为 op 分配另一个地址,然后它编译得很好,但我无法
cppreference说: the behavior of every builtin compound-assignment expression E1 op= E2 (where E1 is a
当我使用 go test -v -bench=. -benchmem 运行基准测试时,我看到以下结果。 f1 10000 120860 ns/op 2433 B/o
假设我有一个sympy 表达式 e1 op e2 哪里op是任何算术比较运算符,例如 , >> from sympy import symbols, Piecewise, ccode >>> x, y
在我的玩具包中,我定义了 %+%运算符作为 paste0() 的别名.试图减少与其他包的干扰,我通过以下方式实现: `%+%` <- function(...) UseMethod("%+%") `%
我正在尝试遵循 Scott Meyers 在 More Effective C++ 的第 22 项中的建议:“考虑使用 op= 而不是独立的 op”。他建议我们可以为 operator+ 创建一个模板
我是一名优秀的程序员,十分优秀!