replicaset

Update role user: not authorized on admin to execute command

天大地大妈咪最大 提交于 2020-01-14 12:44:26
问题 When I try to get info about replica I get the following error: rep0:PRIMARY> rs.printReplicationInfo() 2015-05-19T13:30:29.231+0200 error: { "$err" : "not authorized for query on local.system.namespaces", "code" : 13 } at src/mongo/shell/query.js:131 I have tried to execute the command with the two following users: [ { "_id" : "admin.siteRootAdmin", "user" : "siteRootAdmin", "db" : "admin", "roles" : [ { "role" : "root", "db" : "admin" } ] }, { "_id" : "admin.mongoadmin", "user" :

Update role user: not authorized on admin to execute command

断了今生、忘了曾经 提交于 2020-01-14 12:42:49
问题 When I try to get info about replica I get the following error: rep0:PRIMARY> rs.printReplicationInfo() 2015-05-19T13:30:29.231+0200 error: { "$err" : "not authorized for query on local.system.namespaces", "code" : 13 } at src/mongo/shell/query.js:131 I have tried to execute the command with the two following users: [ { "_id" : "admin.siteRootAdmin", "user" : "siteRootAdmin", "db" : "admin", "roles" : [ { "role" : "root", "db" : "admin" } ] }, { "_id" : "admin.mongoadmin", "user" :

Error to connect mongos when trying to create replicated sharded cluster

蹲街弑〆低调 提交于 2019-12-25 02:29:53
问题 I'm trying to create an replicated sharded cluster in mongodb. Initially I've created two shards and there are a replica set with three members in each shard. And all the shards and replicasets run in a single machine. I followed http://docs.mongodb.org/manual/tutorial/convert-replica-set-to-replicated-shard-cluster/ to deploy this structure and that worked perfectly. But as I'm running my mongodb in an AWS instance for a business application and I'm connecting my node.js server with the

MonogoDB Replica Set Status Not changing from Startup to Secondary

最后都变了- 提交于 2019-12-23 21:39:58
问题 I have setup a MongoDB replica set with 3 nodes(vm's running CentOS). One node became Primary other 2 stuck in Startup. When these 2 nodes will change their states from startup to secondary. aryabhata:PRIMARY> rs.status() { "set" : "aryabhata", "date" : ISODate("2016-04-30T08:10:45.173Z"), "myState" : 1, "members" : [ { "_id" : 0, "name" : "localhost.localdomain:27017", "health" : 1, "state" : 1, "stateStr" : "PRIMARY", "uptime" : 69091, "optime" : Timestamp(1461935462, 1), "optimeDate" :

MongoEngine specify read preference on query

青春壹個敷衍的年華 提交于 2019-12-20 03:11:00
问题 I am using Mongo 2.6, Pymongo 2.7.2 and Mongoengine 0.8.7. For a particular read query, I want to use the secondary of my replica set. Hence, as specified in the mongoengine documentation here I wrote my query as follows : from pymongo.read_preferences import ReadPreference <collection_name>.objects().read_preference(ReadPreference.SECONDARY_PREFERRED) However, the query is always going to the primary it seems ( The logs for this query are always seen only in the primary ). Is the syntax

MongoDb primary replica becomes secondary if secondary fails

孤者浪人 提交于 2019-12-12 06:45:59
问题 I have 2 mongo replicas. One is primary and the second one is secondary. If I stop the secondary replica, the primary one becomes secondary and I lost the write permissions. Here are my configs: replica:PRIMARY> rs.status() { "set" : "replica", "date" : ISODate("2016-02-26T11:27:50.140Z"), "myState" : 1, "members" : [ { "_id" : 1, "name" : "192.168.5.44:27017", "health" : 1, "state" : 1, "stateStr" : "PRIMARY", "uptime" : 80, "optime" : Timestamp(1456486069, 1), "optimeDate" : ISODate("2016

How to replace node in sharded replica set?

蹲街弑〆低调 提交于 2019-12-11 12:08:18
问题 I got sharded mongodb setup with two replica sets: mongos> db.runCommand( { listShards : 1 } ) { "shards" : [ { "_id" : "rs01", "host" : "rs01/10.133.250.140:27017,10.133.250.154:27017" }, { "_id" : "rs02", "host" : "rs02/10.133.242.7:27017,10.133.242.8:27017" } ], "ok" : 1 } Node 10.133.250.140 just went down, and I replaced it with another one (ip-address changed). Replica set reconfiguration was pretty easy, just rs.remove() and rs.add() Now I have to update host config for shard rs01.

What is the proper way of setting a mongodb replica set using docker and fig?

橙三吉。 提交于 2019-12-10 13:00:17
问题 What is the proper way of setting a mongodb replica set using docker and fig? I was trying to follow official mongodb tutorials to create a fig.yml file with some replica sets but always got blocked by how to call rs.initiate() and rs.add("<hostname><:port>") properly. I found this SO answer explaining why I can't start everything just from the shell , without calling rs.initiate() , so how can I accomplish that? Oh, and I am using mongo:latest (v2.6.5) as base image, without any

Mongoose with ReplicaSet on Atlas

纵然是瞬间 提交于 2019-12-09 12:01:20
问题 I have a replica set on MongoDB Atlas and this is my mongo shell connection string which connects perfectly: $ mongo "mongodb://MY_SERVER-shard-00-00-clv3h.mongodb.net:27017,MY_SERVER-shard-00-01-clv3h.mongodb.net:27017,MY_SERVER-shard-00-02-clv3h.mongodb.net:27017/MY_DATABASE?replicaSet=MY_REPLICASET-NAME-shard-0" --ssl --username MY_USERNAME --password MY_PASSWORD --authenticationDatabase MY_ADMIN_DATABASE How Can I convert it to use in mongoose? How Can I build my uri and options variable?

ReplicaSetId conflict while adding node MongoDB

荒凉一梦 提交于 2019-12-08 07:00:55
问题 When I try to add a new node to my replicate set I get this message: { "ok" : 0, "errmsg" : "Our replica set ID of 5890ad86c92c6c88e8573df0 did not match that of 10.0.253.3:27017, which is 5890a6b137e1380d1e697f2a", "code" : 103, "codeName" : "NewReplicaSetConfigurationIncompatible" } 回答1: I had the same error and impossible to find out why ... I come back on the post to send the solution if others pass here. Simply do not initialize the replicate on both servers: I have two separate X and Y