9

It is just informing that mongod has chosen to use the _id index. More specifically: IDHACK means that normal query plan path (evaluation, caching, re-evaluation) was bypassed for the query shape {_id: <value>} which is supported by the required _id index. This is a performance optimization for the common use case of fetching a document by primary ...


6

Ok, I found out why. Apparently I was querying against the admin database. Always run use <db> guys


4

These files are used when the sort you are attempting in an aggregation exceeds the maximum allowed memory and you have allowDiskUse : true specified. The relevant pieces of the code are here (where the SortedFileWriter is called) and here (where the extsorter.# files are written to temp by SortedFileWriter). Basically, this is the number of files required ...


4

What are maintenance mode tasks? The "maintenance mode tasks" message is referring to a counter of successive calls to the replSetMaintenance command and (as at MongoDB 3.4) isn't associated with specific queued tasks. The replSetMaintenance command is used to keep a secondary in RECOVERING state while some maintenance work is done. A RECOVERING member ...


3

Most likely you are using a different shell version than the db version. That is, the output of db.version() (the server version) and version() (the shell version) should be the same. For example: mongos> db.version() 3.4.1 mongos> version() 2.6.12 mongos> config = db.getSiblingDB('config') config mongos> config.shards.updateOne({_id:'shard01'},...


3

I think the problem you have is that the archive format created with --archive is not a tarball (and the docs don't say it is anywhere that I could find). Rather it is a custom packaging format which you can see the details of here. Based on a quick scan of the code, it looks like a lightweight format containing a series of headers, metadata which describes ...


3

The nice part about MongoDB is that it is open source, so your answer is in the code, starting with comments about UnusedLockCleaner: Periodically purges unused lock buckets. The first time the lock is used again after cleanup it needs to be allocated, and similarly, every first use by a client for an intent mode may need to create a partitioned ...


3

As at MongoDB 3.2, this is expected behaviour for foreground index builds: By default, creating an index blocks all other operations on a database. When building an index on a collection, the database that holds the collection is unavailable for read or write operations until the index build completes. Any operation that requires a read or write lock on ...


3

What's the differences between those restore points? I guess Snapshot is fast restore, because only copy already existing files to destination. But it takes compute and storage resources the generate every 6 hours a snapshot and it will be stored only for 3 days. A snapshot is a full backup of your data captured at a specific interval. Restoring from a ...


3

Final solution: We went with option #2 - turning off MongoDB and manually copying the database files over to the new server. It worked like a charm. For future database migrations and changes, I will probably be making a replica set as suggested by @SqlWorldWide and @Markus. That looks like it would definitely the best solution for someone who has time to ...


3

sudo service mongo stop [This didn't work] As MongoDB BOL mongo is an interactive JavaScript shell interface to MongoDB, which provides a powerful interface for systems administrators as well as a way for developers to test queries and operations directly with the database. mongo also provides a fully functional JavaScript environment for use with a ...


3

This is by design. If you want to run with only one node, restart that node without replica set switch. If a majority of the replica set is inaccessible or unavailable to the current primary, the primary will step down and become a secondary. The replica set cannot accept writes after this occurs, but remaining members can continue to serve read ...


3

As per MongoDB BOL here The maximum BSON document size is 16 megabytes. The maximum document size helps ensure that a single document cannot use excessive amount of RAM or, during transmission, excessive amount of bandwidth. To store documents larger than the maximum size, MongoDB provides the GridFS API. GridFS is a specification for storing and ...


2

You'll need to rethink your shard key approach. As at MongoDB 3.2: All fields in a compound shard key must be present in all documents and will be immutable (i.e. the shard key for an existing document cannot be changed). A hashed shard key is based on a single field, and does not support range queries. It generally makes sense to have a shard key that ...


2

As at MongoDB 3.2, there is no option for the Windows MSI to only install the mongodump.exe and mongorestore.exe command line tools so a default install is the most straightforward option. Are there mongodump and mongorestore standalone tools that one could use for this or is it best to install the entire MongoDB package on our build server (which feels ...


2

A variety of things I would try: Polygons are using floats, is it possible x/y tiles are wrong for some points due to rounding errors inherent in that datatype (though I don't see why this wouldn't be idempotent). Runs of holes seem to follow lats rather than lons so this points more to something code related rather than db related (would expect any db ...


2

2016-08-05T15:29:36.935+0200 I COMMAND [conn39339] killcursors: found 0 of 1 As per the info you've found, this is a normal (and benign) message: no administrative action is required. This message may be logged when a client/driver issues the killcursors command (for example, when an operation reaches a cursor timeout or an active cursor is explicitly ...


2

It's hard to say without seeing all the logs, but I suspect you are seeing changes to your primary. The primary is listed in the log messages as primary: mongodb01 and it is (at the time syncing from mongodb03). It's the kind of thing I would expect to see if you were stepping down the primary (mongodb03), then locking it (or similar) that causes it to fall ...


2

Background indexes have their own issues as well. If you are running a replica set I would recommend to do a "rolling" build Take a secondary out of the replica set Build the index Bring the secondary back into the replica set and wait for it to sync up. I have found this to be the safest option to build large indexes in production. Before you start this ...


2

There is no prescribed need to run db.collection.validate(true) on a regular basis for a healthy MongoDB deployment. Validation with the true or {full:true} parameter can be resource intensive, as this iterates through the collection's data & index structures. The validate(full) command is typically only used as a diagnostic aid in the event of ...


2

The bsondump utility converts BSON data (which is binary) into human-readable formats. Common usage would be bsondump --pretty to inspect data formatted as MongoDB Extended JSON. This can be useful for previewing data contained in BSON files as created by mongodump, replica set rollbacks, and other features (eg. auditing in MongoDB Enterprise as per your ...


2

Since nobody could find a valid reason for this issue, I opened yesterday a mongodb bug report: https://jira.mongodb.org/browse/SERVER-29326 Mongodb engineers confirmed that's a bug. Unfortunately it's not mentioned in mongodb's documentation which would have saved us many hours tracing down the issue and deploy another schema design from the beginning.


2

Because in at normal situation all traffic (read, write) goes to the primary node, it is the busiest node at replica set. Secondaries just replicate changes (update, insert, delete) and not responding to client queries. But check your I/O. iostat -mx 1 what are %iowait, %util. iotop program shows how much you actually read and write to disk. Do you know how ...


2

As your service mongodb status tells, your mongod process don't exists. So, if you try to connect (with mongo -program) to your mongod, you cannot. So, restart your mongod sudo service mongodb restart, try now to connect it mongo. If you want to see what happens when you shutdown, start following mongodb.log tail -f /var/log/mongodb/mongodb.log and then ...


2

I also ran into same issue. But was able to resolve by completely removing mongo first sudo apt-get purge mongodb-org* Then performing following sudo apt update sudo apt install -y mongodb sudo systemctl status mongodb You can refer to following link for the same: https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-18-04


2

This question is for Linux, but for fellow windows users who found their way here and want a windows solution... the problem is your Mongodb service is stopped. So do the following steps: 1) cntrl-alt-del and open your task manager 2) click on 'services' 3) scroll down to MongoDB 4) right click and hit 'start' (or 'restart') go back to ...


2

The reason why it didn't change anything is that your config have "protocolVersion" : NumberLong(1) and this heartbeatTimeoutSecs applies only when protocolVersion is zero (0). You should use settings.electionTimeoutMillis wich description you can find here.


1

Without knowing more about your database and its usage, I can't say for sure, but in general, the high number of open files found in most busy MongoDB instances is caused by connections (one open file per connection) rather than the data files themselves. What does MMS have to say about your concurrent connection count? You need to have huge number of ...


1

Try the following: db.etudiants.aggregate([ { $unwind: '$cours_reussis' }, { $match: { 'cours_reussis.note': { $gt: 60 }, 'cours_reussis.nom_ecole': "ENSA" } }, { $group: { '_id': { 'nom': '$nom', 'prenom': '$prenom', }, 'num_courses' : { "$sum" : 1 } } }, {...


1

When you add a new shard using sh.addShard(...) you are providing a seed list of members which will be used to discover the current replica set configuration. You can specify as few as one member of the replica set or as many as all, and you do not need to specifically include the arbiter. FYI, the sh.addshard() mongoshell helper wraps the underlying ...


Only top voted, non community-wiki answers of a minimum length are eligible