亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

MongoDB副本集問題
PHPz
PHPz 2017-04-24 09:11:00
0
2
885

假設(shè)有這樣一個(gè)場(chǎng)景,有一個(gè)MongoDB的副本集,由于故障導(dǎo)致只剩下兩個(gè)節(jié)點(diǎn)可用,而這兩個(gè)節(jié)點(diǎn)目前都是slave節(jié)點(diǎn)。其他的故障節(jié)點(diǎn)也無法再重新啟動(dòng),即無法重新加入到副本集中。
Q:這種情況下是否因?yàn)檫@個(gè)副本集就無法使用了?

PHPz
PHPz

學(xué)習(xí)是最好的投資!

reply all(2)
Ty80

When most of the nodes are down and the number of remaining nodes that can be connected to each other does not exceed half, you can refer to the documentation to reconfigure the replica set:
- http://docs.mongodb.org/manual/tutorial/reconfigure-replica-set-with-unavailable-members/

Two methods are mentioned in the document:

  1. One is to forcefully reconfigure this replica set, delete the down nodes from this replica set, and only the remaining running nodes form a new replica set, so that a new primary node (primary node) can be elected. ). If the MongoDB version is 2.0 or above, you can use this method.
  2. Another way is to replace this replica set. If your MongoDB version is below 2.0, you can use this method.
迷茫

This depends on the total number of nodes in your replica set. When the number of nodes that can be contacted with each other in the replica set is greater than half of the total number of nodes, a new primary node can be selected. The replica set can work normally. If it can be contacted with each other If the nodes are less than or equal to half of the summary point, all nodes will become secondary nodes. At this time, the replica set will become read-only and all write operations will fail.

The reason for this phenomenon is that the mongodb replica set does not allow multiple primary nodes. When the number of nodes that can be contacted is less than or equal to half of the total number of nodes, if the primary can still be selected, multiple primary nodes may appear. This causes data chaos in the entire replica set and all nodes become secondary. The replica set can still run normally when the failed node is restored.

If you encounter a normal node that is not enough to select the primary, you can solve it in several ways.

1) 若其他節(jié)點(diǎn)因數(shù)據(jù)損壞不能啟動(dòng),像你說的依然有兩個(gè)節(jié)點(diǎn)存活,可以停止一個(gè)節(jié)點(diǎn),將硬盤數(shù)據(jù)導(dǎo)出至掛掉的節(jié)點(diǎn),啟動(dòng)即可.

2) 若其他節(jié)點(diǎn)因不可恢復(fù)原因?qū)е虏荒軉?dòng),你可以去掉replset選項(xiàng)將此節(jié)點(diǎn)作為單機(jī)服務(wù)啟動(dòng),若要恢復(fù)為副本集模式,可以試一下將一個(gè)正常節(jié)點(diǎn)的local相關(guān)的數(shù)據(jù)文件刪除,重新以replset啟動(dòng),初始化自身之后使用rs.add()添加新節(jié)點(diǎn),線上沒有遇到過這種情況,如果實(shí)在沒辦法,你可以試一下.
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template