AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-203342

Areeb's questions

Martin Hope
Areeb
Asked: 2024-11-14 19:37:55 +0800 CST

副本未启动

  • 4

我正在尝试设置主从副本。这是为了在接下来的几天内从第一个节点到第二个节点进行无停机迁移。

主节点已设置完毕,配置已更新,我添加了密钥文件。对辅助节点执行了相同操作。

我还初始化了复制,并将辅助节点添加到复制中。我可以看到 ping 和正常运行时间,但辅助节点卡在“启动”状态。

但是,辅助节点上没有副本配置。此外,它一遍又一遍地在错误日志中重复此操作。

辅助节点(日志):

{"t":{"$date":"2024-11-14T11:35:14.018+00:00"},"s":"I",  "c":"CONNPOOL", "id":22576,   "ctx":"ReplNetwork","msg":"Connecting","attr":{"hostAndPort":"Ubuntu-2204-jammy-amd64-base:27017"}}
{"t":{"$date":"2024-11-14T11:35:14.818+00:00"},"s":"W",  "c":"SHARDING", "id":7012500, "ctx":"QueryAnalysisConfigurationsRefresher","msg":"Failed to refresh query analysis configurations, will try again at the next interval","attr":{"error":"PrimarySteppedDown: No primary exists currently"}}
{"t":{"$date":"2024-11-14T11:35:15.000+00:00"},"s":"W",  "c":"QUERY",    "id":23799,   "ctx":"ftdc","msg":"Aggregate command executor error","attr":{"error":{"code":26,"codeName":"NamespaceNotFound","errmsg":"Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [local.oplog.rs] not found."},"stats":{},"cmd":{"aggregate":"oplog.rs","cursor":{},"pipeline":[{"$collStats":{"storageStats":{"waitForLock":false,"numericOnly":true}}}],"$db":"local"}}}
{"t":{"$date":"2024-11-14T11:35:15.000+00:00"},"s":"W",  "c":"QUERY",    "id":23799,   "ctx":"ftdc","msg":"Aggregate command executor error","attr":{"error":{"code":26,"codeName":"NamespaceNotFound","errmsg":"Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [config.transactions] not found."},"stats":{},"cmd":{"aggregate":"transactions","cursor":{},"pipeline":[{"$collStats":{"storageStats":{"waitForLock":false,"numericOnly":true}}}],"$db":"config"}}}
{"t":{"$date":"2024-11-14T11:35:15.001+00:00"},"s":"W",  "c":"QUERY",    "id":23799,   "ctx":"ftdc","msg":"Aggregate command executor error","attr":{"error":{"code":26,"codeName":"NamespaceNotFound","errmsg":"Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [config.image_collection] not found."},"stats":{},"cmd":{"aggregate":"image_collection","cursor":{},"pipeline":[{"$collStats":{"storageStats":{"waitForLock":false,"numericOnly":true}}}],"$db":"config"}}}
{"t":{"$date":"2024-11-14T11:35:15.018+00:00"},"s":"I",  "c":"CONNPOOL", "id":22576,   "ctx":"ReplNetwork","msg":"Connecting","attr":{"hostAndPort":"Ubuntu-2204-jammy-amd64-base:27017"}}
{"t":{"$date":"2024-11-14T11:35:16.000+00:00"},"s":"W",  "c":"QUERY",    "id":23799,   "ctx":"ftdc","msg":"Aggregate command executor error","attr":{"error":{"code":26,"codeName":"NamespaceNotFound","errmsg":"Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [local.oplog.rs] not found."},"stats":{},"cmd":{"aggregate":"oplog.rs","cursor":{},"pipeline":[{"$collStats":{"storageStats":{"waitForLock":false,"numericOnly":true}}}],"$db":"local"}}}
{"t":{"$date":"2024-11-14T11:35:16.000+00:00"},"s":"W",  "c":"QUERY",    "id":23799,   "ctx":"ftdc","msg":"Aggregate command executor error","attr":{"error":{"code":26,"codeName":"NamespaceNotFound","errmsg":"Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [config.transactions] not found."},"stats":{},"cmd":{"aggregate":"transactions","cursor":{},"pipeline":[{"$collStats":{"storageStats":{"waitForLock":false,"numericOnly":true}}}],"$db":"config"}}}
{"t":{"$date":"2024-11-14T11:35:16.001+00:00"},"s":"W",  "c":"QUERY",    "id":23799,   "ctx":"ftdc","msg":"Aggregate command executor error","attr":{"error":{"code":26,"codeName":"NamespaceNotFound","errmsg":"Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [config.image_collection] not found."},"stats":{},"cmd":{"aggregate":"image_collection","cursor":{},"pipeline":[{"$collStats":{"storageStats":{"waitForLock":false,"numericOnly":true}}}],"$db":"config"}}}
{"t":{"$date":"2024-11-14T11:35:16.018+00:00"},"s":"I",  "c":"CONNPOOL", "id":22576,   "ctx":"ReplNetwork","msg":"Connecting","attr":{"hostAndPort":"Ubuntu-2204-jammy-amd64-base:27017"}}

主服务器上的 rs.config()

{
  set: 'rs0',
  date: ISODate('2024-11-14T11:36:01.498Z'),
  myState: 1,
  term: Long('3'),
  syncSourceHost: '',
  syncSourceId: -1,
  heartbeatIntervalMillis: Long('2000'),
  majorityVoteCount: 1,
  writeMajorityCount: 1,
  votingMembersCount: 1,
  writableVotingMembersCount: 1,
  optimes: {
    lastCommittedOpTime: { ts: Timestamp({ t: 1731584161, i: 5 }), t: Long('3') },
    lastCommittedWallTime: ISODate('2024-11-14T11:36:01.474Z'),
    readConcernMajorityOpTime: { ts: Timestamp({ t: 1731584161, i: 5 }), t: Long('3') },
    appliedOpTime: { ts: Timestamp({ t: 1731584161, i: 5 }), t: Long('3') },
    durableOpTime: { ts: Timestamp({ t: 1731584161, i: 5 }), t: Long('3') },
    writtenOpTime: { ts: Timestamp({ t: 1731584161, i: 5 }), t: Long('3') },
    lastAppliedWallTime: ISODate('2024-11-14T11:36:01.474Z'),
    lastDurableWallTime: ISODate('2024-11-14T11:36:01.474Z'),
    lastWrittenWallTime: ISODate('2024-11-14T11:36:01.474Z')
  },
  lastStableRecoveryTimestamp: Timestamp({ t: 1731584157, i: 2 }),
  electionCandidateMetrics: {
    lastElectionReason: 'electionTimeout',
    lastElectionDate: ISODate('2024-11-14T09:11:55.719Z'),
    electionTerm: Long('3'),
    lastCommittedOpTimeAtElection: { ts: Timestamp({ t: 0, i: 0 }), t: Long('-1') },
    lastSeenWrittenOpTimeAtElection: { ts: Timestamp({ t: 1731575489, i: 10 }), t: Long('2') },
    lastSeenOpTimeAtElection: { ts: Timestamp({ t: 1731575489, i: 10 }), t: Long('2') },
    numVotesNeeded: 1,
    priorityAtElection: 1,
    electionTimeoutMillis: Long('10000'),
    numCatchUpOps: Long('0'),
    newTermStartDate: ISODate('2024-11-14T09:11:55.790Z'),
    wMajorityWriteAvailabilityDate: ISODate('2024-11-14T09:11:55.803Z')
  },
  members: [
    {
      _id: 0,
      name: 'Ubuntu-2204-jammy-amd64-base:27017',
      health: 1,
      state: 1,
      stateStr: 'PRIMARY',
      uptime: 8656,
      optime: { ts: Timestamp({ t: 1731584161, i: 5 }), t: Long('3') },
      optimeDate: ISODate('2024-11-14T11:36:01.000Z'),
      optimeWritten: { ts: Timestamp({ t: 1731584161, i: 5 }), t: Long('3') },
      optimeWrittenDate: ISODate('2024-11-14T11:36:01.000Z'),
      lastAppliedWallTime: ISODate('2024-11-14T11:36:01.474Z'),
      lastDurableWallTime: ISODate('2024-11-14T11:36:01.474Z'),
      lastWrittenWallTime: ISODate('2024-11-14T11:36:01.474Z'),
      syncSourceHost: '',
      syncSourceId: -1,
      infoMessage: '',
      electionTime: Timestamp({ t: 1731575515, i: 1 }),
      electionDate: ISODate('2024-11-14T09:11:55.000Z'),
      configVersion: 10,
      configTerm: 3,
      self: true,
      lastHeartbeatMessage: ''
    },
    {
      _id: 1,
      name: 'XXXXXXXXXXXXXXX:27017',
      health: 1,
      state: 0,
      stateStr: 'STARTUP',
      uptime: 1925,
      optime: { ts: Timestamp({ t: 0, i: 0 }), t: Long('-1') },
      optimeDurable: { ts: Timestamp({ t: 0, i: 0 }), t: Long('-1') },
      optimeWritten: { ts: Timestamp({ t: 0, i: 0 }), t: Long('-1') },
      optimeDate: ISODate('1970-01-01T00:00:00.000Z'),
      optimeDurableDate: ISODate('1970-01-01T00:00:00.000Z'),
      optimeWrittenDate: ISODate('1970-01-01T00:00:00.000Z'),
      lastAppliedWallTime: ISODate('1970-01-01T00:00:00.000Z'),
      lastDurableWallTime: ISODate('1970-01-01T00:00:00.000Z'),
      lastWrittenWallTime: ISODate('1970-01-01T00:00:00.000Z'),
      lastHeartbeat: ISODate('2024-11-14T11:36:00.038Z'),
      lastHeartbeatRecv: ISODate('1970-01-01T00:00:00.000Z'),
      pingMs: Long('9'),
      lastHeartbeatMessage: '',
      syncSourceHost: '',
      syncSourceId: -1,
      infoMessage: '',
      configVersion: -2,
      configTerm: -1
    }
  ],
  ok: 1,
  '$clusterTime': {
    clusterTime: Timestamp({ t: 1731584161, i: 5 }),
    signature: {
      hash: Binary.createFromBase64('XXXXXXXXXX', 0),
      keyId: Long('XXXXXXXXXXXX')
    }
  },
  operationTime: Timestamp({ t: 1731584161, i: 5 })
}

辅助服务器上的 rs.config()

MongoServerError[NotYetInitialized]: no replset config has been received  
replication
  • 1 个回答
  • 15 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目

    • 12 个回答
  • Marko Smith

    如何让sqlplus的输出出现在一行中?

    • 3 个回答
  • Marko Smith

    选择具有最大日期或最晚日期的日期

    • 3 个回答
  • Marko Smith

    如何列出 PostgreSQL 中的所有模式?

    • 4 个回答
  • Marko Smith

    列出指定表的所有列

    • 5 个回答
  • Marko Smith

    如何在不修改我自己的 tnsnames.ora 的情况下使用 sqlplus 连接到位于另一台主机上的 Oracle 数据库

    • 4 个回答
  • Marko Smith

    你如何mysqldump特定的表?

    • 4 个回答
  • Marko Smith

    使用 psql 列出数据库权限

    • 10 个回答
  • Marko Smith

    如何从 PostgreSQL 中的选择查询中将值插入表中?

    • 4 个回答
  • Marko Smith

    如何使用 psql 列出所有数据库和表?

    • 7 个回答
  • Martin Hope
    Jin 连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目 2014-12-02 02:54:58 +0800 CST
  • Martin Hope
    Stéphane 如何列出 PostgreSQL 中的所有模式? 2013-04-16 11:19:16 +0800 CST
  • Martin Hope
    Mike Walsh 为什么事务日志不断增长或空间不足? 2012-12-05 18:11:22 +0800 CST
  • Martin Hope
    Stephane Rolland 列出指定表的所有列 2012-08-14 04:44:44 +0800 CST
  • Martin Hope
    haxney MySQL 能否合理地对数十亿行执行查询? 2012-07-03 11:36:13 +0800 CST
  • Martin Hope
    qazwsx 如何监控大型 .sql 文件的导入进度? 2012-05-03 08:54:41 +0800 CST
  • Martin Hope
    markdorison 你如何mysqldump特定的表? 2011-12-17 12:39:37 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 对 SQL 查询进行计时? 2011-06-04 02:22:54 +0800 CST
  • Martin Hope
    Jonas 如何从 PostgreSQL 中的选择查询中将值插入表中? 2011-05-28 00:33:05 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 列出所有数据库和表? 2011-02-18 00:45:49 +0800 CST

热门标签

sql-server mysql postgresql sql-server-2014 sql-server-2016 oracle sql-server-2008 database-design query-performance sql-server-2017

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve