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
'DataBase' 카테고리의 다른 글
[MongoDB] chunk 이동 실패 (failed to sh.moveChunk, chunk too big to move) (0) | 2015.07.02 |
---|---|
[MongoDB] config server 교체 (0) | 2015.06.30 |
[MongoDB] shard별 최대용량 제한 (set the maximum storage size for a shard) (0) | 2015.05.26 |
[MongoDB] MongoDB 클러스터 가용성 테스트 (MongoDB availability) (0) | 2015.01.15 |
[MongoDB] chunk 사이즈 변경 (modify chunk size in a sharded cluster) (0) | 2015.01.15 |