~/mongodb-linux-i686-static-1.6.5/bin/mongo 127.0.0.1:6689 ### 在Slaver上創建帳號
> use local
switched to db local
> db.addUser('hrj','xxx')
{
"_id" : ObjectId("4d6f6527013fcbcc74575c20"),
"user" : "hrj",
"readOnly" : false,
"pwd" : "b27edaa5a8858aa3d46b60698fce1359"
}
~/mongodb-linux-i686-static-1.6.5/bin/mongo 127.0.0.1:6688 ### 在Master上創建帳號
MongoDB shell version: 1.6.5
connecting to: 127.0.0.1:6688/test
>use local
switched to db local
> db.addUser('hrj','xxx')
{
"_id" : ObjectId("4d6f6527013fcbcc74575c20"),
"user" : "hrj",
"readOnly" : false,
"pwd" : "b27edaa5a8858aa3d46b60698fce1359"
}
>use test ###添加帳號認證
switched to db local
> db.auth('hrj','xxx')