Questions tagged [mongodb-3.4]
This tag is for MongoDB major version 3.4
127
questions
0
votes
0
answers
198
views
MongoDB 'not authorized on DATABASE to execute command' when not using MongoDBCompass
I'm trying to access data from a MongoDB which the database administrator has given me limited access to. The db admin has allowed me to access a specific document and collection within the db. For ...
0
votes
0
answers
454
views
MongoDB - Grant permission over one collection that exists on all databases
I have several databases on my MongoDB, all of them have or will have a collection called _schema. Currently, I'm granting permissions like this:
db.grantRolesToUser("userA",[
{"role&...
0
votes
1
answer
917
views
MongoDB: F CONTROL [main] Failed global initialization: FileNotOpen: Failed to open "/data1/mongodb/log/mongod.log"
I am trying to install mongodb 3.4 on Redhat 7.9. When I start mongodb systemctl start mongod I get the below error FileNotOpen: Failed to open "/data1/mongodb/log/mongod.log, But when I start ...
0
votes
1
answer
3k
views
mongodump failing with invalid json input [closed]
mongodump failing with invalid json input
mongod --version
db version v3.4.1
git version: 5e103c4f5583e2566a45d740225dc250baacfbd7
OpenSSL version: OpenSSL 1.0.2n 7 Dec 2017
allocator: tcmalloc
...
1
vote
1
answer
3k
views
Save output of a Mongo Command to a Variable bash script
I have been writing a script to find and kill slow mongodb queries, how can I store output of db.currentOp() in a variable?
current I am using this but failing
#! /bin/bash
out=""
mongo <...
0
votes
1
answer
1k
views
MongoDB Aggregate Poor Index Usage
I've been trying to understand the MongoDB Aggregate process so I can better optimize my queries and I'm confused by usage and $match and $sort together.
Sample DB has only one collection people
[{
...
1
vote
1
answer
4k
views
how to run db.adminCommand() using pymongo for mongodb 3.6
I want to run this command and get it's output using pymongo module.
db.adminCommand({getParameter: 1, logLevel: 1})
or say I want to run this command
db.adminCommand( { setParameter: 1, ...
0
votes
1
answer
29
views
how to setup mongodb replica on cloud server?
I want to setup mongodb repicaset on my cloud server(AWS ec2) but I have only one IP address.
Currently I have make /etc/hosts two entries 127.0.0.1 dbnode1 and xx.xx.xx.xx dbnode2 but when I try to ...
0
votes
0
answers
593
views
MongoDB - Update all documents NOT returned in aggregate query
I'm using PyMongo to write a Mongo update script. I have an aggregate query which returns a sum of all searches performed by each user in the last 30 days:
cursor = mongo_search_logs_collection....
0
votes
0
answers
306
views
MongoDB works only on user is assigned to admin database
I am using mongo db with authentication and it is working as expected when I map the user to the admin database like below,
use admin;
db.getUsers();
{
"_id" : "admin.test1",
...
0
votes
1
answer
1k
views
How to use mongoexport command with ssl?
I am trying to export collection data from (SSL MongoDB 4.x), for this I am running below command on linux terminal.
Earlier I used mongoexport command in Linux terminal without SSL which works ...
0
votes
1
answer
1k
views
Mongo E11000 duplicate key error collection after mongo 3.4 to 3.6 upgrade
I have a Mongo replica set on Ubuntu with three members configured for my information system and am having issues when I try to upgrade MongoDB from version 3.4 to 3.6
After setting the "...
0
votes
1
answer
146
views
502 error after restarting mongo db in remote server using fork command
I was trying to upgrade mongo 3.4.20 to 4.0.14 , but it lead to the system crash, so i tried reverting it back to 3.4.20. But after doing db restart using fork , there 502 error. Please help.I tried ...
2
votes
1
answer
769
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 ...
0
votes
1
answer
489
views
Why is it necessary to run both mongod and mongo.exe in windows? What's happening behind the scene?
Why is it necessary to run both mongod and mongo.exe in windows? What's happening behind the scene?
What's the difference between these two?
1
vote
0
answers
209
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 ...
2
votes
0
answers
812
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/...
4
votes
1
answer
10k
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
2
answers
454
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 ...
0
votes
0
answers
3k
views
MongoDB Indexes [getting deleted automatically] | Missing
This problem might look strange. Please bear with me :)
It's an application(NodeJS - MongoDB) helping with storing and viewing of LoRa Packets.
Background:
It's a CentOS 7 on Azure Instance.
...
0
votes
1
answer
88
views
Mongodb creating historical cluster replicaset
I've a use case which I'm trying to implement.. There is a replicaset(3 nodes) which is primary production cluster, I want to set up a historical cluster another replicaset(3 nodes) which replicates ...
2
votes
3
answers
12k
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
0
answers
749
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 ...
0
votes
0
answers
193
views
Mongo Collection Mysteriously unavailable
We are running a mongo on single EC2 instance, we were not able to connect to it , upon debugging we saw CPU usage was spiking , this was the problem we faced previously we then restarted the instance ...
1
vote
0
answers
70
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%.
...
3
votes
1
answer
814
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.
...
2
votes
1
answer
222
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
1
answer
512
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/...
3
votes
1
answer
9k
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 ...
1
vote
0
answers
350
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
1
answer
7k
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 ...
0
votes
1
answer
2k
views
mongodb setFeatureCompatibilityVersion command not found
I'm trying to upgrade my mongodb from 3.2 to 3.4 and I try to set the compatibility version by:
db.adminCommand( { setFeatureCompatibilityVersion: "3.2" } )
But it says
{
"ok" : 0,
...
0
votes
1
answer
343
views
MongoDB secondaries become unresponsive during replication
We got 3 Servers running. One Primary, two as secondaries. Primary has 4 vcpus, 16 GB memory, both secondaries have 8 vcpus, 64 GB memory.
Every night, we run a full sync with several large ...
1
vote
1
answer
34
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
0
answers
466
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 ...
1
vote
0
answers
375
views
MongoDb cleanupOrphaned() running for days
My cleanup orphans on a collection is running for 3 days now. Log shows a few million records being deleted once in a while. However, most of the time nothing is deleted.
I SHARDING [conn3919] ...
1
vote
0
answers
95
views
MongoDB 3.4 - Add nodes to Replica Set when only one is available
I originally had a Replica Set comprised of three nodes on different servers. As part of a contingency plan, I tested how long it would take to hot-swap from using a replica set to only using one node,...
0
votes
1
answer
1k
views
Authentication failed on secondary mongodb
I have primary mongodb v3.4.10 on ubuntu (bare metal) with these users:
{
"_id" : "admin.root",
"user" : "root",
"db" : "admin",
"roles" : [
{
"role" : "root",
...
2
votes
1
answer
5k
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 ...
4
votes
2
answers
5k
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
0
votes
1
answer
3k
views
mongodb set feature compatibility to 3.4 fail
I want to enable the features of my Mongodb 3.4 after upgrading. I have sharded cluster enviroment And after I ran the commands:
use admin
db.adminCommand ({setFeatureCompatibilityVersion: "3.4"})
...
1
vote
2
answers
681
views
How to change default mongo port on a bitnami instance
I am running a bitnami instance of mongodb for our pre-production. The default port for mongo is 27017. But for security reasons i want to change it but it is not possible.
I have tried these things:
...
1
vote
2
answers
5k
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 ...
0
votes
2
answers
1k
views
How to find a query that is use deprecated option?
Mongodb writes logs
2018-04-05T11:38:28.178+0000 W COMMAND [conn107] Use of the aggregate
command without the 'cursor' option is deprecated. See
http://dochub.mongodb.org/core/aggregate-...
1
vote
1
answer
491
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 ...
0
votes
1
answer
59
views
Embedding JSON in a string
Wondering if I could get some insight on a design I saw recently. A collection can contain a few or tens of thousands of documents.
Each document has the same structure of _id and JSONValue. The ...
0
votes
2
answers
8k
views
How to install specific mongo version from the PPA?
Once you've setup the offical mongo PPA, Mongo's docs say that to install a specific version on Ubuntu, to run something like:
sudo apt-get install -y mongodb-org=3.6.2
I'd like to install version 3....
1
vote
1
answer
3k
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 ...
3
votes
2
answers
18k
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 ...
0
votes
1
answer
2k
views
MongoDB 3.4 Server not starting with bind error following a CentOS 7.4 security update
MongoDB 3.4 server is failing to start following a CentOS security update and reboot.
No configuration changes made. The previous update and reboot a couple of days earlier did not cause any ...