Questions tagged [mongodb-3.4]

This tag is for MongoDB major version 3.4

Filter by
Sorted by
Tagged with
9
votes
2answers
17k 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 ...
4
votes
2answers
12k 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
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
0answers
885 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
3answers
4k 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 ...
3
votes
1answer
5k 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
7k 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
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
130 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
0answers
2k 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
2k 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
393 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
1answer
1k 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
290 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
487 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
2k 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
1answer
4k 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
1answer
852 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
50 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
187 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
2answers
4k 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\...
2
votes
1answer
3k 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 ...
2
votes
1answer
1k 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
1answer
279 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
952 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
1answer
3k 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 ...
1
vote
2answers
538 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" : "...
1
vote
2answers
2k 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
409 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
542 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
2answers
94 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
2k 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
2answers
2k 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
1
vote
1answer
279 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
3k 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
4k 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/...
1
vote
1answer
5k 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
2answers
3k 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
1answer
100 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 ...
1
vote
1answer
254 views

change journalCompressor to none - not default snappy

Quote from ObjectRocket Support Hi, Fyodor! The journalCompressor setting is specifically related to the journal files. Journals are typically not compressed because compressing them causes ...
1
vote
0answers
29 views

Does restarting Mongodb config servers restart the mongos?

Our environment is a 2 node Shard of 5 node replica set with a 3 node replica set config servers and 6 mongos. We happened to change the hostname(short to FQDN) of 1 of the config server and we ...
1
vote
0answers
47 views

MongoDB Fails due to permission error even though its setup

Attempting to start my MongoDB server using service mongod start fails for the reason: exception in initAndListen: IllegalOperation: Attempted to create a lock file on a read-only directory: /var/lib/...
1
vote
1answer
48 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: { ...
1
vote
0answers
31 views

MongoDB ticket availability reaching zero

I recently came across intresting issue. I have a sharded cluster which has two replication sets with 2 secondaries. On my primaries, there were 300-400 connections at a point in time, shortly after ...
1
vote
0answers
48 views

One of the mongo shards consuming too much disk space.

We have mongo cluster with 10 shards of each having 3 replicas. Recently we are facing an issue, exceptionally in a couple of shards, the disk space among all the 3 replicas has reached above 90%. ...
1
vote
1answer
85 views

Mongodb ReplicaSet Changing Config Format

I have a 3 node mongodb replica set which uses the old syntax (non-Yaml) syntax that I am trying to change to use the new Yaml syntax old syntax auth = true bind_ip = 0.0.0.0 dbpath = /var/lib/...
1
vote
0answers
103 views

timeout while dropping database - MongoDB

Getting time out issue while dropping database from mongoDB. Database size is around 200GB. {          "code" : 46,          "ok" : 0,          "errmsg" : "timed out waiting for DBNAME....
1
vote
1answer
24 views

Why MongoDB not running SSL?

I need to run MongoDB with SSL, the version that is currently installed is 3.4.16 without SSL. Can I download 3.4.16 with SSL and just stop the service copy the Bin files across and then start up the ...
1
vote
0answers
184 views

MongoDB write locks on insert

Why would an insert into a MongoDB 3.4 collection require global write locks? I'm creating a copy of a large collection in a new replica set (via mongodump/restore) and I'm finding that some inserts ...