ReplicaSet의 멤버교체 중 가장 간단함.


1. 교체당할 mongod instance shutdown

mongo shell로 접속해서 아래처럼.

repl_set_001:ARBITER> use admin

switched to db admin

repl_set_001:ARBITER> db.shutdownServer()

Tue Jun 30 09:18:11.932 DBClientCursor::init call() failed

server should be down...

Tue Jun 30 09:18:11.933 trying reconnect to localhost:27018

Tue Jun 30 09:18:11.933 reconnect localhost:27018 failed couldn't connect to server localhost:27018



2. ReplicaSet의 primary로 접속.

repl_set_001:PRIMARY> rs.remove('repl-set-001-arbiter.bloodguy.com:27018')

Tue Jun 30 09:26:08.397 DBClientCursor::init call() failed

Tue Jun 30 09:26:08.399 Error: error doing query: failed at src/mongo/shell/query.js:78

Tue Jun 30 09:26:08.399 trying reconnect to localhost:27018

Tue Jun 30 09:26:08.399 reconnect localhost:27018 ok



3. 교체하고자 하는 arbiter의 mongod 인스턴스 가동.


4. ReplicaSet의 primary로 접속.

repl_set_001:PRIMARY> rs.addArb('repl-set-001-new-arbiter.bloodguy.com:27018')

{ "ok" : 1 }

// status 명령어로 제대로 들어올 때 까지 확인 할 것.

repl_set_001:PRIMARY> rs.status()






[참고]

http://docs.mongodb.org/manual/tutorial/remove-replica-set-member

http://docs.mongodb.org/manual/tutorial/add-replica-set-arbiter







Posted by bloodguy

댓글을 달아 주세요