Replica Set์ ๊ณผ๋ฐ์์ ๋ฉค๋ฒ๊ฐ ์ ์์ผ ๋, Primary role์ ๊ฐ๋ Member๋ฅผ ์ ์ถํ ์ ์๋ค. ์ฆ, ๊ณผ๋ฐ์๋ฅผ ์ฑ์ฐ์ง ๋ชปํ๋ฉด Write๋ ๋ถ๊ฐ๋ฅํ๊ณ Read๋ง ๊ฐ๋ฅํ ์ํ๊ฐ ๋๋ค. ์์ ์์์ฒ๋ผ 3๊ฐ์ค 1๊ฐ ๋ฉค๋ฒ๊ฐ ์ฃฝ์์ ๋๋ ๋ฌธ์ ๊ฐ ์์ง๋ง, 2๊ฐ์ ๋ฉค๋ฒ๊ฐ ์ฃฝ์ผ๋ฉด Primary Role์ด ์๋ค. ๋ํ ๊ณผ๋ฐ์๋ Voting ๋ฉค๋ฒ๋ฅผ ๊ธฐ์ค์ผ๋กํ๋ค.
4๊ฐ์ ๋ฉค๋ฒ๋ฅผ ๊ธฐ์ค์ผ๋ก ํ์ ๋ ๊ณผ๋ฐ์๋ 3๊ฐ์ด๋ค. ํ์ง๋ง, MongoDB์ ์ ์ถ ์๊ณ ๋ฆฌ์ฆ์ voting member๋ฅผ ๊ธฐ์ค์ผ๋กํ๊ธฐ ๋๋ฌธ์ Replica Set ๊ตฌ์ฑ์ด 4๊ฐ์ด๋๋ผ๋ 3๊ฐ ๋ฉค๋ฒ์์๋ง ์ ์ถ์์ ์ ์งํํ๋ค. ๊ทธ๋์ ์์ ์ด๋ฏธ์ง์ฒ๋ผ voting๋ฉค๋ฒ 3๊ฐ ์ค ๊ณผ๋ฐ์์ธ 2๊ฐ ๋ฉค๋ฒ๋ง ์ด์ ์๋ค๋ฉด Primary๋ฅผ ์ ์ถํ๋ค. ์ฐธ๊ณ ๋ก MongoDB๋ ์ต๋ 7๊ฐ์ Voting ๋ฉค๋ฒ๋ฅผ ๋ถ์ฌํ ์ ์๊ณ ์ต๋ 50๊ฐ์ ๋ฉค๋ฒ๋ฅผ Replica Set์ผ๋ก ๊ตฌ์ถํ ์ ์๋ค.
๊ณผ๋ฐ์ ํ ์คํธ (3 Member)
์ํ ํ์ธ
rs_1 [direct: primary] test> rs.status().members
[
{
_id: 0,
name: '__HOST1__:27017',
health: 1,
state: 2,
stateStr: 'SECONDARY',
uptime: 74756,
optime: { ts: Timestamp({ t: 1683264809, i: 1 }), t: Long("11") },
optimeDurable: { ts: Timestamp({ t: 1683264809, i: 1 }), t: Long("11") },
optimeDate: ISODate("2023-05-05T05:33:29.000Z"),
optimeDurableDate: ISODate("2023-05-05T05:33:29.000Z"),
lastAppliedWallTime: ISODate("2023-05-05T05:33:29.680Z"),
lastDurableWallTime: ISODate("2023-05-05T05:33:29.680Z"),
lastHeartbeat: ISODate("2023-05-05T05:33:31.355Z"),
lastHeartbeatRecv: ISODate("2023-05-05T05:33:31.355Z"),
pingMs: Long("0"),
lastHeartbeatMessage: '',
syncSourceHost: '__HOST3__:27017',
syncSourceId: 2,
infoMessage: '',
configVersion: 7,
configTerm: 11
},
{
_id: 1,
name: '__HOST2__:27017',
health: 1,
state: 2,
stateStr: 'SECONDARY',
uptime: 948956,
optime: { ts: Timestamp({ t: 1683264809, i: 1 }), t: Long("11") },
optimeDurable: { ts: Timestamp({ t: 1683264809, i: 1 }), t: Long("11") },
optimeDate: ISODate("2023-05-05T05:33:29.000Z"),
optimeDurableDate: ISODate("2023-05-05T05:33:29.000Z"),
lastAppliedWallTime: ISODate("2023-05-05T05:33:29.680Z"),
lastDurableWallTime: ISODate("2023-05-05T05:33:29.680Z"),
lastHeartbeat: ISODate("2023-05-05T05:33:32.284Z"),
lastHeartbeatRecv: ISODate("2023-05-05T05:33:31.539Z"),
pingMs: Long("0"),
lastHeartbeatMessage: '',
syncSourceHost: '__HOST3__:27017',
syncSourceId: 2,
infoMessage: '',
configVersion: 7,
configTerm: 11
},
{
_id: 2,
name: '__HOST3__:27017',
health: 1,
state: 1,
stateStr: 'PRIMARY',
uptime: 1814026,
optime: { ts: Timestamp({ t: 1683264809, i: 1 }), t: Long("11") },
optimeDate: ISODate("2023-05-05T05:33:29.000Z"),
lastAppliedWallTime: ISODate("2023-05-05T05:33:29.680Z"),
lastDurableWallTime: ISODate("2023-05-05T05:33:29.680Z"),
syncSourceHost: '',
syncSourceId: -1,
infoMessage: '',
electionTime: Timestamp({ t: 1682315664, i: 1 }),
electionDate: ISODate("2023-04-24T05:54:24.000Z"),
configVersion: 7,
configTerm: 11,
self: true,
lastHeartbeatMessage: ''
}
]
3๊ฐ์ ๋ฉค๋ฒ๊ฐ ์ ์์ธ ์ํ์ด๊ณ 1๊ฐ์ Primary์ 2๊ฐ์ Secondary๋ก ๊ตฌ์ฑ๋์ด ์๋ค.
rs_1 [direct: primary] test> rs.conf()
{
_id: 'rs_1',
version: 7,
term: 11,
members: [
{
_id: 0,
host: '__HOST1__:27017',
arbiterOnly: false,
buildIndexes: true,
hidden: false,
priority: 1,
tags: {},
secondaryDelaySecs: Long("0"),
votes: 1
},
{
_id: 1,
host: '__HOST2__:27017',
arbiterOnly: false,
buildIndexes: true,
hidden: false,
priority: 1,
tags: {},
secondaryDelaySecs: Long("0"),
votes: 1
},
{
_id: 2,
host: '__HOST3__:27017',
arbiterOnly: false,
buildIndexes: true,
hidden: false,
priority: 1,
tags: {},
secondaryDelaySecs: Long("0"),
votes: 1
}
],
protocolVersion: Long("1"),
writeConcernMajorityJournalDefault: true,
settings: {
chainingAllowed: true,
heartbeatIntervalMillis: 2000,
heartbeatTimeoutSecs: 10,
electionTimeoutMillis: 10000,
catchUpTimeoutMillis: -1,
catchUpTakeoverDelayMillis: 30000,
getLastErrorModes: {},
getLastErrorDefaults: { w: 1, wtimeout: 0 },
replicaSetId: ObjectId("63ae7ae46d30e0748a16a7d3")
}
}
Replica Set์ ๋ฉค๋ฒ ์ํ๋ฅผ ๋ณด๋ฉด, ๋ชจ๋ ์๋์ ๊ฐ์ ์ค์ ์ ๊ฐ๋๋ค.
- hidden: false
- priority: 1
- votes: 1
ํ์ฌ๋ Read์ Write ๋ชจ๋ ๊ฐ๋ฅํ ์ํ์ด๋ค.
1 Member Down
rs_1 [direct: secondary] test> db.shutdownServer()
Secondary ๋ฉค๋ฒ ํ๋๋ฅผ ์ฃฝ์ด๊ณ ๋ค์ ์ํ๋ฅผ ํ์ธํ๋ค.
rs_1 [direct: primary] test> rs.status().members
[
{
_id: 0,
name: '__HOST1__:27017',
health: 0,
state: 8,
stateStr: '(not reachable/healthy)',
uptime: 0,
optime: { ts: Timestamp({ t: 0, i: 0 }), t: Long("-1") },
optimeDurable: { ts: Timestamp({ t: 0, i: 0 }), t: Long("-1") },
optimeDate: ISODate("1970-01-01T00:00:00.000Z"),
optimeDurableDate: ISODate("1970-01-01T00:00:00.000Z"),
lastAppliedWallTime: ISODate("2023-05-05T05:39:39.694Z"),
lastDurableWallTime: ISODate("2023-05-05T05:39:39.694Z"),
lastHeartbeat: ISODate("2023-05-05T05:40:07.369Z"),
lastHeartbeatRecv: ISODate("2023-05-05T05:39:47.359Z"),
pingMs: Long("0"),
lastHeartbeatMessage: 'Error connecting to __HOST1__:27017 (__IP1__:27017) :: caused by :: Connection refused',
syncSourceHost: '',
syncSourceId: -1,
infoMessage: '',
configVersion: 7,
configTerm: 11
},
{
_id: 1,
name: '__HOST2__:27017',
health: 1,
state: 2,
stateStr: 'SECONDARY',
uptime: 949352,
optime: { ts: Timestamp({ t: 1683265199, i: 1 }), t: Long("11") },
optimeDurable: { ts: Timestamp({ t: 1683265199, i: 1 }), t: Long("11") },
optimeDate: ISODate("2023-05-05T05:39:59.000Z"),
optimeDurableDate: ISODate("2023-05-05T05:39:59.000Z"),
lastAppliedWallTime: ISODate("2023-05-05T05:39:59.695Z"),
lastDurableWallTime: ISODate("2023-05-05T05:39:59.695Z"),
lastHeartbeat: ISODate("2023-05-05T05:40:08.317Z"),
lastHeartbeatRecv: ISODate("2023-05-05T05:40:07.622Z"),
pingMs: Long("0"),
lastHeartbeatMessage: '',
syncSourceHost: '__HOST3__:27017',
syncSourceId: 2,
infoMessage: '',
configVersion: 7,
configTerm: 11
},
{
_id: 2,
name: '__HOST3__:27017',
health: 1,
state: 1,
stateStr: 'PRIMARY',
uptime: 1814421,
optime: { ts: Timestamp({ t: 1683265199, i: 1 }), t: Long("11") },
optimeDate: ISODate("2023-05-05T05:39:59.000Z"),
lastAppliedWallTime: ISODate("2023-05-05T05:39:59.695Z"),
lastDurableWallTime: ISODate("2023-05-05T05:39:59.695Z"),
syncSourceHost: '',
syncSourceId: -1,
infoMessage: '',
electionTime: Timestamp({ t: 1682315664, i: 1 }),
electionDate: ISODate("2023-04-24T05:54:24.000Z"),
configVersion: 7,
configTerm: 11,
self: true,
lastHeartbeatMessage: ''
}
]
0๋ฒ ๋ฉค๋ฒ๋ ์ฐ๊ฒฐํ ์ ์๋ ์ํ์ด์ง๋ง, 1๋ฒ๊ณผ 2๋ฒ์ ๊ฐ๊ฐ ์ด์์๊ณ Secondary์ Primary role์ ๊ฐ๋๋ค.
2 Member Down
rs_1 [direct: secondary] test> db.shutdownServer()
๋์ผํ๊ฒ ๋ค๋ฅธ Secondary Member๋ฅผ ์ฃฝ์ธ๋ค. ๊ทธ๋ฆฌ๊ณ ์ํ๋ฅผ ๋ค์ ํ์ธํ๋ค.
rs_1 [direct: secondary] test> rs.status().members
[
{
_id: 0,
name: '__HOST1__:27017',
health: 0,
state: 8,
stateStr: '(not reachable/healthy)',
uptime: 0,
optime: { ts: Timestamp({ t: 0, i: 0 }), t: Long("-1") },
optimeDurable: { ts: Timestamp({ t: 0, i: 0 }), t: Long("-1") },
optimeDate: ISODate("1970-01-01T00:00:00.000Z"),
optimeDurableDate: ISODate("1970-01-01T00:00:00.000Z"),
lastAppliedWallTime: ISODate("2023-05-05T05:39:39.694Z"),
lastDurableWallTime: ISODate("2023-05-05T05:39:39.694Z"),
lastHeartbeat: ISODate("2023-05-05T05:44:03.013Z"),
lastHeartbeatRecv: ISODate("2023-05-05T05:39:47.359Z"),
pingMs: Long("0"),
lastHeartbeatMessage: 'Error connecting to replica-50-001-mongo-v-jp2v-dev.lineinfra-dev.com:20011 (10.241.152.125:20011) :: caused by :: Connection refused',
syncSourceHost: '',
syncSourceId: -1,
infoMessage: '',
configVersion: 7,
configTerm: 11
},
{
_id: 1,
name: '__HOST2__:27017',
health: 0,
state: 8,
stateStr: '(not reachable/healthy)',
uptime: 0,
optime: { ts: Timestamp({ t: 0, i: 0 }), t: Long("-1") },
optimeDurable: { ts: Timestamp({ t: 0, i: 0 }), t: Long("-1") },
optimeDate: ISODate("1970-01-01T00:00:00.000Z"),
optimeDurableDate: ISODate("1970-01-01T00:00:00.000Z"),
lastAppliedWallTime: ISODate("2023-05-05T05:43:19.702Z"),
lastDurableWallTime: ISODate("2023-05-05T05:43:19.702Z"),
lastHeartbeat: ISODate("2023-05-05T05:44:02.860Z"),
lastHeartbeatRecv: ISODate("2023-05-05T05:43:29.690Z"),
pingMs: Long("0"),
lastHeartbeatMessage: 'Error connecting to replica-50-002-mongo-v-jp2v-dev.lineinfra-dev.com:20011 (10.241.152.126:20011) :: caused by :: Connection refused',
syncSourceHost: '',
syncSourceId: -1,
infoMessage: '',
configVersion: 7,
configTerm: 11
},
{
_id: 2,
name: '__HOST3__:27017',
health: 1,
state: 2,
stateStr: 'SECONDARY',
uptime: 1814656,
optime: { ts: Timestamp({ t: 1683265409, i: 1 }), t: Long("11") },
optimeDate: ISODate("2023-05-05T05:43:29.000Z"),
lastAppliedWallTime: ISODate("2023-05-05T05:43:29.702Z"),
lastDurableWallTime: ISODate("2023-05-05T05:43:29.702Z"),
syncSourceHost: '',
syncSourceId: -1,
infoMessage: '',
configVersion: 7,
configTerm: 11,
self: true,
lastHeartbeatMessage: ''
}
]
3๊ฐ์ ๋ฉค๋ฒ ์ค 2๊ฐ์ ๋ฉค๋ฒ๊ฐ ์ฃฝ์ ์ํ์ด๋ค. Replica Set์ ์ํ๋ฅผ ํ์ธํ์ ๋, Primary๋ ์๊ณ Secondary๋ง ๋จ์์๋ ์ํฉ์ด๋ค. 3๊ฐ์ ๊ณผ๋ฐ์์ธ 2๊ฐ์ ๋ฉค๋ฒ๊ฐ ์ ์์ด์ง ๋ชปํ์ฌ Primary๋ฅผ ์ ์ถํ์ง ๋ชปํ๊ณ ์๋ค. ์ค์ 3๊ฐ์ ๋ฉค๋ฒ๋ก ์ด์๋๋ MongoDB๋ผ๊ณ ๊ฐ์ ํ์ ๋, ๋ชจ๋ ๋ฉค๋ฒ๊ฐ ์ฃฝ๋ ๊ฒฝ์ฐ๋ ์์ธ๋ก ๋๋์ ๋ถํ๊ฐ ๋ฐ์ํ์ ๋ ๊ฐ๋ฅํ์ง๋ง, 2๊ฐ์ ๋ฉค๋ฒ๋ง ์ฃฝ๋ ๊ฒฝ์ฐ๋ ๋งค์ฐ ๋๋ฌผ๋ค. ํ์ง๋ง, ์ธ์ ์ด๋ป๊ฒ ๋ฌธ์ ๊ฐ ๋ฐ์ํ ์ง ์ฐ๋ฆฌ๋ ๋ชจ๋ฅด๊ธฐ ๋๋ฌธ์ ์ค์ ๋ก ๊ณผ๋ฐ์๋ฅผ ์ฑ์ฐ์ง ๋ชปํ์ฌ Primary Member๊ฐ ์๋ ๊ฒฝ์ฐ ์ด๋ป๊ฒ ์ฒ๋ฆฌํด์ผํ๋์ง ๋ฏธ๋ฆฌ ์์๋ณด์.
์์์ Standalone ๋ณต๊ตฌ
Replica Set ๊ตฌ์ฑ์ ๋ชจ๋ ๋ฉค๋ฒ๊ฐ ๋์ผํ ๋ฐ์ดํฐ๋ฅผ ๋ค๊ณ ์๋ค. Read/Write ๋ชจ๋ ์ ์์ ์ผ๋ก ์๋ํ๊ธฐ ์ํด์๋ ๊ณผ๋ฐ์๊ฐ ์ ์์ด์ด์ผํ๋ค. ๊ทธ๋ผ ์์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์๋ ๋ฐฉ๋ฒ์ 2๊ฐ์ง์ด๋ค.
- ๋ฉค๋ฒ๋ฅผ ๋๋ฆฌ๊ฑฐ๋
- ๋ฉค๋ฒ๋ฅผ ์ค์ด๊ฑฐ๋
๋ฉค๋ฒ๋ฅผ ๋๋ฆด ๊ฒฝ์ฐ, MongoDB ์ค์น๊น์ง ์๋ฃ๋ ์ฆ, ๋ฐ๋ก ์ฌ์ฉ๊ฐ๋ฅํ ์ค๋น๋ ์๋ฒ๊ฐ ์์ด์ผํ๋๋ฐ... ์๋ฒ๊ฐ ์๋ค๊ณ ํ๋๋ผ๋ ๋ฐ์ดํฐ ์์ ๋ฐ๋ผ ๋ณต๊ตฌ ์๊ฐ ์ฐจ์ด๊ฐ ํฌ๊ฒ ๋ ๊ฒ์ด๋ค. ๋ฐ์ดํฐ๊ฐ ์ ์ผ๋ฉด Initial Sync๋ก ๊ธ๋ฐฉ ๋ณต์ ๋ฅผ ๋ฐ๋ผ๊ฐ ์ ์์ง๋ง... ๋๋์ ๋ฐ์ดํฐ์ผ ๊ฒฝ์ฐ, Initial Sync๋ ๋น์ฐํ๊ณ ๋ฐฑ์ ์ ๋ณต์ฌํ๋ ๋ฐฉ์๋ ํฌ๊ธฐ์ ๋ฐ๋ผ ๋น๋ก์ ์ผ๋ก ์ค๋ ๊ฑธ๋ฆด ๊ฒ์ด๋ค.
Primary ์ ์ถ์ ๋ชปํ๋ ์ฅ์ ๋ Write๋ฅผ ํ ์ ์๋ ๋งค์ฐ ๊ธด๊ธํ ์ฅ์ ๋ก, ์๊ธ์ฒ์น์ฑ์ผ๋ก ์ผ๋จ ๋ชจ๋ ๊ธฐ๋ฅ์ด ์ ์ ์๋ํ๋๋ก ์กฐ์ทจํ๋ ๊ฒ์ด ์ค์ํ๋ค. ๊ทธ๋์ ๋ฉค๋ฒ๋ฅผ ๋๋ฆฌ๋ ๊ฒ ๋ณด๋ค ๋ฉค๋ฒ๋ฅผ ์ค์ฌ์ ์ผ์์ ์ผ๋ก 1๊ฐ์ ๋ฉค๋ฒ๋ฅผ ๊ฐ๋ Standalone ํํ๋ก ๋ณต๊ตฌํ๋ ๊ฒ์ด ๊ฐ์ฅ ๋น ๋ฅผ ๊ฒ์ด๋ค. ์ฆ, 3๊ฐ ๋ฉค๋ฒ์ค 2๊ฐ ๋ฉค๋ฒ๋ฅผ Replica Set์์ ์ ๊ฑฐํ๋ ๋ฐฉ๋ฒ์ด๋ค. ๋จ ์๋์ ๊ฐ์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ ์ ์๋ค๋ ์ ์ ๊ณ ๋ คํด์ผํ๋ค.
- ๊ธฐ์กด Write ํธ๋ํฝ๊ณผ ๋ชจ๋ Read๊ฐ ํ๋์ ์๋ฒ์์ ๊ฐ๋นํ ์ ์์ด์ผํ๋ค. Read๊ฐ ์ฌ๋ฌ๋์ Secondary๋ก ๋ถ์ฐ๋๊ณ ์์๊ณ Write๋ ๋ง์ ์๋น์ค์๋ค๋ฉด ์ต์ ์ ๊ฒฝ์ฐ, ํ๋์ ์๋ฒ์์ ๋ชจ๋ ํธ๋ํฝ์ ๊ฐ๋นํ์ง ๋ชปํ๊ณ ๋จ์ ์๋ฒ ํ๋๋ ์ฃฝ์ ์ ์๋ค.
- Application๋จ์์ Read Preference๊ฐ secondary์๋ค๋ฉด Primary๊ฐ ํ๋๋ง ๋จ์์ ๋, Write๋ ๋๊ฒ ์ง๋ง ์คํ๋ ค ๋ฐ๋๋ก Read๊ฐ ์๋ ์ ์๋ค.
์ ๊ทธ๋ผ ์์ ๊ณ ๋ ค์ฌํญ์ ๋ฐฐ์ ํ๊ณ ... ๋ณต๊ตฌํ๋ ์์ ์ ์งํํ๋ ค๋๋ฐ...
rs_1 [direct: secondary] test> rs.remove('__HOST1__:27017')
MongoServerError: New config is rejected :: caused by :: replSetReconfig should only be run on a writable PRIMARY. Current state SECONDARY;
์์ ์ฒ๋ผ remove ๋ช ๋ น์ผ๋ก Replica Set Member๋ฅผ ์ ๊ฑฐํ๋ ๋ฐฉ์์ด 1์ฐจ์ ์ผ๋ก ์๊ฐ๋๊ฒ ์ง๋ง... ๋ช ๋ น ์ํ์ด ์๋๋ค. ์ด์ ๋ Secondary์์ ์ํํ๊ธฐ ๋๋ฌธ์ ๋ฐ์ํ๋ ๋ฌธ์ ์ด๋ค. ๋น ๋ฅธ ๋ณต๊ตฌ๊ฐ ํ์ํ ์๊ธ ์ํฉ์์ ๋ด๊ฐ ์์ํ๋๋ก ์งํ๋์ง ์์ผ๋ฉด... ์ผ๋จ ์ฌ์ฅ๋ถํฐ ๋ฉ๋ ๊ธฐ๋ถ์ด๊ณ ์๋ฆ ์ซ ๋ผ์น๋ฉด์ ๋งค์ฐ ๋นํฉ์ค๋ฌ์ธ ๊ฒ์ด๋ค. ใ ใ ์๋ ๋ฐฉ๋ฒ์ผ๋ก ์ฒ๋ฆฌํ์.
# ํ์ฌ ์ด์์๋ ๋ฉค๋ฒ์ ๋ฐฐ์ด ์์น๋ฅผ ํ์ธํ๋ค.
rs_1 [direct: secondary] test> rs.conf().members
rs_1 [direct: secondary] test> conf = rs.conf()
rs_1 [direct: secondary] test> conf.members = [conf.members[2]]
rs_1 [direct: secondary] test> rs.reconfig(conf, {force: true})
rs_1 [direct: primary] test> rs.status().members
[
{
_id: 2,
name: '__HOST3__:27017',
health: 1,
state: 1,
stateStr: 'PRIMARY',
uptime: 1817126,
optime: { ts: Timestamp({ t: 1683267912, i: 1 }), t: Long("15") },
optimeDate: ISODate("2023-05-05T06:25:12.000Z"),
lastAppliedWallTime: ISODate("2023-05-05T06:25:12.021Z"),
lastDurableWallTime: ISODate("2023-05-05T06:25:12.021Z"),
syncSourceHost: '',
syncSourceId: -1,
infoMessage: '',
electionTime: Timestamp({ t: 1683267821, i: 1 }),
electionDate: ISODate("2023-05-05T06:23:41.000Z"),
configVersion: 225221,
configTerm: -1,
self: true,
lastHeartbeatMessage: ''
}
]
์ฐํํ๋ ๋ฐฉ์์ผ๋ก reconfig์ force ์ต์ ์ ์ฌ์ฉํ๋ฉด ๋๋ค. ์ฝ๋๋ฅผ ๋๋ต์ ์ผ๋ก ์ค๋ช ํ์๋ฉด, rs.conf() ๋ช ๋ น์ผ๋ก ์ด์์๋ ๋ฉค๋ฒ์ ๋ฐฐ์ด ์์น๋ฅผ ํ์ธํ๊ณ ... members ๋ฐฐ์ด์ ์ด์ ์๋ seconday ๋ฉค๋ฒ ํ๋๋ฅผ ๋ฃ๊ณ ๊ฐ์ ๋ก Replica Set์ ์ฌ์ค์ ํ๋ ๋ฐฉ๋ฒ์ด๋ค. ์ด๋ ๊ฒ secondary ๋ฉค๋ฒ๋ง ์๋ ์ํ์์๋ ์์์ ์ผ๋ก standalone ํํ๋ก ๋ฐฐํฌํํ๋ฅผ ๋ณ๊ฒฝํ ์ ์๋ค. ๋จ, force๊ฐ ์์ ํ ๋ช ๋ น์ ์๋๊ธฐ ๋๋ฌธ์ ์ง๊ธ์ฒ๋ผ ์๊ธ์ฒ์น๊ฐ ํ์ํ ์ํฉ์์๋ง ์ฌ์ฉํ๋ ๊ฒ์ด ์ข๋ค.
๋๊ธ