~/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')