Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot drop 'local' database while replication is active

Tags:

mongodb

I've rs.remove(secondary) from the primary server, now going back to that secondary i want to delete all the data so i can set it up with a other primary, so i've deleted the /var/lib/mongodb, now going back to check if everything is deleted, i can only find local db with

replset.minvalid
replset.oplogTruncateAfterPoint
startup_log
system.rollback.id

so when i db.dropDatabase() i get the following

"operationTime" : Timestamp(0, 0),
    "ok" : 0,
    "errmsg" : "Cannot drop 'local' database while replication is active",
    "code" : 20,
    "codeName" : "IllegalOperation",
    "$clusterTime" : {
        "clusterTime" : Timestamp(0, 0),
        "signature" : {
            "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
            "keyId" : NumberLong(0)

what is wrong ?

like image 927
mohamedaymen benmoussa Avatar asked Aug 09 '26 18:08

mohamedaymen benmoussa


1 Answers

Your command line or config file still have the replSet parameter in it, so replication is still active.

Check for lingering replication options in your config file, or the --replSet parameter in the mongod executable.

like image 56
kevinadi Avatar answered Aug 11 '26 11:08

kevinadi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!