- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我这周花了一个自由职业者创建的 Mongo 4.4 PSA 副本来工作。我放弃了,从所有三台服务器上删除了完整的 mongod,然后按照 Mongo doc 从头开始安装。 .唯一的变化是在副本初始化之前创建新数据库并导入数据。
第一次失败(连接超时),我重新审视了我的防火墙规则。然后它立即连接并在所有节点上刷新 mongo shell:
rs_bud:SECONDARY> show collections
rs_bud:PRIMARY> use bud
但是当我对辅助节点执行任何操作时,它们会因 NotPrimaryNoSecondaryOk
错误而失败。
rs_bud:SECONDARY> use bud
rs_bud:SECONDARY> show collections
uncaught exception: Error: listCollections failed: {
"topologyVersion" : {
"processId" : ObjectId("612bbc4940995c508859973a"),
"counter" : NumberLong(4)
},
"operationTime" : Timestamp(1630258863, 1),
"ok" : 0,
"errmsg" : "not master and slaveOk=false",
"code" : 13435,
"codeName" : "NotPrimaryNoSecondaryOk",
"$clusterTime" : {
"clusterTime" : Timestamp(1630258863, 1),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
} :
我找不到任何对我有用的日志:
{"t":{"$date":"2021-08-29T19:41:41.550+02:00"},"s":"I", "c":"NETWORK", "id":23729, "ctx":"ReplicaSetMonitor-TaskExecutor","msg":"ServerPingMonitor is now monitoring host","attr":{"host":"10.0.0.4:27017","replicaSet":"rs_bud"}}
{"t":{"$date":"2021-08-29T19:41:41.550+02:00"},"s":"I", "c":"NETWORK", "id":4333213, "ctx":"ReplicaSetMonitor-TaskExecutor","msg":"RSM Topology Change","attr":{"replicaSet":"rs_bud","newTopologyDescription":"{ id: \"ad6bc985-50f4-4b01-9310-1457f8861f1f\", topologyType: \"ReplicaSetWithPrimary\", servers: { 10.0.0.2:27017: { address: \"10.0.0.2:27017\", topologyVersion: { processId: ObjectId('612bbc4940995c508859973a'), counter: 4 }, roundTripTime: 504, lastWriteDate: new Date(1630258890000), opTime: { ts: Timestamp(1630258890, 1), t: 1 }, type: \"RSSecondary\", minWireVersion: 9, maxWireVersion: 9, me: \"10.0.0.2:27017\", setName: \"rs_bud\", setVersion: 1, primary: \"10.0.0.4:27017\", lastUpdateTime: new Date(1630258901549), logicalSessionTimeoutMinutes: 30, hosts: { 0: \"10.0.0.2:27017\", 1: \"10.0.0.4:27017\", 2: \"10.0.0.5:27017\" }, arbiters: {}, passives: {} }, 10.0.0.4:27017: { address: \"10.0.0.4:27017\", topologyVersion: { processId: ObjectId('612bba160d5e82841e5c8fc2'), counter: 6 }, roundTripTime: 1153, lastWriteDate: new Date(1630258890000), opTime: { ts: Timestamp(1630258890, 1), t: 1 }, type: \"RSPrimary\", minWireVersion: 9, maxWireVersion: 9, me: \"10.0.0.4:27017\", setName: \"rs_bud\", setVersion: 1, electionId: ObjectId('7fffffff0000000000000001'), primary: \"10.0.0.4:27017\", lastUpdateTime: new Date(1630258901550), logicalSessionTimeoutMinutes: 30, hosts: { 0: \"10.0.0.2:27017\", 1: \"10.0.0.4:27017\", 2: \"10.0.0.5:27017\" }, arbiters: {}, passives: {} }, 10.0.0.5:27017: { address: \"10.0.0.5:27017\", type: \"Unknown\", minWireVersion: 0, maxWireVersion: 0, lastUpdateTime: new Date(-9223372036854775808), hosts: {}, arbiters: {}, passives: {} } }, logicalSessionTimeoutMinutes: 30, setName: \"rs_bud\", compatible: true, maxSetVersion: 1, maxElectionId: ObjectId('7fffffff0000000000000001') }","previousTopologyDescription":"{ id: \"ad6bc985-50f4-4b01-9310-1457f8861f1f\", topologyType: \"ReplicaSetNoPrimary\", servers: { 10.0.0.2:27017: { address: \"10.0.0.2:27017\", topologyVersion: { processId: ObjectId('612bbc4940995c508859973a'), counter: 4 }, roundTripTime: 504, lastWriteDate: new Date(1630258890000), opTime: { ts: Timestamp(1630258890, 1), t: 1 }, type: \"RSSecondary\", minWireVersion: 9, maxWireVersion: 9, me: \"10.0.0.2:27017\", setName: \"rs_bud\", setVersion: 1, primary: \"10.0.0.4:27017\", lastUpdateTime: new Date(1630258901549), logicalSessionTimeoutMinutes: 30, hosts: { 0: \"10.0.0.2:27017\", 1: \"10.0.0.4:27017\", 2: \"10.0.0.5:27017\" }, arbiters: {}, passives: {} }, 10.0.0.4:27017: { address: \"10.0.0.4:27017\", type: \"Unknown\", minWireVersion: 0, maxWireVersion: 0, lastUpdateTime: new Date(-9223372036854775808), hosts: {}, arbiters: {}, passives: {} }, 10.0.0.5:27017: { address: \"10.0.0.5:27017\", type: \"Unknown\", minWireVersion: 0, maxWireVersion: 0, lastUpdateTime: new Date(-9223372036854775808), hosts: {}, arbiters: {}, passives: {} } }, logicalSessionTimeoutMinutes: 30, setName: \"rs_bud\", compatible: true }"}}
{"t":{"$date":"2021-08-29T19:41:41.550+02:00"},"s":"I", "c":"NETWORK", "id":23729, "ctx":"ReplicaSetMonitor-TaskExecutor","msg":"ServerPingMonitor is now monitoring host","attr":{"host":"10.0.0.5:27017","replicaSet":"rs_bud"}}
{"t":{"$date":"2021-08-29T19:41:41.551+02:00"},"s":"I", "c":"NETWORK", "id":4333213, "ctx":"ReplicaSetMonitor-TaskExecutor","msg":"RSM Topology Change","attr":{"replicaSet":"rs_bud","newTopologyDescription":"{ id: \"ad6bc985-50f4-4b01-9310-1457f8861f1f\", topologyType: \"ReplicaSetWithPrimary\", servers: { 10.0.0.2:27017: { address: \"10.0.0.2:27017\", topologyVersion: { processId: ObjectId('612bbc4940995c508859973a'), counter: 4 }, roundTripTime: 504, lastWriteDate: new Date(1630258890000), opTime: { ts: Timestamp(1630258890, 1), t: 1 }, type: \"RSSecondary\", minWireVersion: 9, maxWireVersion: 9, me: \"10.0.0.2:27017\", setName: \"rs_bud\", setVersion: 1, primary: \"10.0.0.4:27017\", lastUpdateTime: new Date(1630258901549), logicalSessionTimeoutMinutes: 30, hosts: { 0: \"10.0.0.2:27017\", 1: \"10.0.0.4:27017\", 2: \"10.0.0.5:27017\" }, arbiters: {}, passives: {} }, 10.0.0.4:27017: { address: \"10.0.0.4:27017\", topologyVersion: { processId: ObjectId('612bba160d5e82841e5c8fc2'), counter: 6 }, roundTripTime: 1153, lastWriteDate: new Date(1630258890000), opTime: { ts: Timestamp(1630258890, 1), t: 1 }, type: \"RSPrimary\", minWireVersion: 9, maxWireVersion: 9, me: \"10.0.0.4:27017\", setName: \"rs_bud\", setVersion: 1, electionId: ObjectId('7fffffff0000000000000001'), primary: \"10.0.0.4:27017\", lastUpdateTime: new Date(1630258901550), logicalSessionTimeoutMinutes: 30, hosts: { 0: \"10.0.0.2:27017\", 1: \"10.0.0.4:27017\", 2: \"10.0.0.5:27017\" }, arbiters: {}, passives: {} }, 10.0.0.5:27017: { address: \"10.0.0.5:27017\", topologyVersion: { processId: ObjectId('612bbc3d5c7d3123b83eedf8'), counter: 4 }, roundTripTime: 1468, lastWriteDate: new Date(1630258890000), opTime: { ts: Timestamp(1630258890, 1), t: 1 }, type: \"RSSecondary\", minWireVersion: 9, maxWireVersion: 9, me: \"10.0.0.5:27017\", setName: \"rs_bud\", setVersion: 1, primary: \"10.0.0.4:27017\", lastUpdateTime: new Date(1630258901550), logicalSessionTimeoutMinutes: 30, hosts: { 0: \"10.0.0.2:27017\", 1: \"10.0.0.4:27017\", 2: \"10.0.0.5:27017\" }, arbiters: {}, passives: {} } }, logicalSessionTimeoutMinutes: 30, setName: \"rs_bud\", compatible: true, maxSetVersion: 1, maxElectionId: ObjectId('7fffffff0000000000000001') }","previousTopologyDescription":"{ id: \"ad6bc985-50f4-4b01-9310-1457f8861f1f\", topologyType: \"ReplicaSetWithPrimary\", servers: { 10.0.0.2:27017: { address: \"10.0.0.2:27017\", topologyVersion: { processId: ObjectId('612bbc4940995c508859973a'), counter: 4 }, roundTripTime: 504, lastWriteDate: new Date(1630258890000), opTime: { ts: Timestamp(1630258890, 1), t: 1 }, type: \"RSSecondary\", minWireVersion: 9, maxWireVersion: 9, me: \"10.0.0.2:27017\", setName: \"rs_bud\", setVersion: 1, primary: \"10.0.0.4:27017\", lastUpdateTime: new Date(1630258901549), logicalSessionTimeoutMinutes: 30, hosts: { 0: \"10.0.0.2:27017\", 1: \"10.0.0.4:27017\", 2: \"10.0.0.5:27017\" }, arbiters: {}, passives: {} }, 10.0.0.4:27017: { address: \"10.0.0.4:27017\", topologyVersion: { processId: ObjectId('612bba160d5e82841e5c8fc2'), counter: 6 }, roundTripTime: 1153, lastWriteDate: new Date(1630258890000), opTime: { ts: Timestamp(1630258890, 1), t: 1 }, type: \"RSPrimary\", minWireVersion: 9, maxWireVersion: 9, me: \"10.0.0.4:27017\", setName: \"rs_bud\", setVersion: 1, electionId: ObjectId('7fffffff0000000000000001'), primary: \"10.0.0.4:27017\", lastUpdateTime: new Date(1630258901550), logicalSessionTimeoutMinutes: 30, hosts: { 0: \"10.0.0.2:27017\", 1: \"10.0.0.4:27017\", 2: \"10.0.0.5:27017\" }, arbiters: {}, passives: {} }, 10.0.0.5:27017: { address: \"10.0.0.5:27017\", type: \"Unknown\", minWireVersion: 0, maxWireVersion: 0, lastUpdateTime: new Date(-9223372036854775808), hosts: {}, arbiters: {}, passives: {} } }, logicalSessionTimeoutMinutes: 30, setName: \"rs_bud\", compatible: true, maxSetVersion: 1, maxElectionId: ObjectId('7fffffff0000000000000001') }"}}
{"t":{"$date":"2021-08-29T19:41:41.552+02:00"},"s":"I", "c":"NETWORK", "id":20113, "ctx":"LogicalSessionCacheReap","msg":"Successfully connected to host","attr":{"connString":"10.0.0.4:27017","numOpenConns":1,"socketTimeoutSecs":0.0}}
{"t":{"$date":"2021-08-29T19:41:41.552+02:00"},"s":"I", "c":"NETWORK", "id":20113, "ctx":"LogicalSessionCacheRefresh","msg":"Successfully connected to host","attr":{"connString":"10.0.0.4:27017","numOpenConns":2,"socketTimeoutSecs":0.0}}
{"t":{"$date":"2021-08-29T19:41:54.623+02:00"},"s":"I", "c":"STORAGE", "id":22430, "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1630258914:623411][1811:0x7f64db1aa700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 1607, snapshot max: 1607 snapshot count: 0, oldest timestamp: (1630258896, 1) , meta checkpoint timestamp: (1630258901, 1) base write gen: 325"}}
这看起来也不错:
rs_bud:SECONDARY> rs.printReplicationInfo()
configured oplog size: 1483.0916013717651MB
log length start to end: 981secs (0.27hrs)
oplog first event time: Sun Aug 29 2021 19:39:42 GMT+0200 (CEST)
oplog last event time: Sun Aug 29 2021 19:56:03 GMT+0200 (CEST)
now: Sun Aug 29 2021 19:56:04 GMT+0200 (CEST)
和
rs_bud:SECONDARY> rs.status()
{
"set" : "rs_bud",
"date" : ISODate("2021-08-29T17:56:58.119Z"),
"myState" : 2,
"term" : NumberLong(1),
"syncSourceHost" : "10.0.0.4:27017",
"syncSourceId" : 0,
"heartbeatIntervalMillis" : NumberLong(2000),
"majorityVoteCount" : 2,
"writeMajorityCount" : 2,
"votingMembersCount" : 3,
"writableVotingMembersCount" : 3,
"optimes" : {
"lastCommittedOpTime" : {
"ts" : Timestamp(1630259813, 1),
"t" : NumberLong(1)
},
"lastCommittedWallTime" : ISODate("2021-08-29T17:56:53.431Z"),
"readConcernMajorityOpTime" : {
"ts" : Timestamp(1630259813, 1),
"t" : NumberLong(1)
},
"readConcernMajorityWallTime" : ISODate("2021-08-29T17:56:53.431Z"),
"appliedOpTime" : {
"ts" : Timestamp(1630259813, 1),
"t" : NumberLong(1)
},
"durableOpTime" : {
"ts" : Timestamp(1630259813, 1),
"t" : NumberLong(1)
},
"lastAppliedWallTime" : ISODate("2021-08-29T17:56:53.431Z"),
"lastDurableWallTime" : ISODate("2021-08-29T17:56:53.431Z")
},
"lastStableRecoveryTimestamp" : Timestamp(1630259801, 2),
"electionParticipantMetrics" : {
"votedForCandidate" : true,
"electionTerm" : NumberLong(1),
"lastVoteDate" : ISODate("2021-08-29T17:39:53.358Z"),
"electionCandidateMemberId" : 0,
"voteReason" : "",
"lastAppliedOpTimeAtElection" : {
"ts" : Timestamp(1630258782, 1),
"t" : NumberLong(-1)
},
"maxAppliedOpTimeInSet" : {
"ts" : Timestamp(1630258782, 1),
"t" : NumberLong(-1)
},
"priorityAtElection" : 1,
"newTermStartDate" : ISODate("2021-08-29T17:39:53.386Z"),
"newTermAppliedDate" : ISODate("2021-08-29T17:39:54.485Z")
},
"members" : [
{
"_id" : 0,
"name" : "10.0.0.4:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 1035,
"optime" : {
"ts" : Timestamp(1630259813, 1),
"t" : NumberLong(1)
},
"optimeDurable" : {
"ts" : Timestamp(1630259813, 1),
"t" : NumberLong(1)
},
"optimeDate" : ISODate("2021-08-29T17:56:53Z"),
"optimeDurableDate" : ISODate("2021-08-29T17:56:53Z"),
"lastHeartbeat" : ISODate("2021-08-29T17:56:57.415Z"),
"lastHeartbeatRecv" : ISODate("2021-08-29T17:56:57.901Z"),
"pingMs" : NumberLong(0),
"lastHeartbeatMessage" : "",
"syncSourceHost" : "",
"syncSourceId" : -1,
"infoMessage" : "",
"electionTime" : Timestamp(1630258793, 1),
"electionDate" : ISODate("2021-08-29T17:39:53Z"),
"configVersion" : 1,
"configTerm" : 1
},
{
"_id" : 1,
"name" : "10.0.0.5:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 1035,
"optime" : {
"ts" : Timestamp(1630259813, 1),
"t" : NumberLong(1)
},
"optimeDurable" : {
"ts" : Timestamp(1630259813, 1),
"t" : NumberLong(1)
},
"optimeDate" : ISODate("2021-08-29T17:56:53Z"),
"optimeDurableDate" : ISODate("2021-08-29T17:56:53Z"),
"lastHeartbeat" : ISODate("2021-08-29T17:56:57.417Z"),
"lastHeartbeatRecv" : ISODate("2021-08-29T17:56:57.431Z"),
"pingMs" : NumberLong(0),
"lastHeartbeatMessage" : "",
"syncSourceHost" : "10.0.0.4:27017",
"syncSourceId" : 0,
"infoMessage" : "",
"configVersion" : 1,
"configTerm" : 1
},
{
"_id" : 2,
"name" : "10.0.0.2:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 3617,
"optime" : {
"ts" : Timestamp(1630259813, 1),
"t" : NumberLong(1)
},
"optimeDate" : ISODate("2021-08-29T17:56:53Z"),
"syncSourceHost" : "10.0.0.4:27017",
"syncSourceId" : 0,
"infoMessage" : "",
"configVersion" : 1,
"configTerm" : 1,
"self" : true,
"lastHeartbeatMessage" : ""
}
],
"ok" : 1,
"$clusterTime" : {
"clusterTime" : Timestamp(1630259813, 1),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
},
"operationTime" : Timestamp(1630259813, 1)
}
出了什么问题以及如何解决?
最佳答案
rs.secondaryOk()
此命令在集群节点中启动辅助节点并能够在 mongo 上运行查询
关于mongodb - Mongo 副本 "NotPrimaryNoSecondaryOk",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68975625/
我在 mongo 中有一个查询,看起来像 db.Table_Name.group({ "key": { "Camp": true }, "initial": { "Clicks": 0 }
这是一个示例查询: db.readings.find( {"_id.s": ISODate("2012-11-01T00:05:00Z") }).count() 查询在 mongo shell 中工作
我正在使用 mongo 模板查询基于状态和邮政编码的文档,这是使用以下标准和查询方法实现的: List modelClass = null; Criteria criteria = new Crite
目前,我有一个旧版本的 mongo,即 2.6 在我的系统上运行。我的网站已经投入生产,并且拥有大量客户数据。我正在计划升级到 mongo 3.2。 所以,我的问题是 mongo v3.2 的 mon
我构建了一个 MongoDB。我想通过某些分组进行聚合。我找到了 document ,这将为我做到这一点。一切正常,但确定limitations指出: 管道的输出只能包含 16 兆字节。如果你的结果s
我无法连接到 MongoDB .在 Ubuntu 中它可以工作,但我在 CentOS 工作现在。这是错误信息: MongoDB shell version: 2.4.2 connecting to:
我试图使用mongo运行最简单的mongo-express和docker-compose容器。我遇到了许多错误,这些错误将在以后解释。 我尝试了以下docker-compose配置: 1。 versi
我有一个 mongo 查询,如下所示。 db.Course.find( { $and: [{courseCallNo: {$in : [/^ssoapicall1$/i]} }, {clientId
我想知道为什么我会收到以下 php 通知: ( ! ) Notice: Mongo::__construct(): parsing servers in C:\htdocs\multishop\lib
(问题灵感来自this one) 给定一个数据集: db.mycollection.insert([ {a:1, b:2, c:3}, {a:1, b:3, c:4}, {a:0, b:1
如果我已经使用 PECL 成功安装了 mongoDB,还需要获取 debian 软件包“php5-mongo”吗?有什么不同?(这个问题应该迁移吗?) 最佳答案 区别与从 CPAN 或 debian(
Mongo 一天前还运行良好。然后今天早上我起床并尝试打开我得到这个: MongoDB shell version: 2.6.4 2015-01-06T11:10:54.142-0500 SE
我正在尝试使用 C# Mongo 驱动程序将文件上传到 Mongo Atlas。但我不明白如何连接类 MongoServerSettings。我试过这个: private static MongoSe
我有两个版本的 mongodb,2.4.3 和 2.6.0。我可以在不同的端口上启动这两个版本,但是在使用 ./mongos 运行它时出现错误: BadValue error: no args for
我需要在 不 关闭的情况下进行分片,或者在端口 27017 中重启现有的 mongo 实例。 我尝试了以下操作,(当默认端口正在运行和 mongo 实例时) mongod --shardsvr --d
在无意中升级了 mongodb 包(3.4.9 -> 3.6.1)后,有没有办法升级 mongo 数据库? 根据 mongo 文档,作为 prerequisite在升级过程中,featureCompa
我正在使用 Sails 0.12.3 和 mongo 3.2.7 这是我的 config/connections.js。 mongo: { adapter: 'sails-mongo', host
我正在使用 mongodb 构建一个基本的搜索引擎,我已经验证了基本查询在 mongo shell 中的工作。不过,我不太明白如何将其翻译成 PHP。 输入字符串中的空格表示“和”运算符和 |或管道字
我有一个用 @Document 注释的 Mongo 集合,我希望能够从字符串 (JSON) 中获取该 Java 对象,因为我们正在将这些类作为字符串插入队列。 Spring-Data-Mongo 中是
我正在使用 Linux Debian 9。我已经安装了 JDK 1.8。我使用的maven版本是3.6,springboot的版本是2.1。 mongodb版本是3.6。 下面是我试图保存在 mong
我是一名优秀的程序员,十分优秀!