mongodb - Minimum Privileges required for Mongo lock and unlock -


we need have user minimal privileges able lock mongo instance, using db.fsynclock() , db.unlock(), ensure can take consistent snapshots of disk images. have following role created:

{     "role" : "local_lock",     "db" : "admin",     "isbuiltin" : false,     "roles" : [ ],     "inheritedroles" : [ ],     "privileges" : [         {             "resource" : {                 "cluster" : true             },             "actions" : [                 "logrotate",                 "resync",                 "unlock"             ]         }     ],     "inheritedprivileges" : [         {             "resource" : {                 "cluster" : true             },             "actions" : [                 "logrotate",                 "resync",                 "unlock"             ]         }     ] } 

but when use user attempt lock receive following:

> db.fsynclock() {     "ok" : 0,     "errmsg" : "not authorized on admin execute command { fsync: 1.0, lock: true }",     "code" : 13,     "codename" : "unauthorized" } > 

what other permissions required? mongo versions follows:

mongodb shell version v3.4.7 mongodb server version: 3.4.7 

well, limiting user tight may not idea , potentially he/she may not perform action @ all.

however, try granting fsync , unlock permissions account. see fsync , unlock actions in documentation.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -