Next Blog: http://www.cnblogs.com/xiaoit/p/4522218.html
Primary secondary Arbiter1: Off order PSA: Error 2: Off order pas: 3: Off Order SAP: master node becomes slave node 4: Close Order Spa: Error 5: Off order APS6: Turn off Order asp: master node becomes slave node
1: Off Order PSA
Gechongrepl:primary> Rs.ismaster () {"SetName": "Gechongrepl", "setversion": +, "IsMaster": True, "secondary": false , "Hosts": ["192.168.91.133:27017", "192.168.91.132:27017", "192.168.91.132:27018"], "arbiters": [" 192.168.91.135:27017 "]," PRIMARY ":" 192.168.91.133:27017 "," Me ":" 192.168.91.133:27017 "," Electionid ": ObjectId (" 5568098A6DE3D53A2EA91C64 ")," maxbsonobjectsize ": 16777216," maxmessagesizebytes ": 48000000," maxWriteBatchSize ": "LocalTime": Isodate ("2015-05-29t06:39:36.548z"), "Maxwireversion": 3, "minwireversion": 0, "OK": 1}
P:
Gechongrepl:primary> use adminswitched to DB admingechongrepl:primary> db.shutdownserver ()
S
It's changed from:gechongrepl:primary>.
Gechongrepl:primary> use adminswitched to DB admingechongrepl:primary> Db.shutdownserver () assert failed: Unexpected error:Error:shutdownServer Failed:no electable secondaries caught up as of 2015-05-28t23:48:06.022-0700error : Assert failed:unexpected Error:Error:shutdownServer Failed:no electable secondaries caught up as of 2015-05-28t23:4 8:06.022-0700at Error (<anonymous>) at Doassert (src/mongo/shell/assert.js:11:14) at assert (src/mongo/shell/ Assert.js:20:5) at Db.shutdownserver (src/mongo/shell/db.js:212:9) at (shell): 1:42015-05-28t23:48:06.023-0700 E QUERY Error:assert failed:unexpected error:Error:shutdownServer Failed:no electable secondaries caught up as of 2015-05-28 T23:48:06.022-0700at Error (<anonymous>) at Doassert (src/mongo/shell/assert.js:11:14) at assert (src/mongo/ Shell/assert.js:20:5) at Db.shutdownserver (src/mongo/shell/db.js:212:9) at (Shell): 1:4 at Src/mongo/shell/assert.js : 13
A:
Gechongrepl:arbiter> use adminswitched to DB admingechongrepl:arbiter> db.shutdownserver ()
Turn off S again:
s becomes:ggechongrepl:secondary> gechongrepl:secondary> use adminswitched to DB admingechongrepl:secondary> Db.shutdownserver ()
2: Off order pas: has been verified, do not error.
3: Close Order SAP
S
Gechongrepl:secondary> use adminswitched to DB admingechongrepl:secondary> db.shutdownserver ()
A:
Gechongrepl:arbiter> use adminswitched to DB admingechongrepl:arbiter> db.shutdownserver ()
P:
The master becomes:gechongrepl:secondary>gechongrepl:secondary> use adminswitched to DB admingechongrepl:secondary> Db.shutdownserver ()
4: Close Order Spa
S
Gechongrepl:secondary> use adminswitched to DB admingechongrepl:secondary> db.shutdownserver ()
P:
Gechongrepl:primary> use adminswitched to DB admingechongrepl:primary> Db.shutdownserver () assert failed: Unexpected error:Error:shutdownServer Failed:no electable secondaries caught up as of 2015-05-28t23:59:19.685-0700error : Assert failed:unexpected Error:Error:shutdownServer Failed:no electable secondaries caught up as of 2015-05-28t23:5 9:19.685-0700 at Error (<anonymous>) at Doassert (src/mongo/shell/assert.js:11:14) at assert (Src/mongo/she Ll/assert.js:20:5) at Db.shutdownserver (src/mongo/shell/db.js:212:9) at (shell): 1:42015-05-28t23:59:19.702-0700 E Q Uery Error:assert failed:unexpected error:Error:shutdownServer failed:no electable secondaries caught up as of 20 15-05-28t23:59:19.685-0700 at Error (<anonymous>) at Doassert (src/mongo/shell/assert.js:11:14) at assert ( Src/mongo/shell/assert.js:20:5) at Db.shutdownserver (src/mongo/shell/db.js:212:9) at (Shell): 1:4 at Src/mongo/shell /assert.js:13
A:
Gechongrepl:arbiter> use adminswitched to DB admingechongrepl:arbiter> db.shutdownserver ()
Turn off P again:
Gechongrepl:primary> use adminswitched to db admin2015-05-29t00:00:44.938-0700 I NETWORK dbclientcursor::init Call () failed2015-05-29t00:00:44.940-0700 I NETWORK trying reconnect to 127.0.0.1:27017 (127.0.0.1) failed2015-05-29t00:00:44.941-0700 I NETWORK reconnect 127.0.0.1:27017 (127.0.0.1) okgechongrepl:secondary> Db.shutdownserver ()
The following guesses: Before closing the last primary node, the quorum node is closed before the error. (Switch off the primary node first, there are other secondary not in this case)
5: Off Order APS: no error 6: Off Order asp: no error
Validation guesses:
5: Off Order APS
A:
Gechongrepl:arbiter> use adminswitched to DB admingechongrepl:arbiter> db.shutdownserver ()
P:
Gechongrepl:primary> use adminswitched to DB admingechongrepl:primary> db.shutdownserver ()
S: Because the quorum node is closed. So the primary node will no longer automatically switch
Gechongrepl:secondary> use adminswitched to DB admingechongrepl:secondary> db.shutdownserver ()
6: Close Order ASP
A:
Gechongrepl:arbiter> use adminswitched to DB admingechongrepl:arbiter> db.shutdownserver ()
S
Gechongrepl:secondary> use adminswitched to DB admingechongrepl:secondary> db.shutdownserver ()
P:
gechongrepl:primary> 2015-05-29t00:12:23.962-0700 I NETWORK dbclientcursor::init call () failed2015-05-29t00 : 12:23.965-0700 i NETWORK trying reconnect to 127.0.0.1:27017 (127.0.0.1) failed2015-05-29t00:12:23.966-0700 I NETWORK Reconnect 127.0.0.1:27017 (127.0.0.1) okgechongrepl:secondary> gechongrepl:secondary> use adminswitched to DB admingechongrepl:secondary> db.shutdownserver ()
Summarize:
1: First close from node, quorum node. Or, close the quorum node first, and then close the slave node. Then: the master node automatically becomes the slave node
2: The primary node is closed first, the node automatically becomes the primary node, and the new primary node cannot be closed until the quorum node is closed
Primary and subordinate nodes are affected by priority when initializing
Priority: is the precedence, the default is 1, the priority 0 is the passive node and cannot be an active node. Priority 0 is selected as a large to small active node.
MongoDB Replica Set Configuration series four: closing Order of nodes