mongod --port 10000 --dbpath E:/field/replset/data/rs0 --replSet rscx --smallfiles --oplogSize 128
|
mongod --port 10001 --dbpath E:/field/replset/data/rs1 --replSet rscx --smallfiles --oplogSize 128
|
mongod --port 10002 --dbpath E:/field/replset/data/rs2 --replSet rscx --smallfiles --oplogSize 128
|
mongo --port 10000
|
rsconf = {
_id: "rs0",
members: [
{
_id: 0,
host: "<hostname>:27017"
}
]
}
rs.initiate( rsconf )
|
rscx:PRIMARY> rs.conf()
{
"_id" : "rscx",
"version" : 2,
"members" : [
{
"_id" : 0,
"host" : "favpc:10000"
}
]
}
|
rs.add("favpc":10001)
rs.add("favpc":10002)
|