Questions tagged [mongodb]

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

589 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
2answers
321 views

Mongos not returning existing data in shards

So we have a configuration of 2 shard (each is a replica set) and one sharded collection. There are around 10 million records in each shard. We are using mongo 2.6.4 version. We have sharded with ...
6
votes
2answers
3k views

verify that mongos server is connected to config servers

I've been writing a backup script for sharded replica-sets and it's almost done, except that I can't seem to get it to successfully start the balancer back up after everything's all said and done. ...
5
votes
1answer
1k views

MongoDB - slow remove query

I have a collection in MongoDB with 800M+ records. I wanted to do some cleanup, but the remove operation is really really (unusably) slow - even deleting 1000 records can take 10+ minutes. The ...
5
votes
0answers
918 views

Understanding MongoDB Log warning

In my MongoDB log, I am seeing these lines of messages: 2016-04-05T00:03:42.904+0000 I COMMAND [ftdc] serverStatus was very slow: { after basic: 200, after asserts: 240, after backgroundFlushing: ...
5
votes
2answers
788 views

Chunk Size is shown as 1 KB in mongo db logs even it is set to 300 MB

I am running a mongo cluster. Chunk size set is 300 MB but for today morning it is showing me in logs that chunk size is 1024 Byte. I checked in current op there also it is showing chunks of 1024 byte....
5
votes
1answer
1k views

Mongo replication lag slowly increasing

I am running a replica-set in production with slaveOk = false using mongo 2.0.7 in AWS The replication lag on one of the servers is close to 58 hours. This replication lag is sometimes decreasing ( at ...
4
votes
1answer
877 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
432 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
379 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
889 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
684 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
306 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
166 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
585 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
989 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 ...
3
votes
1answer
130 views

Mongo WriteConflictException in log file

I am experiencing ALOT of this WriteConflictException in my mongo log file, this does not seem to affect the application, because I am not seeing any special errors and everything seems to work fine. ...
3
votes
2answers
280 views

How to promote hidden mongo node to primary?

We are trying to implement DR setup for our mongodb replica set and currently three nodes in DR are configured to run as hidden nodes. We are trying to test failover to DR which will require promoting ...
3
votes
1answer
314 views

MongoDB Facet Error pipeline requires text score metadata, but there is no text score available

I created a mongodb faceted pipeline that the following is a subset of: db.books.aggregate( [ { $facet: { "categories": [ { $match: { $text:...
3
votes
2answers
2k views

MongoDB restore with replica set

I have MongoDB setup like this: Primary | Server1 -----------+--------- Secondary | Server2 -----------+--------- Arbiter | Server3 -----------+--------- Backup | Server4 I ...
3
votes
0answers
2k views

How to see progress of mongorestore?

Is there any way to get a progress measure or remaining time estimate from mongorestore? I used mongodump to export a compressed archive, which generated an 8GB file in about an hour and showed a ...
3
votes
1answer
2k views

How to improve performance of this aggregate query?

I have the following tables in MongoDB: Users table (count 200+ users): { "_id" : ObjectId("56dd6204ce47a3c44d8b4567"), "u_role" : "1", "u_fname" : "dsfsd", "u_lname" : "dsfdsf", "u_email" : "dsfds@...
3
votes
1answer
2k views

Speeding up MongoBD query { $ne: [] }

I'm currently doing a MongoDB aggregation but then have a query looking for all documents where a certain field, whose value is an array, is empty. obs = db.collection.count({'things.titles': {'$ne':...
3
votes
0answers
621 views

How to Shard a Mongodb Collection based on String and Date Time Shard Key using Range Based Sharding

I am new to Mongodb,I have to Shard a Collection Based on Integer, String and Date time shard key, I am able to shard a collection using integer shard key. below is the command,I am using for Range ...
3
votes
1answer
98 views

MongoDB Storage size scaling

I have a Java + MongoDB web application deployed on an OpenShift production medium gear, with no scaling enabled, with 11GB storage. At the moment, I have some data stored, so MongoDB accurately ...
3
votes
0answers
618 views

Very slow MongoDB find query

I am having troubles with this simple query which takes a few minutes. db.data_items.find({'observation_target.observation_target_id': 2190}).limit(20000) The explain output shows that the query ...
3
votes
0answers
506 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 ...
3
votes
0answers
2k 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 ...
3
votes
0answers
200 views

automated data sync after Primary node is down

I have this scenario, using version 2.2.2: Node A, Primary, Priority: 10, Wireless network Node B, Secondary, Priority: 9, VM Server1 Node C, Secondary, Priority: 8, VM Server1 Sequence: In Node A, ...
3
votes
2answers
7k views

mongo replicated shard member not able to recover, stuck in STARTUP2 mode

I have following setup for a sharded replica set in Amazon VPC: mongo1: 8G RAM Duo core (Primary) mongo2: 8G RAM Duo core (Secondary) mongo3: 4G RAM (Arbiter) mongo1 is the primary ...
3
votes
1answer
574 views

Database for store images

Actualy I'm using MongoDB with embedded images next to other data in same documents. Images count actualy are more than 14000 and each image size is less than 1MB. Images are readed frequently and ...
3
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 ...
2
votes
0answers
243 views

Mongo Db Update (upsert) taking several seconds

Machine Specs: 12 Cores 64GB Ram Mongo Setup: Mongo Version 4.0.5, XFS file system (Flash SAN backed), 1 replica set with 2 replicas, 10GB network all local (sub 1ms latency) Operation Being ...
2
votes
0answers
62 views

MONGOS uselessly scanning indexed documents when counting on shards

I have a simple collection with 40M documents distributed over 2 shards. The documents contain a field named COUNTRY with a sparse index on it. db.contacts.count({ "COUNTRY": "US" }) I am trying to ...
2
votes
1answer
284 views

Mongodb replica set primary and secondary node conf fail when one slave is down

In my env, I had created MongoDB replica set conf for high availability so one server fails should be handled by other also in my conf I have 3 DB server and 1 arbiter too but, my slave's server ...
2
votes
0answers
231 views

Should Azure host write-caching be enabled when using MongoDB's WiredTiger storage engine

I have several virtual machines on Azure running a mongoDB replicaSet with the WiredTiger storage engine. I'm not sure about the proper host caching option to set on the disks that contain the MongoDB ...
2
votes
0answers
236 views

getIndexes returns empty array on MongoDB collection

I'm trying creating indexes on a MongoDB collection and while they are correctly created and they work (I can see the index in the executionStats), the output of the getIndexes() function is an empty ...
2
votes
1answer
254 views

MongoDB sharding by monotonic id with zones for archiving

Situation: I have an ever-growing collection of documents which do have monotonically increasing unique id. All queries are direct lookup for documents with specified _id (no range queries nor ...
2
votes
1answer
568 views

MongoDB crashes with out-of-memory or is being killed by oom-killer

A two shards MongoDB database regularly crashes with out-of-memory error or is being killed by the oom-killer. The system runs on GCE Debian 9.4 with MongoDB v3.6.5, WiredTiger storage engine and ...
2
votes
0answers
771 views

MongoDB GridFS triples the file sizes

I really like using mongodb to store my data and recently I tried out GridFS and it really fits my use case. My problem with it is the space requirement, which seems quite odd. I have ~107GB of ...
2
votes
1answer
698 views

Merge 2 mongodb databases

Our team have hard time. Situation: API went down, all infrastructure (API + MongoDB) terminated. We restore API and mongodb (data restored from backup). After a while (let's say 1 day) we discovered ...
2
votes
1answer
319 views

Reliability of mongodump

I understand that the recommended way to backup MongoDB data is to use file system level tools. However, mongodump utility is promoted as a valid alternative for smaller instances, when file system ...
2
votes
0answers
47 views

Mongo express show more than 10 rows per collection

I'm a massive noob so please excuse me on this question if it's too dumb I use mongo express to visualize my database and do some direct changes. The thing with mongo express is that it shows only 10 ...
2
votes
0answers
187 views

Quickest way to partially restore a mongodb instance from AWS snapshots?

I have multiple large mongodb clusters running mongodb 3.4 configured with wiredtiger. I would like to set up standalone instances with just a few DBs from these clusters, all on the same EC2 instance....
2
votes
0answers
229 views

MongoDB + XFS - Snapshot backups - Cannot shrink XFS filesystem

I am using MongoDB 3.4 (with WiredTiger) with several replica sets and it has been great so far. I want to back up my data using snapshots as per the MongoDB recommendation for production backups. ...
2
votes
1answer
4k views

MongoDB Shutting down. Signal 15

Using MongoDB in a live server. Everyday in the morning, I find that mongod process is shutdown. The mongodb log is as follows: 2017-11-02T11:19:49.173+0000 I FTDC [initandlisten] Initializing ...
2
votes
1answer
1k views

How to add `--sslAllowInvalidCertificates` on mongodb uri?

I have a mongodb server requires x.509 certificate. So I have to use --sslPEMKeyFile and --sslCAFile on mongo shell command to connect to that server. It works fine. In my dev environment, I am using -...
2
votes
2answers
2k views

Help restoring a mongodump 3.4 backup into a different instance

I am working on backup recovery for MongoDB 3.4. We have an instance that is running and being used. I set up a instance for doing testing of the backup and recovery process. In order to get data I ...
2
votes
1answer
407 views

MongoDB Ops Manager backup and restore

The documentation claims that snapshots taken by ops manager are delta (differential) between successive snapshots. How do you then restore? I mean if you are able to delete some snapshots according ...