mongodb version 3.2.18 测试问题:
分析:
从报错内容上看是权限不够,但不明了为什么,因为已经使用的超级用户权限:
{ "_id" : "admin.myUserAdmin", "user" : "root", "db" : "admin", "roles" : [ { "role" : "userAdminAnyDatabase", "db" : "admin" }, { "role" : "dbOwner", "db" : "admin" } ] }
经过查询错误解决办法,了解到是集群管理权限不够,添加相应权限之后就可以解决问题,变更用户权限如下:
db.updateUser( "root", { roles : [ {"role" : "userAdminAnyDatabase","db" : "admin"}, {"role" : "dbOwner","db" : "admin"}, {"role" : "clusterAdmin", "db": "admin"} ] } )
成功关闭数据库系统:
db.shutdownServer({shutdown: 1, force: true})
http://blog.csdn.net/warrior_zhang/article/details/50503407
参考链接:
用户权限更新:https://docs.mongodb.org/v3.0/reference/method/db.updateUser/
mongodb副本配置:http://www.linuser.com/thread-507-1-1.html
mongodb user roles:https://docs.mongodb.org/v3.0/reference/built-in-roles/
报错解决办法:http://stackoverflow.com/questions/13303685/stop-unknown-instance-mongodb-ubuntu