监控账号:mongos 连进去, mongos 和shard要有创建
db.createUser({
user:"user_monitor ",
pwd:"password",
roles:[{"db": "admin", "role": "clusterMonitor"},{"db": "admin", "role": "read"}]
})
备份账号:
mongos 连进去, mongos 和shard都要创建
db.createUser({
user:"user_backup",
pwd:"password",
roles:[{role:”backup”,db:”admin”}]
})
--创建业务账号,mongos和mongod都连进去创建
db.createUser({user:"username",pwd:"password",roles:[{role:"readWrite",db:"db_name"}]})
####mongo库日志归档### pid 是mongod对应进程号
kill -SIGUSR1 pid