Questions tagged [mongodb]
All versions of MongoDB - a scalable, high-performance, open source, document-oriented database.
116
questions
30
votes
1answer
20k views
Mongodb incremental backups
I was given the task to set up incremental backups for MongoDB replicaset, as start point, of course, I googled it and could not find anything on MongoDB docs, I did find however this question on ...
4
votes
2answers
9k views
How to Determine Chunk Distribution (data and number of docs) in a Sharded MongoDB Cluster?
Having done all the right things - picked an appropriate shard key, scaled horizontally, distributed my data across several shards, I find I now have no real way to determine how well balanced the ...
40
votes
3answers
68k views
MongoDB using too much memory
We've been using MongoDB for several weeks now, the overall trend that we've seen has been that mongodb is using way too much memory (much more than the whole size of its dataset + indexes).
I've ...
103
votes
4answers
80k views
Difference between Sharding And Replication on MongoDB
I am just confused about how Sharding and Replication work.
According to the definitions I found in the documentation:
Replication: A replica set in MongoDB is a group of mongod processes that ...
78
votes
5answers
40k views
Which database could handle storage of billions/trillions of records?
We are looking at developing a tool to capture and analyze netflow data, of which we gather tremendous amounts of. Each day we capture about ~1.4 billion flow records which would look like this in ...
37
votes
3answers
42k views
check storage engine from shell
I'm upgrading to 3.0 and ran into some issues with the upgrade. Specifically, I got an error when trying to start up mongod via ssh, it tried to use the default dbpath instead of the one I specified ...
9
votes
1answer
14k views
mongodb config servers not in sync
I have setup with 2 shards, with 2 replica servers and 3 config servers, and 2 mongos. I have following problems:
1) mongo config servers out of sync:
Aug 14 09:46:48 server mongos.27017[10143]: Sun ...
8
votes
3answers
8k views
How to restore .wt backup file to local MongoDB?
This is a question that was asked before, but I have tried all solutions, and simply cannot get it right. I have spent quite some time researching before posting this question. I have looked at the ...
5
votes
1answer
6k views
Can I disable journalling to improve performance
We have a 16 shard MongoDB 2.4 installation running in AWS that is eating money.
The data is volatile, it only gets used within 15 minutes of creation
If the cluster goes down we wipe it out and ...
1
vote
1answer
175 views
How can I prefer a specific MongoDB replica set member be elected as primary?
I have a replica set with 5 members. replica-1 is a primary and other replicas are secondary:
replica-1 (primary)
replica-2 (secondary)
replica-3 (secondary)
replica-4 (secondary)
replica-5 (...
7
votes
3answers
9k views
Primary replica set server goes secondary after secondary fails
I have a 2 servers replica set that, after the secondary fails the primary goes into secondary mode while the secondary is in STARTUP2 (recovering). The problem with this is that I can't use the ...
3
votes
1answer
5k views
How to close mongodb idle connection(active: false)?
I have an application running on node and using the mongodb library to establish connection and closing it. But the problem is, from the mongo serverStatus() command i can see that there is still 2k+ ...
2
votes
1answer
572 views
MongoDB stepDown fails in a PSA Architecture
I have set up a MongoDB cluster using a 3-Member Primary-Secondary-Arbiter Architecture
Environment:
LXC containers
Linux Debian Stretch (9.8)
MongoDB server version: 4.0.6
MongoDB Containers:
lxc-...
1
vote
1answer
1k views
Why MongoDB starts to split before 64MB
I'm testing the MongoDB Sharding with a Sharded Collection and a forloop to insert arround 1M documents to see how splitting and moving works.
I'm surprise that after few documents MongoDB starts to ...
5
votes
2answers
3k views
Mongodb restrict access on collections level
I'm building a backend system using MongoDB. Now I want to restrict access on certain numbers of database collections to this system. For example I have users, admin_users, pageviews and I want this ...
5
votes
6answers
1k views
Lots of Indexes - MySQL vs MongoDB - Migrating
So, I've never used MongoDB, I just read a lot about it and I think it's going to be good for my project. Also, I do not have lots of experience with MySQL and to be even more honest I have no clue of ...
2
votes
1answer
434 views
Fastest way to move Collection from Sharded MongoDB Cluster to a another Sharded MongoDB Cluster
I have to move a MongoDB Collection (Size: 1TB+) from Sharded MongoDB Cluster to another[5 shards on both clusters]. During this operation, it is assumed that the accompanying program will be offline, ...
2
votes
2answers
3k views
Mongodb: Possible to enlarge a capped collection?
If a collection is created as capped, is it possible to increase the cap without losing data?
Or to increase the cap without recreating the whole collection?
Thanks
1
vote
2answers
3k views
Mongodb Standalone Performs better than Replica Set
I am currently using a standalone mongodb with high read operations. Since replica sets could provide high read performance, I setup a 3 node replica set on 3 vms with read preference as "secondary ...
0
votes
1answer
282 views
Forbid mongodb not authenticated connect
If to run mongo with authorization (i.e mongod --auth) it still allows to connect using client mongo and get to mongo cli where one will get refused to execute any command.
But I wonder if it is ...
0
votes
7answers
1k views
Mongo cluster - simple backup question
I've got a mongo cluster with three nodes, running 2.6, but probably going to 3.2
What is the best method to back-up a database in a replica set of three mongodb servers?
Should I use mongodump --db [...
69
votes
5answers
215k views
How restore a specific database from backup using mongorestore command
I created a backup of all my databases using mongodump command. Now I want to restore a specific database using mongorestore command.
How is this possible, I use this command: --db option then ...
33
votes
1answer
55k views
Sample YAML Configuration Files for MongoDB?
The MongoDB configuration options documentation lists all the available options that can be specified, but does anyone have a set of fully formed example YAML formatted config files for MongoDB ...
15
votes
2answers
21k views
How to backup large MongoDB database
What is the recommended way to back up large data sets in MongoDB? Let's say we have a data size in the order of 10TB - how would you back that up?
We're considering a hidden, possibly delayed, ...
21
votes
3answers
43k views
MongoDB: RAM requirements
Is it enough to have the entire index in memory/ram or does mongodb even try to allocate as much ram as possible to store even the data for fast reads?
I'd like to run mongodb + other applications ...
16
votes
2answers
16k views
MongoDB terminates when it runs out of memory
I have the following configuration:
a host machine that runs three docker containers:
MongoDB
Redis
A program using the previous two containers to store data
Both Redis and MongoDB are used to ...
22
votes
2answers
103k views
Mongo Create a user as admin for any database raise an error
I am trying to create a simple user with the rights permission to access to any database and can do any actions. When I trying to execute the createUser command I got this error:
db.createUser({ user:...
2
votes
5answers
13k views
WiredTiger - “too many open files error” during resync of a secondary replica set member [closed]
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.
...
19
votes
5answers
5k views
Infrastructure for Highly Concurrent, High Write DB
My requirements are:
3000 Connections
70-85% Write vs Read
Currently, we are maxing out a High-CPU, Extra Large Instance at 700 connections. All 8 cores are maxed. We think it's the number of ...
14
votes
5answers
20k views
Why is Mongo stuck in STARTUP2?
I have a Mongo replica set with a few secondaries. A box, which hosts a secondary instance, crashed and lost the database.
I started the secondary Mongo instance again and now it's stuck in STARTUP2 ...
8
votes
2answers
10k views
Large `mongodump` followed by `mongorestore`
I have a fairly large (~240GB) Mongo database that I need to transfer across a sluggish network and onto a new server.
Traditionally for these situations, I've found that a mongodump followed by a ...
9
votes
3answers
12k 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 ...
6
votes
3answers
2k views
Setting up Mongo with clustering
I'm going to start using Mongo as a database but I will not have it clustered at first. Can I use Mongo on a single machine, then later come back, cluster it and capitalize on the sharding? Or can I ...
5
votes
3answers
13k views
MongoDB show duplicate key is null?
MongoDB version 3.6
I got the duplicate key message when I executed this. What's the actual problem?
mongos> db.setup.findAndModify({
... query : {"_id" : ObjectId("5b3c7abbea95705803084cad")},
.....
3
votes
1answer
3k views
storing files on mongodb
I am developing an app where user will upload multiple images along with some other data like name address etc.
I am using MEAN stack for development, So I have some questions regarding this:
How ...
1
vote
2answers
5k views
How to set cache on windows 10 pro 64bit machine
When running Mongod I get the following WARNING: The file system cache of this machine is configured to be greater than 40% of the total memory. This can lead to increased memory pressure and poor ...
5
votes
2answers
6k views
How to add setParameter in mongod config?
When I am using setParameter in mongod config, I start mongod with error:
Unrecognized option: setParameter = enableLocalhostAuthBypass=1
How can I use setParameter from config file ?
P/S: I am ...
5
votes
1answer
3k views
How to restore from .wt files?
Environment
Windows Professional 10
MongoDB 3.6.4 2008R2Plus SSL (64 bit) (before computer crash)
MongoDB 4.0.2 2008R2Plus SSL (64 bit) (after computer crash)
I have been developing locally, and ...
4
votes
2answers
8k 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
Why MongoDB is so slow on some queries while using IXSCAN as a winning plan?
I have DB with about 30M records in a collection with about 100GB collection size (total documents and indexes).
I have a compound index that filters data based on user_id and some other fields like: ...
2
votes
2answers
1k views
Sync MongoDB Replica set with Remote Replica Set
I'm wondering if it is possible (within reason) to sync a new MongoDB Replica Set(RS) with an RS currently in production.
The Problem
We have a site running on AWS that has its own MongoDB Replica ...
2
votes
1answer
2k views
When upgrading config servers to use WireTiger, the running config server with wiredtiger does not authenticate the existing pass and user?
In order to upgrade mongodb to 3.0.0, I am upgrading my config servers to use WireTiger. I followed the subsection of Change Config Server to Use WiredTiger. There are 18 steps. I run mongodump --port ...
1
vote
1answer
9k views
Issues with self signed certificates, SSL and MongoDB
Note: As specified in my comment I've figured out a solution to this issue regarding a single client/mongo connection. The next step is to figure out a solution for a replica set involving this fix.
...
1
vote
2answers
3k views
MongoDB document delete and fragmentation
I've a MongoDB collection that works like a queue: new documents are insert and old documents (after 60days) are removed. I can see a rapid grown of the datafile size, too rapid. I can be reasonable ...
11
votes
1answer
6k views
Is XFS still the best choice for mongodb?
There is this guide for production servers:
https://docs.mongodb.com/manual/administration/production-notes/#kernel-and-file-systems
It tells that for the WiredTiger storage engine, XFS is strongly ...
4
votes
1answer
1k views
Mongodb incremental oplog Dump not working
I am not able to take an incremental oplog dump. I am not getting any error messages the connection happens fine and also there is a operation recorded(shows up in db.currentOp()), but still nothing ...
4
votes
2answers
57k views
MongoDB: All commands spit out “not authorized on admin to execute command”
Mongo version: 3.2.11
I spun up a mongoDB droplet with DigitalOcean so that I could have a database connected to my little game. However, complications after complications have arisen.
I am ...
4
votes
1answer
3k 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 ...
4
votes
2answers
3k views
MongoDB replica set over ssh tunnels
I'm trying to archive something like this
The MongoDB instance on dc1.com is currently a standalone, and On-Site periodically pulls a backup via mongodump over a ssh tunnel.
I now want to create two ...
3
votes
1answer
12k views
What's the procedure to set up username/password on mongodb?
I have tried setting up username / password .But none of the methods seems to work.
1. In mongod.conf ----> remove **#auth=true** to **auth =true**
2.Started the mongod server --> sudo service ...