Questions tagged [mongodb-3.4]

This tag is for MongoDB major version 3.4

Filter by
Sorted by
Tagged with
13
votes
2answers
31k views

How to specify authentication database and target database separately on mongodb connection uri?

I am using this connection uri to connect to mongodb: mongodb://user:password@localhost/admin. It will use admin as bot authentication and target database. How can I make the uri to use admin as ...
8
votes
3answers
8k views

mongorestore Too many open files

When I run mongorestore I get error running create command: 24: Too many open files. I've updated my launchctl limit and ulimit. When I run lanchctl limit I get: cpu unlimited ...
4
votes
3answers
21k 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
4k 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
0answers
1k 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 ...
3
votes
2answers
8k views

MongoDB Maxing CPU Usage

I have a weird one here. We have set up our production MongoDB which was populated by our test one so we had something to work off of. As soon as we started the service we hit instant 100% CPU load ...
3
votes
2answers
11k views

How to set up a user who doesn't have `admin` database access but use it as authentication database?

I want to setup a user in MongoDB. This user will not have admin database access. But it uses admin as authentication database. It will fail to connect the mongoDB by this command mongo --host ...
3
votes
1answer
5k views

MongoDB Shutting down. Signal 15

Using MongoDB in a live server. Everyday in the morning, I find that mongod process is shutdown. The mongodb log is as follows: 2017-11-02T11:19:49.173+0000 I FTDC [initandlisten] Initializing ...
3
votes
2answers
2k views

Bind MongoDB to IPv4, as well as IPv6

Mongo v. 3.4 respective part of config file: #network interfaces net: port: 27017 bindIp: 127.0.0.1,192.168.0.15,2001:db8:0:0:0:0:2:1 (IPs are made up) No matter the format I've used: [2001:...
3
votes
1answer
267 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. ...
3
votes
2answers
5k views

how to set Mongod config set multiple bindIp addresses

I have the following config file: net: bindIp: 127.0.0.1 port: 27017 storage: dbPath: c:\mongoDATA\db journal: enabled: true ##systemLog: ## destination: file ## path: C:\mongoDATA\...
3
votes
0answers
3k 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 ...
2
votes
1answer
5k views

Mongodb Secondary Node not recovering

Secondary node of mongodb cluster has entered in Recovering state and it's not coming out of it. Below is what I see in log. I know one way to fix this issue is to reinitialize secondary node by ...
2
votes
1answer
4k views

MongoDB secondary node does not become primary when other nodes are stopped

I want to cluster MongoDB by using a replica set. I have created a three-node replicaset (rs0,rs1,rs2), and run the DBs in parallel with no issues. But when I shut down any two instance (one primary ...
2
votes
1answer
428 views

Why `distinct` and `count` operations generate `“op”: “command”` in system.profile

According to documentation count and distinct queries should result in op = count and op = distinct in system.profile. However when I tried to run such queries in shell both were generated as op = ...
2
votes
3answers
3k views

MongoDB - Mongorestore is not working as expected

A Very Good Day, I have the user in the mongodb like below who has the superuser privileges (I confirmed the role setting using show users command) { "_id" : "admin.mongoadmin", "user" : "...
2
votes
1answer
4k views

Not authorized on admin to execute command mongoDB: Atlas M0 Free Tier cluster

My MongoDB shell has version v3.6.5 (the same with older versions) & MongoDB server has version: 3.6.8 I have MongoDB M0 Free Tier cluster and I want to use from shell different commands. So, I ...
2
votes
1answer
393 views

MongoDb linearizable read concern restrictions

Could someone explain me some part of Mongodb linearizable read concern documentation: Linearizable read concern guarantees only apply if read operations specify a query filter that uniquely ...
2
votes
2answers
678 views

MongoDB Write Concern when Journaling is off

I'm running mongo 3.4.7 (WiredTiger) replica set with two secondaries. According to the docs, when journaling is enabled and write concern is {w: "majority", j: 0}, the ack is sent after the data is ...
2
votes
1answer
59 views

Is it possible to migrate data from a shard MongoDB to a non-shard MongoDB with dump

Question: I have a shard mongo cluster and I want to migrate data from this cluster to a one node mongo instance. So I want to know is it possible to use dump/restore? I use pymongo and Django ...
2
votes
1answer
3k views

mongodump 3.4.1 error reading collection: Closed explicitly [closed]

[BACKUP COMMAND]: mongodump -u username -p password -d database --port port -o output path. [ISSUE]: error writing data for collection to disk: error reading collection: Closed explicitly. The ...
2
votes
2answers
3k views

MongoDB multiple Cluster data sync

Can we have this type of configuration? 1)MongoDB - Multiple cluster data synchronizing master to master 2)MongoDB - Multiple cluster DR 3)MongoDB - Multiple cluster Blue-green deployment
2
votes
1answer
934 views

Authenticate MongoDB shard cluster in Docker swarm

I am trying to put authentication to the mongo shard cluster which is running in docker swarm. docker-compose.yml file: version: "3.3" services: cfg1-r1: image: mongo:3.4.9 ...
2
votes
1answer
6k views

Recover MongoDB data without WiredTiger.wt file

We have recovered a MongoDB database from filesystem, but the WiredTiger.wt file has changed since then (i.e. the collection has been dropped). So is it possible to read data (documents) from some ....
2
votes
2answers
8k views

service mongod cant start, permission denied mongod.lock when changing dbpath

What i want to do: change dbpath of mongodb from /var/lib/mongodb to /home/user/mongodb/data im using db version v3.4.7 what i've done mkdir -p ~/mongodb/data sudo chown -R mongodb:mongodb /home/...
2
votes
1answer
1k views

Access Control not logging successful logins on MongoDB 3.4 Community

After adjust the verbosity of the parameter "accessControl" with the command: db.setLogLevel(5,"accessControl") The log file still not login successful login. On mongo 3.2: 2017-04-20T15:56:06.661+...
2
votes
1answer
3k views

Why $group is very slow in aggregation and how can faster it in MongoDB [closed]

My query is taking ~3 seconds to execute with the $group stage, How can I faster this? My query is: db.getCollection('employee_data').aggregate([ { $match: //Filter }, { $group: { ...
2
votes
1answer
112 views

Getting exception on running sh.status() command on MongoDB sharded cluster

I am running sh.status() command on my mongos instance of sharded Mongo cluster and I am getting below exception. mongos> sh.status() assert: command failed: { "ok" : 0, "errmsg" : "error ...
2
votes
0answers
247 views

Quickest way to partially restore a mongodb instance from AWS snapshots?

I have multiple large mongodb clusters running mongodb 3.4 configured with wiredtiger. I would like to set up standalone instances with just a few DBs from these clusters, all on the same EC2 instance....
2
votes
1answer
3k 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 -...
2
votes
0answers
739 views

MongoDB + WiredTiger cache usage stuck on 95%

I'm running a mongo 3.4.7 cluster (8 CPU, 120GB ram, primary + 2 secondaries) with ±130 open connections, each one of them to a separate DB with ±50 collections. After a few minutes of running, cache ...
2
votes
1answer
2k views

MongoDB config replica failed connection after a few days running

I have setup a MongoDB shard cluster. It has three shard replicas, each replica has three mongo instances. And it has one replica of 3 mongo config servers. And one mongos. It works fine at the ...
2
votes
1answer
398 views

How to disable ChunkManager logging for MongoDB? mongoconfig.log gets huge

I'm using MongoDB 3.4 for saving other systems logs and mongoconfig.log is getting too much verbosity. It's a sharded clusted, if that helps. I checked the default mongo log verbosity and is set at ...
2
votes
1answer
137 views

Switching from 2 large collections to multiple small ones in MongoDB 3.4

I know this question is similar to other ones. But... Only that we are switching from 2 very large collections (15Gb in size, constantly growing). Basically those 2 large collections keep different ...
2
votes
1answer
1k views

MongoDB cluster setup

I am trying to set up a 3 node MongoDB cluster. 1) Started mongodb in all 3 nodes with the below config file. net: bindIp: 0.0.0.0 port: 10901 setParameter: ...
1
vote
2answers
4k views

WiredTiger internal cache

It is stated in the MongoDB documentation FAQ (https://docs.mongodb.com/manual/faq/storage/#wiredtiger-storage-engine) : Avoid increasing the WiredTiger internal cache size above its default value. ...
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 ...
1
vote
1answer
2k views

How to run mongod from the commandline?

How do you manually run mongod from the commandline, so it outputs all logging directly in your terminal? I'm trying to diagnose a crashing Mongo 3.4.11 database on Ubuntu 16. When I try and start it ...
1
vote
2answers
7k views

mongo crashing due to too many open files

I recently upgraded an Ubuntu 14 server, running mongo 3.4.11, to Ubuntu 16. I re-installed the identical version of mongodb-org from their PPA, but now when I start mongo, it's doesn't respond to ...
1
vote
1answer
1k views

Transferring Mongodb database with rsync while working, is it okay?

I need to transfer MongoDB data from another server with rsync with MongoDB running. Making a dump is not an option for me, as it takes too much time. What problems can I face doing it? Or, if this ...
1
vote
2answers
789 views

Is MongoDB IXSCAN operator a scan or a seek?

It seems to me that the only operators I see in a MongoDB query plan are COLLSCAN or IXSCAN. The indexes being b-tree, I guess MongoDB can do index seek and index scan ? If so, how do we know that a ...
1
vote
1answer
7k views

Replica Set not getting created

I have database which is set up in data folder of mongodb. For accessing this database I usually run the below command mongod --dbpath "C:\program files\mongodb\data" --port 27017 Now I am ...
1
vote
1answer
926 views

Restoring the database dump of a newer version to an older version of mongodb

I find myself having to move a database between hosts but at the moment don't have the option of upgrading or downgrading any of the hosts. I'm trying to find out if it is safe to do the following: ...
1
vote
1answer
2k views

Service mongod fails after adding security.keyFile in config file

My mongo.conf: # where to write logging data. systemLog: destination: file logAppend: true path: /var/log/mongodb/mongod.log # Where and how to store data. storage: dbPath: /var/lib/mongo ...
1
vote
2answers
198 views

How to influence files (pre)allocation steps (max growing value) in MongoDB 3.4 with WiredTiger

We have in environment deployed some really small DBs (5GB) as directory per DB.Under dirs is LVM with XFS, where we have implemented logic for "brake" when DB space should be full-filled (all is due ...
1
vote
1answer
5k views

MongoDB update multiple sub documents inside array, each according to a condition

I have a document like this: { wid: 1, items: [ {nid: 1, sent: 900}, {nid: 2, sent: 12}, {nid: 3, sent: 0}, {nid: 4, sent: 1} ] } Now consider I want to ...
1
vote
1answer
419 views

how to interact to second database through API on mongodb

I am on Windows environment. I am using Mongoose and nodejs for my project. I have MongoDB Replication i.e 27017(primary), 27018(slave)and 27020 is (Arbitar). now I have One more seperate db named as ...
1
vote
1answer
169 views

Could we recover Mongo records from the data files only without namespace files?

I am missing a namespace file from the Mongo db path. I only have data files with number extensions (e.g. report.4,report.5). Is there any way to recover the mongodb dump from the data files?
1
vote
1answer
3k views

How to find sources of connections to Mongodb?

In the Mongodb, I can see there are 54 connections from different applications in my local server. Is there anyway to see which one of my applications are using Mongodb more than the others? Imagine I ...
1
vote
1answer
128 views

How to read Mongodb entries in plaintext? [duplicate]

I'm testing mongodb on a local machine for the first time, and I just want to see the actual plaintext contents of a database entry. Started the mongo console: $ mongo Set dbs: > use <my dbs ...