본문 바로가기

리눅스

[리눅스] mongodb secondary show dbs 에러

728x90

mongodb secondary show dbs 에러

show dbs;
rs3:SECONDARY> show dbs;
uncaught exception: Error: listDatabases failed:{
	"topologyVersion" : {
		"processId" : ObjectId("62a024b73a8739206de930ae"),
		"counter" : NumberLong(6)
	},
	"ok" : 0,
	"errmsg" : "not master and slaveOk=false",
	"code" : 13435,
	"codeName" : "NotPrimaryNoSecondaryOk"
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
Mongo.prototype.getDBs/<@src/mongo/shell/mongo.js:145:19
Mongo.prototype.getDBs@src/mongo/shell/mongo.js:97:12
shellHelper.show@src/mongo/shell/utils.js:956:13
shellHelper@src/mongo/shell/utils.js:838:15
@(shellhelp2):1:1
rs3:SECONDARY> rs.slaveOk()
WARNING: slaveOk() is deprecated and may be removed in the next major release. Please use secondaryOk() instead.
rs.secondaryOk()
rs3:SECONDARY> rs.secondaryOk()
rs3:SECONDARY> show dbs;
admin   0.000GB
config  0.000GB
local   0.000GB
728x90