Add mongo-replica/README.md
This commit is contained in:
18
mongo-replica/README.md
Normal file
18
mongo-replica/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
```sh
|
||||
mongosh
|
||||
|
||||
rs.initiate()
|
||||
rs.add("IP:PORT")
|
||||
|
||||
rs.status()
|
||||
rs.printSecondaryReplicationInfo()
|
||||
|
||||
# primary로 전환
|
||||
rs.stepDown()
|
||||
rs.status()
|
||||
```
|
||||
|
||||
## URI
|
||||
```
|
||||
mongodb://새서버IP:포트,기존서버IP:포트/?replicaSet=레플리카셋이름
|
||||
```
|
||||
Reference in New Issue
Block a user