MongoDB is a scalable, high-performance, open source, document-oriented database. It supports a large number of languages and application development platforms. Questions about programming should be asked on http://stackoverflow.com.

learn more… | top users | synonyms

1
vote
1answer
50 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
18 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
29 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
48 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
96 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 ...
1
vote
0answers
13 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
38 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
70 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
28 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
26 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" : ...
0
votes
1answer
39 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
30 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
34 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
30 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 ...
0
votes
1answer
51 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
93 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
60 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 ...
0
votes
1answer
97 views

Adding wiredtiger nodes to a non-wiredtiger replica set

Situation I have 3 nodes on a Replica Set (P+S+S). Mongodb version 2.6.9. I would like to migrate all the nodes to 3.0.4 wiredtiger. When I need to do that without downtime, I do the following ...
0
votes
0answers
23 views

MongoDB fsyncUnlock won't unlock occasionally on Windows

We have a MongoDB replica set installed on Windows servers, with a scheduled backup job. MongoDB is configured to use journaling. The job runs db.fsyncLock() via script on MongoDB (primary server), ...
0
votes
1answer
36 views

How to read a bson file using C#

I have a bson file dumped by mongodump command. How can I read the content of this file to memory with C#?? I don't want to use the mongorestore command.
1
vote
1answer
43 views

Ring topology support of MongoDB ReplicaSet and Sharding?

Just curious if the following ring-like topology supported/recommended or is right for a sharded/replicaset cluster. version: mongodb 2.4.5 hosts(all vms) #[MongoDB Config] mongodb_roles="replset1 ...
3
votes
1answer
13 views

How to remove a corrupted shard in MongoDB

I use MongoDB 3.0.3 with Wired Tiger engine on Cent OS 6.4. I have a sharded cluster of 4 shards each of which has about a quarter of total data. One of the shard called "shard2" corrupted and ...
0
votes
1answer
46 views

how to make secondary slave as readable in MongoDB?

How do I make a secondary slave as readable in MongoDB? We can do this via shell command rs.slaveOk() But how we can do it permanently for all session via config file?
0
votes
1answer
59 views

Unable to create replica set for MongoDB in Linux

When I run the following command: rs.initiate(), I get the following error: "info2" : "no configuration explicitly specified -- making one", "me" : "ip-10-0-2-113:27017", "ok" : 0, ...
0
votes
1answer
49 views

Mongo is using 5-7% of CPU, so why is my computer so slow? [closed]

I've installed MongoDB (not sharded, single location) on an AWS EC2 instance, and I'm finding that when I'm running large insert operations via pymongo, my entire EC2 instance gets very sluggish. Yet ...
2
votes
0answers
57 views

Why is our Non-Mapped Virtual memory usage high when running MongoDB (MMAP) on CENTOS

Our non-virtual virtual memory usage on our Linux MongoDb instances seems high, currently sitting just over 2GB. The instances are running a minimal installation of CENTOS (no GUI) and they acting as ...
0
votes
1answer
24 views

Good ratio for data, journal, and log drive sizes for MongoDB?

Is there a good ratio for drive sizes for MongoDB? For example if you have a 8Gig drive for the data, then how big should my drive for the log be? How about the drive for the journal? Just a little ...
0
votes
0answers
29 views

Real time reporting on Mongo

I have my transactional data store as MongoDB cluster on which I need to setup real time reporting (maybe a lag of 2 hours will suffice). Data size - 300GB with 20,000,000 rows and 40 columns and ...
0
votes
1answer
15 views

On EC2 Why do I need individual EBS volumes for journal, log, and data?

According to this MongoDB tutorial which explains how to manually deploy MongoDB on EC2, one of the steps states that you should have: "Individual PIOPS EBS volumes for data (1000 IOPS), journal (250 ...
-1
votes
1answer
244 views

Mysql InnoDB vs Mongodb write performance

I need to increment a counter each time a web page is rendered. When I use mongodb to do that, I can do about 16000 writes per second on a 4 cores/8 threads CPU on a regular disk. When I use Mysql ...
2
votes
0answers
34 views

MongoDB C# driver fails to reconnect after stepDown

I have an Elastic Beanstalk environment in AWS that constantly verifies the DB is accessible by querying the mongos for one document. We only speak to the DB routers and not to specific instances. ...
2
votes
1answer
172 views

Mongodb high lock percentage / slow queries

I'm working with an application using MongoDB that is getting a fairly large number of incoming requests and I've noticed that the responses are getting slower as the number of requests get higher. ...
0
votes
1answer
92 views

Does the MongoDB background flush (MMAP) update the entire document even if only a small portion has changed? i.e. set on an array position

We are currently trying to get to the bottom of some high background flush times on our MongoDB installation. As part of this investigation we have been looking at the $set operation we perform on an ...
0
votes
1answer
56 views

updating single row in MYSQL

We have a situation where we need to update on a single row several thousands time a second and this requirement lasts continuously for 5 hours every day due to the nature of the business. Design ...
0
votes
1answer
46 views

What data structure is used for MongoDB 3.x geospatial indexes?

For the MongoDB 3.x geospatial features what structure is used for the indexes? B-tree? R-tree? X-tree? I can't find any information about the structures in their documentation
1
vote
1answer
29 views

How to index an property object in MongoDb?

i've the following sample document: { "_id" : ObjectId("556e177ca43da29e040041a7"), "user_id" : NumberLong(24), "request_datetime" : ISODate("2015-06-02T15:52:12.000-05:00"), ...
0
votes
1answer
56 views

mongodump with readpref nearest

I have a mongodb cluster where shards exist across multi geographically locations and each of those locations have replica members for each shard. I have setup our DR datacenter. Which also has a ...
0
votes
0answers
31 views

What is the sequence to enable the authentication in mongodb cluster without stopping the service

Assume that the cluster is running with authentication disabled. There are one mongos instance, 3 config servers, and two replication sets. each replication set has 3 mongod instances. My order is ...
-1
votes
1answer
122 views

MongoDB denying API access, while console shell works

I am a MongoDB newbie, with a MongoDB instance running on a Ubuntu machine. If I login onto the machine's console and run mongo -u username -p password databasename I have permissions for the ...
0
votes
0answers
15 views

MongoDB Backup & purge [duplicate]

I'm exploring solutions for a basic dbadmin need : periodically backing up and purging data in MongoDB. Basically, I need a logrotate for mongodb. I have a backend program filling a collection. I ...
1
vote
1answer
45 views

MongoLab: Does hardware effect performance of a find() query [closed]

I asked a pervious question on StackOverflow about if document size affected the performance of fetching that document (the document is 3MB in size) ...
0
votes
1answer
155 views

cannot log in to mongo from command line - using MongoDB 3.0 and WiredTiger - I've followed all instructions

NOTE: I have tried not setting bind_ip and also setting it to 0.0.0.0 -- neither one fixed my issue. This is my mongod.conf file: systemLog: destination: file path: "/root/mongodb.log" ...
0
votes
1answer
36 views

How to force a delayed member to become primary in case of failure in mongodb

I have three member set [primary,secondary & arbiter] in my data center 1 [DC1]. Now i want a delayed member in data center 2 [DR]. In case DC 1 is completely down then my sub net application ...
0
votes
0answers
64 views

Restart failed mongodb replica set instance under docker

I am trying to simulate when the master mongod instance shuts down for some reason in mongo replica set. So I took I docker file from here: ...
1
vote
0answers
91 views

Docker Mongodb replication on different hosts is not working

I am trying to setup a mongodb replication in Docker containers running on different hosts. Please find the steps below: In a VM1 running ubuntu 14.04, installed docker, then created container C1. ...
0
votes
1answer
28 views

Running Aggregation logic on multiple shards of MongoDB

Suppose we have 5 shards in MongoDB having collection of data, and I have to write an Aggregation logic which should work on each of 5 shards in my cluster and collect data from these shards. Should ...
0
votes
1answer
32 views

MongoDB 3.0 - how do I check which storage engine is being used? [duplicate]

I have MongoDB 3.0.0 running on a Digital Ocean droplet. How can I tell which storage engine it is using?
0
votes
1answer
34 views

Understanding MongoDB Aggregation

Pretend that our collection has 1M document Now if i do aggregation like this: db.users.aggregate({ $group: { _id : "$gender", avgAge : { $avg : "$age" } } }) then how it ...
0
votes
0answers
74 views

Best way to run an ETL on a production MongoDB database

We have the following environment: 3 servers + 3 replica set servers Each server has 3 shards Our main collection has around 40,000,000 documents that average at around 6kb Our shard key is ...
6
votes
1answer
57 views

Remove a shard in MongoDB

I have a MongoDB cluster, I accidentally hosed a shard, I don't have a backup. It's pretty easy to recover the data, but after issuing the removeShard command, it says it's draining. However, the ...