简体   繁体   English

MongoDB初始同步重复失败(Azure VM上的Ubuntu 16.04上的Mongodb 3.2)

[英]MongoDB Initial Sync failing repeatedly (Mongodb 3.2 on Ubuntu 16.04 on Azure VM)

  • I have a one member mongod instance (Server1) with a very large DB with 2.5 million documents (Each document is very big) and 4 indices. 我有一个成员mongod实例(Server1),一个非常大的数据库,250万个文档(每个文档非常大)和4个索引。
  • Then I added another machine (Server2)to this replica set. 然后我将另一台机器(Server2)添加到此副本集。 Mongod on Server2 takes about 5 hours to fetch all the documents in this big database. Server2上的Mongod大约需要5个小时来获取这个大数据库中的所有文档。
  • After all the documents are fetched by Server2, It starts making secondary indices. 在Server2获取所有文档之后,它开始创建二级索引。 It takes around 3 hours for indices to get finished. 索引完成大约需要3个小时。

    • Immediately after completing building the secondary indices, It tries to connect to primary and finds that socket is expired and timed out. 在完成构建辅助索引之后,它立即尝试连接到primary并发现套接字已过期并超时。
    • At having received a timeout error it (Server2) simply drops all databases and starts the initial sync again. 收到超时错误后,它(Server2)只丢弃所有数据库并再次启动初始同步。

    • The snippet from logs is below: 日志的片段如下:

 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 
  • It has been very very frustrating trying to sync this replica set. 尝试同步此副本集非常令人沮丧。 It keeps doing initial sync over and over again. 它一遍又一遍地进行初始同步。 Any help is highly appreciated. 任何帮助都非常感谢。

Perhaps you can use this as a workaround until the problem is diagnosed: 在诊断出问题之前,您可以使用此方法作为解决方法:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM