0

I am using docker to deploy mongodb ops manager, then i get the following error message

The gen.key file at /etc/mongodb-mms/gen.key does not match the gen.key already used for this Ops Manager installation. The key file for this Ops Manager server must be copied from another server. I only deployed ops in a node, where should I copy this file from it?

1 Answers1

3

First, make sure that your key is at /etc/mongodb-mms/gen.key and the permissions are correct so that the owner of the mongodb-mms service can read the key.

If you have tried to start the mongodb-mms service already, you may need to drop the configuration databases and try again.

To do this, connect to your replica set (or single mongod in your case) with the shell, show dbs and and drop every database that isn't admin or local. For example:

use mmsdbconfig

db.dropDatabase()

Try to start ops manager again:

sudo service mongodb-mms start

  • This is working! As ops manager creates multiple database, they can be dropped using script: var dbs = db.getMongo().getDBNames() for(var i in dbs){ db = db.getMongo().getDB( dbs[i] ); if (db.getName() !== 'admin' && db.getName() !== 'local') { print( "dropping db " + db.getName() ); db.dropDatabase(); } } Ref: https://stackoverflow.com/questions/51521199/how-to-drop-all-databases-in-mongodb – SaP Feb 04 '22 at 12:28