Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mongodb]

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

4
votes
2answers
7k 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 ...
64
votes
4answers
53k views

Difference between Sharding And Replication on MongoDB

I am just confuse about the Sharding and Replication that how they works..According to Definition Replication: A replica set in MongoDB is a group of mongod processes that maintain the same data ...
25
votes
1answer
14k 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 ...
26
votes
3answers
29k 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 ...
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 ...
32
votes
3answers
32k 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 ...
6
votes
1answer
5k 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 ...
2
votes
1answer
2k 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 ...
1
vote
1answer
78 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 (...
6
votes
3answers
7k 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 ...
1
vote
1answer
989 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
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 ...
5
votes
2answers
2k 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 ...
1
vote
2answers
1k 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 ...
1
vote
2answers
2k 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
1answer
32 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, ...
0
votes
7answers
650 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? Simply use mongodump --db [...
75
votes
5answers
34k 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 ...
33
votes
1answer
48k 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 ...
47
votes
4answers
124k 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 ...
19
votes
3answers
35k 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 ...
13
votes
2answers
17k 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, ...
13
votes
2answers
49k 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:...
16
votes
5answers
4k 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 ...
10
votes
4answers
14k 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 ...
2
votes
5answers
9k views

WiredTiger - “too many open files error” during resync of a secondary replica set member

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. ...
9
votes
3answers
11k 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
2answers
5k 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 ...
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 ...
1
vote
2answers
4k 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 ...
7
votes
2answers
3k views

MongoDB vs RDBMS DBA duties

What are the differences between the daily tasks/duties of a Mongo DBA compared to a RDBMS DBA? For example, some sites claim that a MongoDB DBA would not require to do data modelling or designing ...
2
votes
2answers
9k views

How restore from .gz backup with new database name using mongorestore r3.2.9?

I'm trying to backup/restore mongodb database to/from .gz files as sample script here #01 create .gz backup - ok for r3.2.9 and r3.4.10 mongodump --db ${DB_NAME} --gzip --archive=${BACKUP_FILE_GZ} #...
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 ...
2
votes
2answers
787 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 ...
1
vote
1answer
8k 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. ...
5
votes
1answer
2k 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
506 views

MongoDB Restore / Snapshot Schedule - Point In Time vs. Oplog Timestamp

in docs Restore a Replica Set from a Backup those restore points are available: Snapshot Point In Time Oplog Timestamp What's the differences between those restore points? I guess Snapshot is fast ...
4
votes
1answer
858 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 ...
3
votes
2answers
2k 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
10k 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 ...
3
votes
2answers
4k 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 ...
3
votes
1answer
2k 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: ...
3
votes
1answer
4k views

mongodb replication node stuck at “STARTUP2” with optimeDate as 1970

i have just setup replica sets with three nodes . the third node is stuck at stateStr STARTUP2 with "optimeDate" : ISODate("1970-01-01T00:00:00Z"). However its showing no error message. Is this ...
3
votes
1answer
2k 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 ...
2
votes
1answer
630 views

Good ratio for data, journal, and log drive sizes for MongoDB?

Is there a good ratio for drive sizes for MongoDB? For example if you have a 8Gig drive for the data, then how big should my drive for the log be? How about the drive for the journal? Just a little ...
2
votes
1answer
308 views

Replicaset with MongoDB: Two datacenters, one primary and the other secondary

The tutorial I found on MongoDB's website suggest installing an odd number of servers. For what it's worth, we're not sharding so it should be a simple setup. For even numbers I would need an arbiter. ...
2
votes
1answer
32k 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 ...
1
vote
2answers
5k 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 ...
1
vote
1answer
682 views

High Global Lock % on Mongodb

I've just started using Mongodb v2.4.8 and the global lock % averages 80% which seems rather high to me. The CPU usage is around 120% on a 2 core, 2GB RAM, SSD VPS running Ubuntu 12.04 64bit. iotop ...
1
vote
1answer
232 views

Why does MongoDB extend FileSize if it is already 5x larger than DataSize

I recently had to assign more diskspace to my MongoDB 2.4.8 instance. This instance continually receives transactions, makes some updates and then deletes them after 3 months. I would therefore expect ...