$ mkdir -p /Users/k2hyun/Database/mongodb/26101; mongod --port 26101 --dbpath /Users/k2hyun/Database/mongodb/26101 --logpath /Users/k2hyun/Database/mongodb/26101/log --fork --logappend --replSet rs1 --oplogSize 1000
$ mkdir -p /Users/k2hyun/Database/mongodb/26102; mongod --port 26102 --dbpath /Users/k2hyun/Database/mongodb/26102 --logpath /Users/k2hyun/Database/mongodb/26102/log --fork --logappend --replSet rs1 --oplogSize 1000
$ mkdir -p /Users/k2hyun/Database/mongodb/26103; mongod --port 26103 --dbpath /Users/k2hyun/Database/mongodb/26103 --logpath /Users/k2hyun/Database/mongodb/26103/log --fork --logappend --replSet rs1 --oplogSize 1000
$ mongo localhost:26101
> rs.initiate({"_id":"rs1", members:[{"_id":1, "host":"localhost:26101"}, {"_id":2, "host":"localhost:26102"}, {"_id":3, "host":"localhost:26103", "arbiterOnly":true}]})
rs1:PRIMARY>
$ mkdir -p /Users/k2hyun/Database/mongodb/26201; mongod --port 26201 --dbpath /Users/k2hyun/Database/mongodb/26201 --logpath /Users/k2hyun/Database/mongodb/26201/log --fork --logappend --replSet rs2 --oplogSize 1000
$ mkdir -p /Users/k2hyun/Database/mongodb/26202; mongod --port 26202 --dbpath /Users/k2hyun/Database/mongodb/26202 --logpath /Users/k2hyun/Database/mongodb/26202/log --fork --logappend --replSet rs2 --oplogSize 1000
$ mkdir -p /Users/k2hyun/Database/mongodb/26203; mongod --port 26203 --dbpath /Users/k2hyun/Database/mongodb/26203 --logpath /Users/k2hyun/Database/mongodb/26203/log --fork --logappend --replSet rs2 --oplogSize 1000
$ mongo localhost:26201
> rs.initiate({"_id":"rs2", members:[{"_id":1, "host":"localhost:26201"}, {"_id":2, "host":"localhost:26202"}, {"_id":3, "host":"localhost:26203", "arbiterOnly":true}]})
rs1:PRIMARY>
$ mkdir -p /Users/k2hyun/Database/mongodb/26001; mongod --port 26001 --dbpath /Users/k2hyun/Database/mongodb/26001 --logpath /Users/k2hyun/Database/mongodb/26001/log --fork --logappend --configsvr
$ mkdir -p /Users/k2hyun/Database/mongodb/26002; mongod --port 26002 --dbpath /Users/k2hyun/Database/mongodb/26002 --logpath /Users/k2hyun/Database/mongodb/26002/log --fork --logappend --configsvr
$ mkdir -p /Users/k2hyun/Database/mongodb/26003; mongod --port 26003 --dbpath /Users/k2hyun/Database/mongodb/26003 --logpath /Users/k2hyun/Database/mongodb/26003/log --fork --logappend --configsvr
$ mkdir -p /Users/k2hyun/Database/mongodb/26400; mongos --port 26400 --logpath /Users/k2hyun/Database/mongodb/26400/log --fork --logappend --configdb "localhost:26001,localhost:26002,localhost:26003"
$ mongos localhost:26400
mongos> sh.addShard("rs1/localhost:26101,localhost:26102")
{ "shardAdded" : "rs1", "ok" : 1 }
mongos> sh.addShard("rs2/localhost:26201,localhost:26202")
{ "shardAdded" : "rs2", "ok" : 1 }