Questions tagged [mongodb]

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

701 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9 votes
2 answers
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 I can't seem to get it to successfully start the balancer backup after everything's all said and done. Here's ...
Alexej Magura's user avatar
8 votes
0 answers
2k 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 ...
Dónal Flanagan's user avatar
7 votes
1 answer
13k 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 ...
国贵棠's user avatar
6 votes
0 answers
1k 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 ...
Arjen Meek's user avatar
6 votes
1 answer
9k 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 -...
Joey Yi Zhao's user avatar
6 votes
0 answers
1k 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: ...
M T's user avatar
  • 61
6 votes
1 answer
2k 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 ...
Abhishek Kumar's user avatar
5 votes
0 answers
6k 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 ...
Cerin's user avatar
  • 1,355
5 votes
1 answer
2k 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 ...
DessDess's user avatar
  • 101
5 votes
1 answer
2k 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 ...
szabkel's user avatar
  • 264
5 votes
3 answers
10k 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 ...
user avatar
4 votes
0 answers
295 views

Mongodb 4.2 Brute Force Defense

Is there any tool or configurations for mongodb server to protect against brute force attacks on the user credentials? I found only authFailedDelayMs param witch Available in MongoDB Enterprise only (...
Darii Petru's user avatar
4 votes
1 answer
1k 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 ...
frankr6591's user avatar
4 votes
2 answers
9k views

MongoDB restore with replica set

I have MongoDB setup like this: Primary | Server1 -----------+--------- Secondary | Server2 -----------+--------- Arbiter | Server3 -----------+--------- Backup | Server4 I ...
SGRao's user avatar
  • 41
4 votes
0 answers
2k 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 ...
user1953162's user avatar
4 votes
0 answers
338 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 ...
Antonios's user avatar
  • 1,207
4 votes
0 answers
356 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 ...
TarunG's user avatar
  • 141
4 votes
4 answers
8k views

Getting empty folder when using mongodump to back up my MongoDB

Basically, I have a problem with using mongodump to back up my MongoDB. This is the general syntax I use in SSH: mongodump -d myDatabaseName -o ~/backups/my_backup This is the resulting message: ...
Mabeh Al-Zuq Yadeek's user avatar
4 votes
1 answer
793 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 ...
James's user avatar
  • 141
4 votes
1 answer
1k 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 ...
VaidAbhishek's user avatar
3 votes
2 answers
11k views

MongoDB Won't Start Due to Core Dump

I have MongoDB 5.0.11 on Ubuntu 20.04 server inside of Virtualbox6.1. It has been humming along for months, but suddenly the mongod.service has refused to start. root@test:~# systemctl status mongod ●...
yupthatguy's user avatar
3 votes
2 answers
2k views

Choosing the right database for stock price history

The model is [(stock_id, period, ts), open, high, low, close, last, volume] We write new prices for all stocks (120,000) each minute and delete old once when they go out of retention time. It doesn't ...
Kaplan Ilya's user avatar
3 votes
0 answers
3k views

MongoDump Failed: error writing data for collection `collection` to disk: error reading collection: EOF

[BACKUP COMMAND] mongodump --host 127.0.0.1 -d database --port 27017 --username username --password password --out /output/path/mongodump_DATE_12_00_AM [ISSUE] Failed: error writing data for ...
Kavin's user avatar
  • 31
3 votes
1 answer
1k views

Reset mongo cache memory for test perfomance - windows

recently i'm working on mongo db and I'm trying to check the performance of mongodb with 2 million record. I need to clear cache every time I start the test. I don't want to restart the computer/...
John Sans's user avatar
3 votes
1 answer
2k views

mongodb keyfile permission denied

I configured in /etc/mongod.conf to enforce keyfile access control, in security option enabled, keyFile is /root/dbtest.key (the absolute path of keyfile). I already gave the ownership to mongodb user ...
necroface's user avatar
  • 139
3 votes
1 answer
817 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. ...
Gleeb's user avatar
  • 131
3 votes
0 answers
593 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 ...
DamDam's user avatar
  • 31
3 votes
1 answer
812 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 ...
Antonio Tomac's user avatar
3 votes
2 answers
5k views

How do I copy my MongoDB data files to a new server?

I copied the two files in MongoDB's data folder, which is default in Windows machine (C:\data\db), but when I start the mongo shell and type show dbs, it will not show my database. Steps I followed is ...
Krishna's user avatar
  • 31
3 votes
0 answers
2k views

Mongos process memory usage and crashes

So our MongoS instances use up A LOT of memory. More than even the shards and sometimes crash because of it. Cluster structure 3x mongos 3x mongod Shards 3x mongod Replicas (one for each shard) 3x ...
Sam's user avatar
  • 111
3 votes
0 answers
538 views

How to assign 'findandmodify' privilege to a mongo user?

I'm running a Mongo 2.6 replica instance where a node application needs to talk to. Basically nothing much was setup except these parameters: # where to write logging data. systemLog: destination: ...
Cedric Van Labeke's user avatar
3 votes
2 answers
4k 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':...
dalanmiller's user avatar
3 votes
1 answer
872 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 ...
Surya Rawat's user avatar
3 votes
0 answers
824 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 ...
George Octavian Rabanca's user avatar
3 votes
0 answers
837 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 ...
Paul George's user avatar
3 votes
0 answers
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 ...
user1213259's user avatar
3 votes
0 answers
206 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, ...
anon's user avatar
  • 53
3 votes
2 answers
8k 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 ...
user avatar
3 votes
2 answers
3k views

mongodb replication failed with socketexception and listener

I'm trying to set up mongodb replication using two servers in different data center. For the purposes of this question, I'll say their IP address are 1.1.1.1 and 2.2.2.2. I installed a clean version ...
learningtech's user avatar
3 votes
1 answer
650 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 ...
cuarti's user avatar
  • 31
2 votes
2 answers
51 views

MongoDB schema for visit and like

MySQL serves as our primary database, while MongoDB is employed for handling intensive write operations. I have been tasked with implementing a system for tracking visits and likes on products. The ...
BooRuleDie's user avatar
2 votes
1 answer
454 views

Is there a way for mongodb clients to connect to mongodb server (SSL/TLS enabled) without client certificates?

I am trying to setup a MongoDB with SSL/TLS enabled. I'm just wondering is there a way for clients to connect to my mongodb server without having a client certificate that would not compromise the ...
JRA's user avatar
  • 149
2 votes
0 answers
2k views

MongoDB Find query returning error, no idea why

I am learning MongoDB by myself. I am following all the official guides as well as watching videos and I am practicing on a movie database. Each document has an array "crew" with a "...
Carlo's user avatar
  • 21
2 votes
0 answers
375 views

mongorestore --drop slow on small db

I'm using a real Mongo instance for my integration tests. On every test, I call mongorestore my_db_state --drop because I need a clean db to start the next test. On my tiny db (with only one test user ...
libby's user avatar
  • 127
2 votes
0 answers
174 views

MongoDB - 100% CPU - recovering shard (after killing updates)

Can a recovering shard (as shown below) drive CPU to 100% for hours and hours? I have killed all the queries and updates (based on db.currentOp()) and stopped the flow of new data, but the CPU stays ...
NealWalters's user avatar
2 votes
1 answer
2k views

MongoDB: Mongoimport server selection error , connection refused, too many files open

Trying to insert several JSON files to MongoDB collections using shell script as following, #!/bin/bash NUM=50000 for ((i=o;i<NUM;i++)) do mongoimport --host localhost --port 27018 -u 'admin' -...
Erwin Zangwill's user avatar
2 votes
0 answers
56 views

MongoDb has to many open files

When dealing with very large collections i came across timeout issues when querying and inserting. Even though the collections were indexed and optimized to combine small documents together. The ...
Eran Otzap's user avatar
2 votes
0 answers
85 views

Searching across collections based on different column name

I have following collections with fields in my mongodb database: Collection: Category [ { "cat_id": "cat_id_1", "cat_name": "education" }...
TheLittleNaruto's user avatar
2 votes
1 answer
138 views

Sharding state recovery process found document - contains wrong list of config servers

I've been stuck on this issue for the most part of the day, feel like I am hitting a wall. I hope someone more knowledgeable can help me. Historical Setup Mongo Shard (4x replica sets) Config ...
user3639571's user avatar
2 votes
0 answers
205 views

Mongo: group query runs for hours then errors

I have a Mongo database with a collection with 1 billion rows. Each document has three fields, _id, Input and Hash. There are indexes on each of these fields. I'm attempting to run the following ...
Ian Newson's user avatar

1
2 3 4 5
15