【问题标题】:MongoDB Initial Sync failing repeatedly (Mongodb 3.2 on Ubuntu 16.04 on Azure VM)MongoDB Initial Sync 反复失败(Azure VM 上 Ubuntu 16.04 上的 Mongodb 3.2)
【发布时间】:2016-09-23 01:17:14
【问题描述】:
  • 我有一个成员 mongod 实例 (Server1),其中包含一个非常大的数据库,其中包含 250 万个文档(每个文档都非常大)和 4 个索引。
  • 然后我向这个副本集添加了另一台机器 (Server2)。 Server2 上的 Mongod 大约需要 5 个小时才能获取这个大数据库中的所有文档。
  • Server2 获取所有文档后,开始制作二级索引。索引完成大约需要 3 个小时。

    • 在完成构建二级索引后,它立即尝试连接到主索引并发现套接字已过期并超时。
    • 在收到超时错误后,它 (Server2) 会简单地删除所有数据库并再次开始初始同步。

    • 来自日志的 sn-p 如下:

2016-05-25T11:50:36.053+0000 I -        [rsSync]   Index Build: 2211700/2215091 99%
2016-05-25T11:50:39.221+0000 I -        [rsSync]   Index Build: 2212000/2215091 99%
2016-05-25T11:50:43.300+0000 I -        [rsSync]   Index Build: 2212300/2215091 99%
2016-05-25T11:50:46.103+0000 I -        [rsSync]   Index Build: 2212500/2215091 99%
2016-05-25T11:50:49.068+0000 I -        [rsSync]   Index Build: 2212800/2215091 99%
2016-05-25T11:50:52.218+0000 I -        [rsSync]   Index Build: 2213600/2215091 99%
2016-05-25T11:50:55.439+0000 I -        [rsSync]   Index Build: 2214500/2215091 99%
2016-05-25T11:50:58.738+0000 I -        [rsSync]   Index Build: 2214700/2215091 99%
2016-05-25T11:51:13.223+0000 I -        [rsSync]   Index: (2/3) BTree Bottom Up Progress: 536600/2215091 24%
2016-05-25T11:51:23.285+0000 I -        [rsSync]   Index: (2/3) BTree Bottom Up Progress: 1984500/2215091 89%
2016-05-25T11:51:24.317+0000 I INDEX    [rsSync]   done building bottom layer, going to commit
2016-05-25T11:51:24.508+0000 I INDEX    [rsSync] build index done.  scanned 2215091 total records. 10491 secs
2016-05-25T11:51:25.082+0000 I NETWORK  [rsSync] Socket say send() errno:110 Connection timed out xx.xx.xx.xx:27017
2016-05-25T11:51:25.106+0000 E REPL     [rsSync] 9001 socket exception [SEND_ERROR] server [xx.xx.xx.xx:27017] 
2016-05-25T11:51:25.106+0000 E REPL     [rsSync] initial sync attempt failed, 9 attempts remaining
2016-05-25T11:51:30.106+0000 I REPL     [rsSync] initial sync pending
2016-05-25T11:51:30.433+0000 I REPL     [ReplicationExecutor] syncing from: xx.xx.xx.xx:27017
2016-05-25T11:51:30.563+0000 I REPL     [rsSync] initial sync drop all databases
2016-05-25T11:51:30.564+0000 I STORAGE  [rsSync] dropAllDatabasesExceptLocal 42
2016-05-25T11:51:31.925+0000 I JOURNAL  [rsSync] journalCleanup...
2016-05-25T11:51:31.925+0000 I JOURNAL  [rsSync] removeJournalFiles
2016-05-25T11:51:32.331+0000 I JOURNAL  [rsSync] journalCleanup...
2016-05-25T11:51:32.332+0000 I JOURNAL  [rsSync] removeJournalFiles
2016-05-25T11:51:32.489+0000 I JOURNAL  [rsSync] journalCleanup...
2016-05-25T11:51:32.489+0000 I JOURNAL  [rsSync] removeJournalFiles
  • 尝试同步此副本集非常令人沮丧。它一遍又一遍地进行初始同步。非常感谢任何帮助。

【问题讨论】:

  • 服务器配置是什么?数据的大小是多少?副本集中有多少成员?
  • 服务器配置?这是非常标准的默认值。仅导致问题的数据库大小约为 200GB。副本集中有 3 个成员。一个小学和剩下的两个未能从 STARTUP2 毕业到中学。
  • 在同一时间段内从服务器中查看日志会很有帮助。

标签: mongodb azure ubuntu-server mongodb-replica-set


【解决方案1】:

也许您可以将此作为一种解决方法,直到诊断出问题:

https://docs.mongodb.com/manual/tutorial/resync-replica-set-member/#replica-set-resync-by-copying

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-08-29
    • 1970-01-01
    • 2016-04-16
    • 1970-01-01
    • 1970-01-01
    • 2022-12-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多