In slave Mongodb 3.0.1, when I run the show dbs command, I get the following error

After clustering Mongodb 3.0.1 on two machines. In slave mode, when I run this command “show dbs” , it shows “not master” .

Here is the error:

E QUERY Error: listDatabases failed: 
        { "note" : "from execCommand", "ok" : 0, "errmsg" : "not master" }
at Error (<anonymous>)

Please tell me how I can solve this problem.

+4
source share
1 answer

Please use rs.slaveOk()mongo on the console, you get an error.

+13
source

All Articles