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

0
votes
1answer
38 views

MongoDB SSL Certs

I have built MongoDB with support for SSL and am wondering how it works with certs signed by a certificate authority? I have a wild card cert for the domain, so if I have mdb(1|2|3|4).domain.com and ...
0
votes
1answer
52 views

Can we have more than one arbiter in monogodb replica set

I am setting up cluster of my webserver which uses mongodb. I am doing replica set of mongodb.I have only two machines. So can I have two arbiters in replica set ?
0
votes
1answer
48 views

Is using a relational DB for storing votes and (accessed resources) overkill?

I am writing a forum component for a site and would like to keep track of what topics/questions a user accesses so that other topics/questions can be recommended based on said users previous choices. ...
1
vote
1answer
64 views

Setting stack-size ulimit for mongodb to reduce connection overhead

I am using MongDB 2.4.9 and working on performance tunung. With reference to the ulimit settings for mongodb, in my linux environment (ubuntu 12.04) the default setting for ulimit -s is 8192. MongoDB ...
0
votes
1answer
103 views

Heavy load of one of shards in MongoDB

I have a problem with one of our shards. For some reason I'm getting the next usage 15:38:42 up 4 days, 10:28, 1 user, load average: 3.67, 3.50, 3.56 In the mean time all other shards are ok. ...
1
vote
1answer
39 views

Partial access MongoDB databases without replication. Is that possible?

Is there any possibility to deploy a structure in case if when one or two mongod(s) in sharded cluster will be unavailable, so we'll be able to read and write partial results in\from remaining shards? ...
1
vote
1answer
44 views

Checking records consistency after mongorestore --noobjcheck

I had an HDD malfunction on a Mongo node. After running fsck and mongod --repair I was able to dump the needed collection with mongodump and move it to another server. However, some records appear ...
0
votes
1answer
98 views

MongoDB page faults even when all data is in resident in RAM

I have made a sample app that emulates what my real one does. It simply iterates over all documents of a specific collection over and over. I start mongo (as a windows service) and mongostat shows ...
1
vote
2answers
238 views

How to activate load balancer in sharded MongoDB

I have a very simple MongoDB database structure. Also I have 5 shards in it (3 of them are replicasets). But we testing DB loading and it seems that load balancing doesn't currently enabled. On mongos ...
0
votes
1answer
30 views

Is there any relation between BSON storage for mongoDB and MySQL storage?

I am working on an application where I need to make analysis that what will be the storage size of BSON structure if same data is stored which is stored in MySQL. Basically I am comparing MongoDB and ...
1
vote
1answer
124 views

MongoDB Shard - Disable Cursor timeout

I'm using an sharded-cluster(Mongo version 2.4.1) with a java application. After a specific time (10 minutes or more) I got the following exception: com.mongodb.MongoException$Network: Read operation ...
0
votes
0answers
30 views

Mongo - Fetch results sorted by the number of matching values in an array object

I have a mongo Database with collections such as : [{ _id : 'one', tags1 : ['A', 'B', 'C'], tags2 : ['D', 'E', 'F'] },{ _id : 'two', tags1 : ['A', 'Z'], tags2 : ['D', 'F', 'G', 'M'] } ...
2
votes
2answers
90 views

Is it always faster to create indexes after loading data?

I have a large number of records (~1 billion) that I need to load into MongoDB (actually TokuMX, but whatever). I have about 6 different indices I need to create on the collection. Is it always faster ...
0
votes
1answer
146 views

MongoDB: Manual failover and failback between two datacenters?

This is about MongoDB and datacenter failover and failback. We're thinking about using two datacenters and this MongoDB replica set: DC1-M1 prio 1, votes 1 (datacenter 1, member 1) DC1-M2 prio 1, ...
0
votes
1answer
26 views

Mongo DB - reading during update

Is it possible in a three-member-replica set (1 primary, 2 secondaries) to update records on the primary, or even delete several records and insert the updated data, and still execute read-ops on the ...
-1
votes
1answer
67 views

how to split the chunks in sharding

I have edited the question. I was trying to run the sh.splitAt mongos> sh.splitAt("test.zp",{"city": "1"})it worked. But the problem is at sharding chunks. when i have run the command ...
0
votes
0answers
78 views

mongodb balancer does not move chunks because of obscure error

After carefully following this guide, on how to migrate a 3 member replica set to a shard containing 2 X 3 member replica sets, after sharding one of my collections nothing happened. Looking into the ...
0
votes
1answer
49 views

Mongo DB Backup & restore

0 down vote favorite I have a DB with 150GB of data's . Am using MongoDump and Mongorestore method to back and restore. My Production server is running with Mongo 2.2 and Test server is with 2.6.1 ...
0
votes
1answer
74 views

MongoDB - temporarily turn shard to standalone for local user creation

Following question Mongodb sharded cluster backup user issue I have a sharded mongodb cluster, with 4 shards, and I'm required to stop the mongod service on each shard, and start it not as a part of ...
3
votes
1answer
155 views

MongoDB presplitting chunks for compound shard key

In my mongodb setup I have a compound shard key {"region" : 1, "foo" : 1, "bar" : 1} and I know the values region can be and that each region should be on one chunk. Therefore I'd like to pre-split ...
0
votes
1answer
131 views

Huge size on mongodb's gridfs. Should I compact ?

I'm running mongodb and grid.fs to store small files (less than 20mbs). These are part of a replica set. I currently have more than 350000 files stored. I've noticed that the chunks collection takes ...
1
vote
0answers
88 views

MongoDB Replica Set: Can't Add Member/Connect

I'm building a MongoDB replicaset w/ three Ubuntu 14 servers. I'm connected to the primary server and authenticated w/ userAdminAnyDatabase and clusterAdmin privileges. When I run ...
1
vote
1answer
61 views

Mongodb sharded cluster backup user issue

We're using a simple python script to backup our mongodb cluster. the script connects to each mongod instance via ssh, and performs mongodump, all without requiring user/pass ever since we started ...
0
votes
1answer
93 views

MongoDB: The collections metadata lock is taken

Running a mongodb 2.6 cluster on localhost with four shards and four replication sets. Using a for loop with 100 iterations that pre-splits chunks among the existing shards. I am getting the error ...
0
votes
1answer
44 views

MongoDB only three of four shards being used

Using MongoDB 2.6, I've setup four replication sets: a, b, c & d: >rs.conf() a:PRIMARY> rs.conf() { "_id" : "name_of_replset", "version" : 1, "members" : [ { ...
1
vote
1answer
59 views

In shard cluster, if 2 replica set nodes are offline leaving only 1 secondary..where do writes go?

This is probably a simple question that i can't get definitive answer too. If i have 10 shards, each being a 3 node replica set. If i loose 2 servers in a replica set causing the primary to change to ...
2
votes
1answer
49 views

Optimize mongo inserts

I have a very write intensive application that I want to optimize. Additionally I don't care about losing data in a crash, as long as there is no corruption in the existing ones. Is it safe to run ...
1
vote
0answers
249 views

Neo4j vs mongodb [closed]

I want to store data of parents,teachers,students,subjects and the respective marks. All these entities are highly interlinked. Different schools have different type of data and each student will have ...
1
vote
1answer
149 views

Mongodb: slow shard balancing

I've decided to shard a collection with 500M+ documents into 24 shards. All shards are on the same machine without replicas as was advised in this title (core sharding). The shard key is {"_id":1}. I ...
1
vote
0answers
122 views

Mongo not using enough RAM, and is slow

Our Production Mongo appears to be behaving weirdly. As far as I have read, Mongo should eat up all the available RAM to cache Index and Data in memory but in our case it is not doing so. Our ...
0
votes
1answer
68 views

Maximum number of fields/columns in MongoDB

I'm considering learning and using MongoDB for a project, but I'm going to need to be able to store at least 1024 columns for the first part, and as many as 1048577 for the second. Does MongoDB have a ...
0
votes
0answers
27 views

Searching larger documents

I'm currently developing an application where I want to use MongoDB for the main database. I'm trying to store the emails metadata inside the database. My schema: user_id (integer 32bit) -- index ...
2
votes
1answer
444 views

MongoDB YAML file problems on Windows

I managed to get MongoDB running as a three member replica on Windows 8, but I had problems with configuration files. If I used the new (MongoDB 2.6) file format (YAML) and used the replica set name ...
1
vote
1answer
44 views

Creating Replicas Across Servers

I'm having some issues creating a replica set of my MongoDB. I have server A. Currently, it is setup as a local standalone replica. rs0:PRIMARY> rs.status() { "set" : "rs0", ...
0
votes
2answers
319 views

Write a query which add two fields of a document and compare their sum to third field in mongo

I have one document say db.pageTrendLog.findOne(); { "_id" : ObjectId("538b7128cf16e3ea5a1ab23c"), "pgDownloadTime" : NumberLong(9776), "pgAccessTime" : ...
1
vote
0answers
18 views

Modeling for inclusion of two different entities

What I Have I am currently hashing out the data model for an application that will utilize MongoDB. In my setup, users or members (as they are called in the schema) will be created and then assigned ...
0
votes
1answer
492 views

Storing multidimensional array in MongoDB

I am attempting to convert a large MySQL database of product information (dimensions, specifications, etc) to MongoDB for flexibility and to move away from the restriction of a column based table. I ...
0
votes
2answers
41 views

Which database for survey app [closed]

I need to build a very simple mobile survey app. The app will ask for different questions where people can give one of 3 possible answers, which will be always "yes", "no" or "maybe". To save ...
0
votes
1answer
61 views

MongoDB - sharding

I have a sharded cluster with 4 shards, 3 config databases. My problem is when I do my inserts only one shard gets filled. Can anyone please explain to me why this is happening. My first thought was ...
0
votes
0answers
46 views

mongodb logRotate on windows server 2008

Running mongodb on a windows server 2008 R2 as a service in trying to do a logrotate for my mongod processes. I currently have a replica set 3 replicas. when i issue the command: (rotate.js) ...
0
votes
1answer
216 views

Mongos down when I shutdown one of three servers

I deploy 3 server of mongodb, layout is node-01: mongos config server 1 replication server 1 node-02: mongos config server 2 replication server 2 node-03: config server 3 arbiter After ...
0
votes
1answer
278 views

MongoDB insert performance rapidly dropping

I'm currently experiencing a rapid decrease of the insert Performance. I have a rather simple data model { "Id": "ObjectId", "SomeProp": "xy", "SomeTags": [ { "key": ...
0
votes
1answer
113 views

Split Vector is taking too much time in mongo shard

I am using mongo shard distribution system. This system performs slow as the data size increases. I checked with profiler and saw split vector is taking to much time while running. It happened after ...
1
vote
0answers
119 views

Restore backup to staging replica set

I have a staging environment with Mongo replica set which I refresh on a regular basis. Refresh is done automatically using a bash script. Staging replica set consists of 3 members (primary, ...
0
votes
1answer
243 views

MongoDB - Adding a new server to an existing replica set with auth enabled

Short version: Is there a way to add a new SECONDARY server to an existing production MongoDB replica set without downtime, and without temporarily disabling the "auth" and "keyfile" config settings ...
3
votes
1answer
150 views

How are Mongodb indexes stored on disk?

So let me first start the question with my understanding of how MongoDb stores data on disk: So when you create a database in mongodb, it allocates a large file named <databasename>.0 and within ...
0
votes
1answer
155 views

Removing Database from sharded cluster in Mongo DB

I Have a mongo shard db system with two shards and and three mongos servers.My application creates DB on daily basis as per our business requirements. We have some sharded collection in each day DB. ...
0
votes
0answers
46 views

Collection VS lots of Fields

As of the moment we are having this collections RptCustomer RptCustomerMonthly RptCustomerDaily RptStoreCustomer RptStoreCustomerMonthly RptStroreCustomerDaily RptFranchise ...
2
votes
0answers
242 views

“Host has low open file limits” error in MMS

I am running Standalone MongoDB (v 2.6.0 64-bit) host on Centos (v 6.5). Centos is guest OS on Windows 7 host running under VirtualBox (4.3.10). MongoDB process runs under root account. And it is ...
2
votes
1answer
244 views

high background flush avg mongodb

similar question: High Global Lock % on Mongodb Overview We have a production setup replica set in v2.4.8 mongodb running on five 4-core, 28gb RAM VMs with standard azure datadisk HDDs running on ...