search

Home  >  Q&A  >  body text

node.js - mongodb增加副本节点,startup一段时间后新节点就满内存崩溃了

当前副本集状态:
已经有两个节点,一主一从,storageSize:16G。

遇到的问题:
通过rs.add()增加新副本集节点,rs.status()显示新节点已增加,stateStr为“STARTUP2”。一段时间后,新节点mongo进程崩溃,经查物理内存被耗尽。
除了换更大内存的机器,有什么方式能解决这个问题吗?

PHP中文网PHP中文网2782 days ago613

reply all(3)I'll reply

  • 怪我咯

    怪我咯2017-04-17 15:49:50

    1. Judging from the situation described, initial sync encounters performance problems; STARTUP2 indicates that the node is doing initial sync;

    2. Therefore, you can consider optimizing initial sync; if you have not done so, you can consider backing up/restoring the database to the node to be added, and then adding the node to reduce the sync data;

    3. How many ways are there for backup/recovery? You can choose a familiar method; Ops Manager is actually a good choice.

    For reference.

    Love MongoDB! Have Fun!

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 15:49:50

    I don’t know what the machine configuration is. Are you sure it was killed by the system’s OOM killer? If it is an oom killer, you can add swap to avoid this problem.
    In addition, @bguo has mentioned that you can try to restore a node from backup. Please refer to the documentation for specific methods. But even so, a certain amount of swap is still recommended.

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 15:49:50

    You should first use tools such as devtool to locate it. Profiles->Take Heap SnapshotIf a large number of characters are processed, you should consider whether there are strings that have not been released because they were placed in the upper-level scope

    reply
    0
  • Cancelreply