연습문제
Exercise 1
각각의 MongoDB instance에 연결하여 아래와 같이 수행했을 때 결과를 확인해본다.
Primary node에 연결하여
insert()
나머지 Secondary node에 연결하여
find()
$ mongo --port 30000
rs1:PRIMARY> use repl
rs1:PRIMARY> for (var n=1; n<=10000; n++) db.repl_test.insertOne({index: n, content: "hello world"})
rs1:PRIMARY> db.repl_test.count()
10000
$ mongo --port 30001
rs1:SECONDARY> use repl
rs1:SECONDARY> db.repl_test.count()
10000
Last updated
Was this helpful?