Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
4
votes
1answer
799 views

MongoDB failover reasons

I have a replica set on MongoDB with 3 members - primary, secondary and arbiter. One day I came and saw that primary and secondary have switched. I'd like to find a reason for the failover that caused ...
4
votes
1answer
2k views

Best design of mongo replica set for DB read/write speed

I'm building a Node app that uses MongoDB. Whilst it would probably be fine to have node and mongo sitting on the same VPS, I want to ensure that the MongoDB is backed up and maintain high ...
4
votes
2answers
2k views

Import and Export database in Mongo just like MySQL

I am newbie to the Mongo.Before this I have worked only with MySQL.In MySQL we can import and export database easily.I want to know is there any option available in Mongo to import and export database ...
4
votes
2answers
12k views

MongoDB import bson files from a folder

I am unable to import (.bson) file on my computer to MongoDB database .I have been trying below commands : 1)mongorestore -d demo -c dcoll C:\data\dump\twitter\tweets.bson and 2)mongorestore -d ...
4
votes
1answer
670 views

Force a Member to Become Primary when Primary fails in mobgodb

I have mongodb 2.6.11 cluster of two members: nms02 and nms01m. I know how to force secondary to become primary when primary is avail. But now my primary nms02 failed..and nms01m is secondary...How I ...
4
votes
2answers
8k views

Multiple IPs are not getting bind in mongodb conf file

I am trying to bind multiple IP to mongodb config file, one is 0.0.0.0 and other is 127.0.0.1. I did the following change in configuration file /etc/mongod.conf # network interfaces net: port: ...
4
votes
1answer
745 views

Mongo 3 Intermitted Crashes

Currently running two VMs with fresh installs of Ubuntu 14.04 x64 and Mongo 3 Stable. Each VM has the same specs with 8 cores and 56GBs of RAM. Our processing VM is doing great under heavy loads, ...
4
votes
2answers
2k views

MongoDB text index and text search

I have a MongoDB collection db.articles,it has 2 keys ,"title" and "abstract".I want to do text search on these two keys.For example, the search text is "physics",and I want all the documents whose "...
4
votes
1answer
5k views

mongostat causing CPU 100%

On a 64Bit Debian 6 OS with 4 CPU cores and 8GB RAM, I can reproduce an issue with mongostat. Whenever I create an index, reIndex or even index in background, according to top, the CPU load is 40-60% ...
4
votes
1answer
687 views

Ideal environment and cost for running a medium size MongoDb server

I know some people will say this question does not belong here but i didnt find a better place on the internet to ask this. Please migrate to an appropriate place if you think it should be. I am using ...
4
votes
1answer
1k views

MongoDB optimization on high data

I have a mongoDB collection with 42M registers with 1M new registers every day. We found a low performance on mongoDB querying. showing in mongostat the fields: qr|qw ar|aw with values of 300-500. ...
4
votes
2answers
1k views

What is the difference between mongod in standalone vs replica set

I've been running Mongodb as a replica set on 3 servers (primary, secondary and arbiter) but because I have to downscale I'm converting the primary to a standalone server. Before this change the ...
4
votes
1answer
543 views

What is the best way to reload data in MongoDB

I am benchmarking MongoDB using YCSB framework using the latest drivers. During the benchmark, I change the cluster setup (adding/removing shards) extensively and delete/insert workloads in the order ...
4
votes
2answers
2k views

MongoDB just utilizing one CPU core

Would anyone happen to know why Mongo is just using one core instead of distributing traffic on all? I am using the PyMongo driver and MongoDB is running on a centos server.
4
votes
2answers
2k 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"), "...
4
votes
1answer
688 views

MongoDB “overacts” on cleaning/flushing and finally hangs up

Recently I run several times into trouble with mongodb that exhausted my system. The database is tiny, after a mongodump, all files together weight 248KB. After some hours uptime it happens that the ...
4
votes
1answer
775 views

MongoDB on RAID0?

As I'm reading production notes of mongodb I found that RAID0 is not recommended: Most MongoDB deployments should use disks backed by RAID-10. Avoid RAID-0 with MongoDB deployments. While RAID-0 ...
4
votes
1answer
2k views

MongoDB problems recovering a member of the replica set

I have a sharded database with 2 replica sets (RS1 and RS2) each one of the RSs with 2 servers. I had a problem yesterday with one member of the RS2, the mongod instance crashed throwing an error. ...
4
votes
2answers
1k views

Design the big data with mongo db

I'm working now on the implementation of the following feature: Say I have a collection in mongodb with millions of entries (very big say 100M), each entry is of type {"uniqId", "properties"} for ...
4
votes
1answer
1k views

Restore mongoDB by --repair and WiredTiger

We accidentally deleted the directory rm -rf /data/db which was our MongoDB path, and thanks to extundelete, we recovered it and got the directory /data/db. Here are our files in the directory, and ...
4
votes
1answer
457 views

Flask mongodb assertion 13 not authorized for query on flask_session.sessions

Need help resetting mongodb back to its original state. We have a flask app running with mongodb with authentication turned off. Running on Ubuntu with std Flask. We tried ALL sorts of combinations ...
4
votes
0answers
398 views

MongoDB background index builds block secondary

We recently experienced a disruptive incident in a MongoDB 3.2 cluster related to index creation. Scenario: Several indexes were created on the primary using background: true. Indexes were ...
4
votes
0answers
920 views

Primary node of MongoDB ReplicaSet constantly high cpu usage

We use mongo replicaSet version 3.4.2 on our production environments. The replicaSet works with 6 nodes , one primary and 5 secondaries. Few weeks ago we have started to get alerts on high cpu ...
4
votes
0answers
709 views

How to measure the memory usage of a Mongodb aggregation?

I recently started running into the Sort exceeded memory limit of... exception on an aggregation pipeline in MongoDB. I got around this by setting AllowDiskUse=True for the aggregation. However, I ...
4
votes
0answers
314 views

Performance degradation after upgrade from 3.0.11 to 3.2.12

Environment: CentoOS 6 (kernel 2.6.32), MongoDB community edition 3.0.11 and 3.2.12 , storage engine MMAP, config servers on SCCC We are experiencing performance degradation when moving from 3.0.11 ...
4
votes
1answer
1k views

Mongodb crash after WiredTiger Cannot allocate memory error

I am using MongoDB (3.2.6) as storage for my application and since a couple of weeks MongoDB started to crash usually every 1 or 2 weeks. The crash seems to come from an issue during WiredTiger memory ...
4
votes
0answers
167 views

Performance impact of having Polymorphic collections in MongoDB?

Say one document(Level 1) is supposed to have N(k) different kinds of items as sub-document arrays(Level 2), and these are stored in a separate collection(s?) due to lack of query optimisation for ...
4
votes
2answers
2k views

How to get mongodump --quiet to still report errors?

I'd like to run mongodump so that it only outputs errors (to avoid extraneous logwatch reporting for an automated nightly backup script). I've tried mongodump --quiet but from a quick test this ...
4
votes
1answer
592 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 ...
4
votes
1answer
996 views

MongoDB can't add new replica set member [rsSync] SEVERE: Got signal: 6

I have a replica set and I added a new member to the set. The initialSync begins for the new member and rs.status (on primary) shows STARTUP2 as status. However, after a long enough time, there's a ...
4
votes
3answers
7k views

Close MongoDB dead connections

I have a script that connects to my local mongos and do some processing. However, during the process, I encountered many cursor timeout exceptions, which (I suspected) left many dead connections on my ...
3
votes
3answers
4k views

Is findOne() in mongoDB deprecated

Is findOne() in MongoDB deprecated? I am asking this because when I use findOne() in WebStorm the IDE puts a line through findOne() and gives a message saying findOne() is deprecated and to find ...
3
votes
2answers
3k views

Mongo ReplicaSet - arbiter in connection string

I'm using ReplicaSet with Mongo and when i build the connection string i have all servers hosts and ports - comma delimited. My question is, shall i add the arbiter address there as well or just the ...
3
votes
2answers
6k views

MongoDB - how to reduce numYields

I have a MongoDB database with ~100GB data size. I ran a test with 300 threads and queries are all reads, no writes (except writes to db profiler I guess). I enabled database profiler to keep track of ...
3
votes
1answer
4k views

Mongo large chunks will not split

I had a 3 shard set up, and ran out of capacity, so I added 3 more shards. (Each shard is a replica set). But the data isn't spread across the cluster evenly. I have my chunkSize set to the standard ...
3
votes
1answer
130 views

Are operators also considered to be keys?

I'm taking a MongoDB course and one of the assignments asks to include quotes around keys. So I did for a query like this {$push: {"key":value}} But I was told that $push is also a key because it's ...
3
votes
1answer
10k views

db.serverStatus() got not authorized on admin to execute command

My mongo version : 2.6.11 I want to check db.serverStatus() in my robomomgo But got errmsg: { "ok" : 0, "errmsg" : "not authorized on admin to execute command { serverStatus: 1.0 }", "...
3
votes
1answer
13k views

MongoDB update object in Array

I have the following document: { "name" : "student_1", "courses" : [ { "name" : "Algebra", "grades" : [ 98, 96, 92 ] }, { "name" : "...
3
votes
1answer
2k views

Disable TTL thread in MongoDB

Is there any way to disable TTL deletion thread in mongoDB? I know that you can modify the ttl index expireAfterSeconds value to a high number in order to "technically" stop ttl from deleting, but i ...
3
votes
1answer
2k views

How to check my MongoDB throughput and perfomance limit?

How can I check how many queries per second my MongoDB is executing and whether it had reached the performance limit or not?
3
votes
9answers
15k views

mongodb could not find host matching read preference { mode: \“primary\” } for set?

I am deploy a monodb sharding, I have deploy a replica set in three machines: dev41:27017,dev42:27017,dev193:27017 and configsvr in three machine: dev41:27019,dev42:27019,dev193:27019 and also a ...
3
votes
1answer
481 views

Where to store data on AWS?

I'm using AWS to host my application, and I'm using mongodb as db. I have installed mongodb on amazon ec2, but now I have no idea about where I should store all of my data. Can I store all of my data ...
3
votes
1answer
15k 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" : ...
3
votes
3answers
12k views

How do I explicitly define data types for a MongoDB collection?

How do I explicitly define data types for a MongoDB collection? I understand that in Mongo if a collection doesn't exist it will create it when you insert the document, but I know the fields and data ...
3
votes
2answers
575 views

Scalability: Desiging a message table

This question might be deadly simple but I wanted to make sure I am going through the correct path and not making any simple and irrevertible mistakes. My project will be based on messaging and it ...
3
votes
1answer
7k views

What does reslen and other means in mongodb log?

database.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.772835, -6.186753 ], $maxDistance: 0.04498373205078301 }, Prominent: { $gte: 15 }, indexContents: { $all: [ /^aru/, /^op/ ] } } ...
3
votes
1answer
3k views

MongoDB: operator to match arrays whose elements are all contained in a specified array

The $all operator selects the documents where the value of a field is an array that contains all the specified elements. In my situation I need the opposite: an operator that selects the documents ...
3
votes
1answer
2k views

Mongo Super User won't connect to another database other than admin

Why is that? $ mongo admin -u admin -p password --host 192.168.99.100 MongoDB shell version: 3.2.9 connecting to: 192.168.99.100:27017/admin > show users { "_id" : "admin.admin", "user" : "...
3
votes
2answers
2k views

Does a replica set with only two machines make sense?

A lot of MongoDB tutorials, when they talk about replica sets, give examples of two machines: one originally initialized as primary, and another one originally created as secondary. As I understand ...
3
votes
3answers
5k views

Why does Mongo query hang for a long time when creating index?

We are migrating our single Mongo instance to Mongo cluster with sharding. I haven't started sharding yet. However, I found out when I try to add an index, I can't query any collection anymore. We don'...