Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
5
votes
1answer
410 views

Compound Indexes for different sorts

I'm searching on a field and I want to sort on 3 different fields (viewcount,rating,time) separately. Am I correct in assuming that I need to do three different compound indexes {searchField :1, ...
5
votes
1answer
1k views

MongoDB performance limits of mongo

There are 100 data files, each with 60 fields and over 4 million records. There is a perl program that inserts the records or updates them based on an userdefined _id field. There is also a History ...
5
votes
1answer
933 views

MongoDB deployment best practices

I had a few questions around deployment best practices and how folks are using mongodb today. Feel free to add any other comments you can think off. No of databases per mongod instance. Is the ...
5
votes
3answers
13k views

MongoDB — Failed global initialization: Failed to open “/var/log/mongodb/mongod-config.log”

I'm trying to setup the config servers for mongodb sharding. I created a specific config file that is set to log to /var/log/mongodb/mongod-config.log. When I run mongod --config <path-to-config-...
5
votes
1answer
2k views

MongoDB ransom attack and its solution [closed]

For this problem, I'm trying to build a little api. In my opinion, HTTP Interface in the mongoDB documentation could be helpful. If you experienced same security issue, please share your solution ...
5
votes
1answer
10k views

How can I load csv data into mongodb and choose the types I'd like to have created for each column?

I'm looking for a method to load csv data in mongodb and specify the types that I'd like to have created for each column? I've been using mongoimport but I find it quite painful because there doesn't ...
5
votes
1answer
692 views

MongoDB working set size on capped collection larger than capped collection size?

On my database server right now I have 16GB of ram and an 8GB capped collection with about 4GB of indexes. So I may understand this wrong but shouldn't this only ever use around 12GB of my RAM or ...
5
votes
1answer
240 views

MongoDB Migrating away from RocksDB to WiredTiger

We have been working for some time with RocksDB as our engine and we are now trying to migrate to WiredTiger. We have some pretty big databases around 4~12 TB of data and according to the process ...
5
votes
1answer
108 views

Mongodb get Effective Lock

I´m trying to calculate the Effective Lock %, like MMS does. I think I could get it via MMS API, but most of our mongo instances currently are not monitored in MMS (and probably never will). All I ...
5
votes
2answers
7k views

Who can explain mongodb with ssl?

I created certificates according to the instructions on the official website of MongoDB, but it doesn't work properly. I have a replica set and self-signed certificates. I need a full encryption ...
5
votes
1answer
1k views

mongoexport not exporting all possible data

I have a collection with documents similar to the following: { _id: 'p_123456', id: 123456, kind: 'person' data: [...] } id field can contain either positive or negative integers. This ...
5
votes
1answer
735 views

Management tool for managing MongoDB sharded cluster [closed]

Is there a database management software for MongoDB that makes it easy to create a cluster, add shards, backup shards and all the complicated stuff. There are some many MongoDB clients but they are ...
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
930 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
796 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
2answers
8k 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 ...
4
votes
3answers
10k views

Write Locks in Mongo DB

I read somewhere that MongoDB holds db level write lock, does this mean that when someone updates any collection others are not allowed to read other collection or how it works. Also when someone ...
4
votes
2answers
10k views

Can MongoDB be configured to sit behind a load balancer?

According to this post: In a single replica set, you cannot distribute writes, they all must go to the primary. You can distribute reads to the secondaries already, via Read Preferences as you ...
4
votes
3answers
7k views

MongoDB refuse to start, operation not permitted

When I try to run mongod --dbpath=./data I get the following error: 2017-09-20T21:47:55.720+0200 I CONTROL [initandlisten] MongoDB starting : pid=20500 port=27017 dbpath=./data 64-bit host=debian ...
4
votes
3answers
8k views

How do I ensure I always connect to Primary/Secondary node in a MongoDB ReplicaSet?

I have a 3 node replica set running on 3 different servers. I have finished setting it up and everything works great. Now I want to give my users two connection strings: Connect to this "xyz" for ...
4
votes
2answers
13k views

How to views all documents in a particular collection of database in MongoDB through mongo Shell?

In the MongoDB shell, how to views all documents in a particular collection for the current database that I'm using? when i am trying through the query > db.getCollection().find() To getting ...
4
votes
1answer
855 views

How to generate this MongoDB diagnostics HTML report?

I'm seeing this kind of report in many JIRA bugs and I want to generate it for my mongo instance. What software was used for generating it?
4
votes
2answers
23k views

How can I time-stamp data in MongoDB?

I'm responsible for writing an app to juggle a huge amount of client and business intelligence information. This information involves records for various businesses and metrics like revenue, their web ...
4
votes
1answer
3k views

Multiple BindIp in MongoDB 3.4.1 on Debian Jessie

I just upgraded from MongoDB 3.2 to 3.4.1. /etc/mongod.conf had a multiple BindIP: bindIp: [127.0.0.1,192.168.20.1] This is not working anymore. I get this error : Scalar option 'net.bindIp' must ...
4
votes
3answers
15k views

How to run MongoDB as a non root user in Linux?

I can start MongoDB as $sudo service mongod start. When I start without sudo it gives me this error: /etc/init.d/mongod: line 58: ulimit: open files: cannot modify limit: Operation not permitted /etc/...
4
votes
1answer
7k views

How to convert _id field of all existing documents from type String to Number

At one of my collections I have an _id field that stores numbers. The field was defined originally in the Mongoose model as String. However, all the data concerning this field in the collection ...
4
votes
1answer
1k views

Hash index use case in MongoDB

Recently MongoDB added hash index to its features but in the documentation doesn't explain much about hash index use case and its privileges to normal MongoDB index. So I'll be grateful if you guide ...
4
votes
4answers
18k views

How to keep Mongodb log small via the conf file (or other persistent method)

This is related to my question in stackoverflow where vb.net simply hang on updating a mongodb query. https://stackoverflow.com/questions/12780258/insert-mongodb-using-vb-net/12796593#12796593 After ...
4
votes
2answers
2k views

mongoDB rs.initiate hangs

I am having trouble setting up replication on a new mongoDB installation. Everything works fine when I run without replication but when I run mongod with the --replSet option, and run rs.initiate(), ...
4
votes
1answer
3k views

Mongo replica set with no PRIMARY/SECONDARY, members are STARTUP2 and RECOVERING

I have a mongo cluster with 6 replica sets. 5 are fine, one is not. Each replica set has three members. Here is the rs.status() for it: { "set" : "rs_5", "date" : ISODate("2015-12-16T02:37:...
4
votes
2answers
7k views

MongoDB uses only one index on simple query with sorting

So the problem is that I'm having a huge collection and I'm trying to run a query that filters and sorts on only fields that have indexes on them. I have these two indexes: db.getCollection('product'...
4
votes
1answer
5k views

Why does mongodb virtual memory get so large

I have just compiled MongoDB in my linuxOS and not insert any data into DB. The virtual memory is getting very large, about 40G. ps aux|grep mongod mongodb 176574 0.0 0.0 423784 39008 pts/308 ...
4
votes
1answer
3k views

How does MongoDB store data in RAM?

I'm trying to sift through the remains of an event that was causing us a lot troubles. Aside from report to management about what happened, I'm trying to gain a much better understanding of how this ...
4
votes
3answers
7k views

MongoDB: Replica Set - master vs. slave

We think about moving from a master-slaves to MongoDB with replica-set. Now I wonder if MongoDB replicas are also set up like read-only slaves or if each mongos is able to write and sync the others ...
4
votes
1answer
1k views

Would appreciate some suggestions on how I should model this data

I am setting up a website that will have users. Users can search for songs and (if signed in) save them to a playlist or their library of songs. I want it to be like iTunes in that all the songs on ...
4
votes
1answer
3k 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 ...
4
votes
1answer
150 views

MongoDB: Can I have a delayed secondary that doesn't vote?

I have a replica set setup with 1 Primary, 1 Secondary and 1 Arbiter; each on a different data center. I want to add a delayed secondary to one of the existing data centers, but I don't want it to ...
4
votes
2answers
25k views

How to show all users of all databases in mongodb?

I know show users or db.getUsers() can show all users in current database in mongodb, but how to list all users in all databses for ease of management as an administrator?
4
votes
1answer
969 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
1answer
5k views

Mongodb high lock percentage / slow queries

I'm working with an application using MongoDB that is getting a fairly large number of incoming requests and I've noticed that the responses are getting slower as the number of requests get higher. ...
4
votes
1answer
10k views

mongodb distinct() in an array

In my mongodb database,there is only one document below: { "_id" : ObjectId("5226efc5ccf23796f9590f67"), "count" : NumberLong(126045), "eissn" : "1466-5034", "grade" : 0.0, ...
4
votes
1answer
996 views

Should I deploy Mongodb sharding for 50 collections?

I have a 10 node clusters that runs about 50 concurrent jobs. Each job needs to read/write a separate collection. So I have about 50 collections roughly. Each collection has about 20 M records. Most ...
4
votes
2answers
2k views

Limit memory used for mongoDb

Is there any way to limit using RAM for mongodb on Debian? I'm looking for a solution fo about 8 hours, but have no results.
4
votes
1answer
8k views

Mongodb: Document size of 29344731 is larger than maximum of 16777216

When we are upgrading AEM 6.1 instance with mongo (Mongo version: 2.6 ) to AEM 6.3 with mongo (Mongo version: 3.2) we are facing the exception. org.apache.jackrabbit.oak.plugins.document....
4
votes
1answer
1k views

mongoDB in micro-services structure

I'm building a game that have micro-services structure using docker. The way i started to build my services is having a mongoDB instance to each service, so having OneToOne service to mongoDB ...
4
votes
1answer
70 views

Should images be separated from posts in MongoDb?

I am working on a project with Meteor.js and I am using CollectionFS with GridFS to easily store images in MongoDb. Now I am not the best with databases and database design, but I heard that in nosql ...
4
votes
1answer
1k views

Drop/Create MongoDB TTL index vs. collMod in production

I'm working with a MongoDB collection containing over 250 million documents that has an existing TTL index and is written to with a pretty high frequency. I'd like to reduce the TTL value for the ...
4
votes
1answer
473 views

What exactly are secondary members acknowledging in replicasets with MongoDB?

I try to understand the mechanics and behavior of MongoDB's replica-features better. I hope to get some insightful information from someone who is familiar with mongo's internals and behaviour. My aim ...
4
votes
1answer
6k views

MongoDB Insufficient free space for journal files

I have installed a standalone mongo 2.6 in amazon ec2. The instance has reach the limit of disk space and it doesnt run now. I have set before the smallfiles=true in mongod.conf file, but for some ...