All versions of MongoDB - a scalable, high-performance, open source, document-oriented database.

learn more… | top users | synonyms

2
votes
2answers
117 views

Sizing a MongoDB shard?

I am in the process of planning a MongoDB deployment, this will be my first to production and I have a question regarding the disk size of each shard in a cluster. This cluster itself will be for ...
0
votes
1answer
664 views

Mongo Create a user as admin for any database raise an error

I am trying to create a simple user with the rights permission to access to any database and can do any actions. When I trying to execute the createUser command I got this error: db.createUser({ ...
0
votes
2answers
29 views

Mongo DB Replica set - not able to read also

We have deployed mongodb replica set: mongod --port 27017 --dbpath /opt/eltropy/mongodb/data/rs0-1 --replSet rs0 --smallfiles --oplogSize 128 mongod --port 27018 --dbpath ...
0
votes
1answer
407 views

MongoDB MMS replica set fails to restart

I have a MMS replica set deployed with 3 instances. It was working fine until I shut it down this morning in order to do some changes and restarted it. From logs, it feels that there was an unclean ...
0
votes
0answers
35 views

MongoDB: Multiple timezone support

In Mongodb how to support multiple timezones? Say every client has his own timezone. I want to group by dates. Records are in different timezones before aggregation. The report should be aggregated ...
1
vote
0answers
112 views

MongoDB Update with NODE-RED?

I am in the process of trying to move data around via MQTT with MongoDB as my storage engine. I am using Node-Red to get the MQTT data and store it as JSON objects in Mongo using the mongo node ...
0
votes
0answers
26 views

Upgrade MongoDB cluster from 2.4.10 to 3.0.4

I have a MongoDB cluster running on 2.4.10 in production. According to the MongoDB docs, I have to do a step upgrade: from 2.4.10 -> 2.6 -> 3.0.4 For rollback we have to do step rollback: from ...
1
vote
1answer
121 views

How to update a whole document in MongoDB using PHP?

I want to update my older entries through the PHP interface in MongoDB. First, I get data from the text fields and then store that into variables. Then I use those variables to update data in Mongodb. ...
0
votes
0answers
26 views

Which database is suitable for simple querying/filtering/paging and ability to expire the data?

From what I read, i have to maintain index if I were to use redis. I can set EXPIRE of an object but then I have to update index set myself which is something I rather not do. mongodb has this ...
1
vote
1answer
69 views

Why does restarting MongoDB 3.0.x boost performance?

I have a MongoDB in my Development environment running on Windows, the server has 64GB of RAM, but MongoDB has only consumed 26.9GB (here we are building the database), so it should be able to hold ...
1
vote
1answer
93 views

cnames for mongo config server

I am seeing this line in many mongoDB links Use CNAMEs to identify your config servers to the cluster so that you can rename and renumber your config servers without downtime I need some help ...
2
votes
1answer
70 views

Dynamic relations in MongoDB

I'm designing a document with MongoDB where users have relationships with each other. Easy enough, right? { _id: "012", username: "happy4u", // ... related: [ '123', // user ...
0
votes
1answer
72 views

delete old 'Monitoring Agent' metrics and 'Automation Agent' Debug logs via scheduler

We use Ops Manager 1.6.2.251 # mongo MongoDB shell version: 2.6.10 connecting to: test > show dbs; admin (empty) alerts 0.203GB apiv3 0.578GB ...
0
votes
0answers
71 views

service vs. systemctl for mongodb-mms-automation-agent-manager on RHEL7

We installed mongodb-mms-automation-agent-manager-2.0.9.1201-1.x86_64 on RHEL7. There are two ways for starting/restarting/stopping the agent systemctl (the Redhat way) # systemctl -a | grep mms ...
0
votes
1answer
45 views

Can mongoDB split read and write, with primary on HDD, replica sets on SSD?

I have three machines, each machine both has SSH and HDD, I want to save SSD space, and in my env: less write, lots read. So does mongoDB support splitting read and write, with primary on HDD, replica ...
2
votes
2answers
124 views

How do I create a global MongoDB Admin account to see all Dbs?

I'm working on MongoDB, sysadmin helped setup the install. I'm confused about MMS the Cloud Manager, I created an account for @admin database I authenticate successfully but do not see "test" ...
1
vote
1answer
76 views

MongoDB Upgrade to 3.0: HostAndPort Exception

I want to upgrade my small MongoDB-Cluster (1 mongos, 3 config-servers, 2 shards a 3 nodes) running on OpenSuSe 13.1 (64bit) from 2.6.7 to 3.0.5. But it fails at the second step of the upgrade guide: ...
0
votes
0answers
38 views

How should massive effect update queries and scripts be performed?

I have some MongoDB databases in production (at a Mongolab AWS deployment) for which I've sometimes required to apply queries or scripts effecting on whole collections. As collections got over 20k ...
2
votes
2answers
58 views

How do I define the frequency of my mongo backup

I want to know if there is a way to define in Mongo the frequency of backups have to be executed. There is any config file for that? An example will be excellent!! UPDATE I want to create a ...
1
vote
1answer
27 views

least privilege MongoDB monitoring user (no access to customer data)

We use A Nagios plugin to check the status of MongoDB. Howto create a user with least privileges for this plugin? Admin acess would be a security vulnerability. I found the built in role ...
0
votes
2answers
248 views

MongoDB document delete and fragmentation

I've a MongoDB collection that works like a queue: new documents are insert and old documents (after 60days) are removed. I can see a rapid grown of the datafile size, too rapid. I can be reasonable ...
2
votes
1answer
27 views

Sharding Mongodb while limiting the number of documents to be migrated

I have little experience working with databases, but at my work i was tasked to deploy a sharded Mongodb cluster and the constrain on the shard is: database with multiple colections, 7 collections ...
0
votes
2answers
609 views

MongoDB: Server sockets closed after a few minutes

I am working with multiple AWS intances connected to the same mongo database (inside Compose.io Elastic deployment) but I keep getting the error server <url>:<port> sockets closed after a ...
0
votes
0answers
147 views

Recover from mongodb crash during repair

I ran mongodb(v2.4.9) repair with the --repairpath option to external device and the server got shutdown expectedly. I ran it like this (not the first time): sudo -u mongodb mongod --repair ...
2
votes
2answers
74 views

How to find queries that timed out in MongoDB?

Is it possible to find queries in the system.profile-Collection of a MongoDB-database that did not finish due to a timeout? I found some queries that ran longer than the time specified in $maxTimeMS. ...
2
votes
2answers
624 views

Secondary and Arbiter stuck in Startup

I'm using MongoDB version 3.0.0. I'm trying to setup mongodb replication on our machine. Replication was initially setup but due to some changes on the VM the entire thing crashed. When I tried to set ...
1
vote
1answer
56 views

mongo DB The disk space completelly filled for replicate instance

I am currently facing a scenario that one of the replicate server disk got completely filled up, while our primary server still has additional space left. My confusion is that the cmd like ...
2
votes
2answers
728 views

mongorestore failure: error writing file “/var/lib/mongodb”

I want sync my server db with my local db; dump db mongodump --db [db name] copy dump folder into my local restore dump on my local mongorestore --db [db name] [dump folder path] I ...
0
votes
1answer
160 views

MongoDB WiredTiger compression stats

I'm using MongoDB 3.0.4 with WiredTiger storage engine. I was looking at collection stats and I'm seeking explanation on compression stats fields. What does "page written failed to compress" indicate? ...
2
votes
1answer
177 views

mongodb is using most of disk space for journal and not cleaning itself

I am using mongodb on production with journal enabled. I am using mongodb to store application data and also using gridfs to store images. I am using Elastic Block Storage (EBS) with 10GB for each ...
1
vote
1answer
265 views

How to get minimum value in pyMongo

I have a collection with several fields, and I'd like to get the minimum value from one. I know a command for getting the max value: collection.find_one(sort=[("myfield", -1)])["myfield"] but not ...
0
votes
0answers
127 views

Running out of disk space when removing documents error

I'm trying to remove unused document from a production instance of MongoDB but, when I try to execute this query: db.collection.remove( { date: {$lt: new Date((new Date())-1000*60*60*24*90)} } ) ...
8
votes
0answers
1k views

Mongodb incremental backups

I was given the task to setup incremental backups for mongodb replicaset, as start point of course I googled about it and could not find anything on mongodb docs, I did find however this question ...
1
vote
1answer
322 views

WiredTiger - “too many open files error” during resync of a secondary replica set member

I'm upgrading a secondary replica set member to wiredTiger. I have upgraded it from MongoDB 2.6.3 to 3.0.4 and changed the storage engine to wiredTiger. Now it is resyncing all data from the primary. ...
1
vote
0answers
27 views

MongoDB user account required for arbiter?

I have a test environment with two mongo v2.6.5 instances (#1, #2) and an arbiter instance in a replica set. I have a a common key file configured for all three instances. I have created an admin ...
0
votes
0answers
91 views

MongoDB create user readWriteAnyDatabase but without the ability to create new DB

I want to create a single user who can read and write to any existing DB, but wouldn't be able to create new DBs. I want to give that privilege only to the dbAdmin. I have tried to create a user with ...
0
votes
0answers
276 views

Mongodb exception in initAndListen

My MongoDB server was full so Mongod service could not start. There was a specific db that I didn't need, so I have deleted its file from the dbpath. Now when I try to start the service again I'm ...
2
votes
2answers
1k views

Backup with mongoexport or mongodump?

For production backup, MongoDB recommends mongodump instead of mongoexport for accuracy of data. However, I would need to "scrub" data off a MongoDB database before backing it up. I am not aware of ...
2
votes
0answers
17 views

Should mongodb be run in a service, or a worker cluster?

I'm trying to implement an architecture that's similar to the coreos's production architecture (shown below) Should I run the database as a central service or one or more of the workers? I figured ...
0
votes
1answer
98 views

Bypassing LDAP for MongoDb Users

Environment: MongoDb: 3.0 Enterprise Edition Linux: Red Hat Enterprise Linux Server release 6.4 (Santiago) Use case: We need to have the above three MongoDb users which are not present in LDAP ...
3
votes
1answer
183 views

MongoDB: dbclient_rs replSetGetStatus failed{ ok: 0.0, errmsg: “unauthorized” }

When I'm using mongodump or mongorestore on a replica set these messages appear in the verbose output: dbclient_rs replSetGetStatus failed{ ok: 0.0, errmsg: "unauthorized" } The replica set is ...
1
vote
1answer
50 views

mongoDB design - to embed or not to embed

Let's say I have a mongoDB database with 3 collections: widgets thingomajiggers locations The way the application is going to be used that I will always force the user to specify a location ...
0
votes
1answer
315 views

mongoDB: querying for a document that has an object reference

I have a widgets collection that has records like this: { "_id" : ObjectId("55a6abe193819c033d4d755a"), "name" : "widget1"} { "_id" : ObjectId("55a6abe193819c033d4d755a"), "name" : "widget2", "loc" : ...
2
votes
1answer
73 views

MongoDB sharding

I have a questions about mongodb sharding. I have 7 VM with 1 master mongos and 3 config server en 3 shard servers. Mongo Main - 192.168.212.173 poort 27020 Mongo Shard1 - ...
0
votes
1answer
110 views

Client not reading from Mongo secondary database

I've implemented a replica set that I'm using globally. I have my master in Oregon, US and 4 secondaries. California and Virginia, Frankfurt and Sydney. I also have web servers in those same regions ...
1
vote
1answer
51 views

Why does MongoDB extend FileSize if it is already 5x larger than DataSize

I recently had to assign more diskspace to my MongoDB 2.4.8 instance. This instance continually receives transactions, makes some updates and then deletes them after 3 months. I would therefore expect ...
1
vote
0answers
39 views

mongoDB - how to link one embedded object to another embedded object

Background Information I'm trying my hand at my first mongoDB database. So far, I've decided that I will need to use both references and embedded data models. One of the features of this application ...
1
vote
1answer
91 views

How to manage RAM consumption in MongoDB?

I am using MongoDB. I have a hardware device which continuously submits data to the database every 10 seconds for 4 hours a day. The data includes latitude, longitude, and other basic information of ...
0
votes
1answer
407 views

MongoDB eats 100% CPU when idle

I am running in OpenVZ container with Ubuntu 14.04 LTS. MongoDB version: db version v3.0.4 git version: 0481c958daeb2969800511e7475dc66986fa9ed5 I use clean installation like described here - ...
1
vote
1answer
299 views

Mongodb find() operation sometimes extremely slow

I have a collection in mongodb (latest 3.0.4, not wiredtiger) with about 8 million documents. For the most part it's very fast but sometimes all reads to the database start stacking up and the culprit ...