How to access to oplog MongoDB (MMS replica set)

后端 未结 1 1539
梦谈多话
梦谈多话 2021-01-20 06:42

I have a MongoDB replica set with MMS. I created a user with all privileges (all available on MMS) but I can\'t access to the local db and/or oplog colecction. TRACE:

<
1条回答
  •  南方客
    南方客 (楼主)
    2021-01-20 07:14

    Check this link

    Basically, from mongo 2.6 you need to create a user and grant access to the oplog (as well as accessing the DB using the right credentials)

    Something like:

    db.runCommand({ createRole: "oplogger", 
                   privileges: [{ resource: { db: 'local', collection: 'oplog.rs'},
                                   actions: ['find']}, ],
                   roles: [{role: 'read', db: 'local'}] })
    

    Full procedure here

    0 讨论(0)
提交回复
热议问题