Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
542 views

replica set unable to add a node

I am trying to create a replica set. I had create a primary node then I am trying to add a secondary node but it gives an error message Quorum check failed because not enough voting nodes responde ...
0 votes
2 answers
2k views

Create user for all databases in MongoDB

How can I create a user and grant it read-only access for all databases available in MongoDB (2.2/2.4/2.6) instance? I am new to MongoDB, please provide the detailed, step-by-step process.
0 votes
1 answer
218 views

MongoDB Tag-Aware Sharding Workflow

I wonder the work flow of sharding cluster in Tag-Aware Sharding. --- Sharding Status --- sharding version: { "_id" : 1, "version" : 3, "minCompatibleVersion" : 3, "currentVersion" ...
-1 votes
0 answers
8 views

[MongoDB]When can a rollback occur in relation to read concern?

I read the following phrase in the mongodb manual. The query returns data from the instance with no guarantee that the data has been written to a majority of the replica set members (i.e. may be ...
2 votes
1 answer
628 views

MongoDB Ops Manager backup and restore

The documentation claims that snapshots taken by ops manager are delta (differential) between successive snapshots. How do you then restore? I mean if you are able to delete some snapshots according ...
1 vote
2 answers
2k views

mongodump command with timestamp query

When I execute the below query in mongodb shell, it gives me the number of records updated after the mentioned timestamp. db.getCollection('oplog.rs').find({"ts":{"$gt":Timestamp(1582823397,2)}}) I ...
1 vote
1 answer
463 views

MongoDB 3.2.10 Index rebuilding did not complete: 11000 E11000 duplicate key error collection

MongoDB 3.2.10 Getting the following error when adding a replica set as WiredTiger. This is sharded cluster ( 3 shards nodes ). 2 Shards replica sets created using wiredTiger storage so only 1 shard ...
0 votes
1 answer
711 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
199 views

MongoDB - count current read/write operations

is it possible to count the current read or write operations on a mongodb replica set? (including all databases not just a single database) Thank you! Best regards
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
410 views

MongoDB - The connection is not disconnected for a long time

I am building a system that outputs information such as visit information and page transition of the user who visited the website to MongoDB, The MongoDB connection pool of the server of the web site ...
0 votes
1 answer
121 views

Mongodb tree structure questions and answers

I'm looking to build a question answer survey system where some questions will be based on the answer of the parent question. The hierarchy level of the questions can go any number of depth based on ...
0 votes
1 answer
277 views

unable to add a range to a tag using sh.addTagRange command

Have setup a 4 node test shard cluster: 1- mongos 1- config server 2- shard nodes hosting 1 shard each for a collection. Cluster is working perfectly, but when trying to run the following command: ...
0 votes
2 answers
619 views

Can I restrict user's access on a certain IP?

Like in a certain way in MySQL. CREATE 'dbuser'@'10.1.0.1' identitifed by 'password'; GRANT USAGE on *.* to 'dbuser'@'10.1.0.1'; We are not using any mongodb tools except for Robo
0 votes
1 answer
21 views

Can we use a mongodb 4.3.3 and mongodb 2.6.5 in same replica set?

we are running a mongo 2.6.5, 5 member replica set on CentOS and are looking to upgrade to 4.3.3. We do not use sharding. The tricky part for us is that we operate a service and can't have scheduled ...
0 votes
1 answer
396 views

how to add shard into current cluster without sharing any chunks

my current cluster sh.status() is as below: shards: { "_id" : "rsDev", "host" : "rsDev/10.60.90.224:27003,10.60.90.224:27004" } { "_id" : "rsRaw", "host" : "rsRaw/10.60.90.224:27001,10....
0 votes
0 answers
54 views

MongoDB Index Restore Failure Since I Upgraded from 4.2 to 4.4

Steps to reproduce After upgrading from 4.2 to 4.4, take backup using mongodump Now restore backup On some collections, I am getting following {"alternate":"non-ignorable", "...
0 votes
1 answer
244 views

Fastest way to sync (or keep import) 3.5TB data from hadoop to sharded mongodb cluster

There are 3.5TB data in our hadoop cluster(yes on hdfs). And we have newly built a sharded mongodb cluster(the latest 3.x) with 3 mongos, 3 configdb and 3 shards(each shard has 1 primary and 2 ...
3 votes
1 answer
4k views

MongoDB crashes with out-of-memory or is being killed by oom-killer

A two shards MongoDB database regularly crashes with out-of-memory error or is being killed by the oom-killer. The system runs on GCE Debian 9.4 with MongoDB v3.6.5, WiredTiger storage engine and ...
0 votes
1 answer
26 views

How to replicate between On-Premises and Azure in Mongodb

I have three 3 node cluster on-premises ( 1 Primary and 2 Secondary ). I have same 3 node cluster in AZURE ( 1 Primary and 2 Secondary ) with same version and data but with different FQDN in azure. ...
2 votes
1 answer
635 views

Fastest way to move Collection from Sharded MongoDB Cluster to a another Sharded MongoDB Cluster

I have to move a MongoDB Collection (Size: 1TB+) from Sharded MongoDB Cluster to another[5 shards on both clusters]. During this operation, it is assumed that the accompanying program will be offline, ...
4 votes
1 answer
744 views

Why does restarting MongoDB 3.0.x boost performance?

I have a MongoDB in my Development environment running on Windows, the server has 64GB of RAM, but MongoDB has only consumed 26.9GB (here we are building the database), so it should be able to hold ...
0 votes
2 answers
2k views

How to speed up MongoDB chunk moving between shards

On a MongoDB 3.6 in a replica set and WiredTiger engine we have a large collection with 7.7TB of data. We started to see severe performance issues (extreme CPU usage and slowdown of data replication) ...
0 votes
1 answer
47 views

Choosing the right database for stock price history

The model is [(stock_id, period, ts), open, high, low, close, last, volume] We write new prices for all stocks (120,000) each minute and delete old once when they go out of retention time. It doesn't ...
1 vote
2 answers
2k views

Copy Specific Columns from DB 1 To DB 2 on MongoDB

I have Two Instance of Node JS server which is handled By NGINX. First server is connect with MongoDB First Server i.e mongoose.connect('mongodb://127.0.0.1/db_primary', { useMongoClient: true }); ...
1 vote
1 answer
144 views

mongodb: Can I create an unshard Replica set for a sharded cluster?

I have a 3 node shard cluster mongoDB with replica set, and want to add (single node replica set) a un-sharded Replica set to collect all data in one node. Can I create an unshard Replica set for a ...
2 votes
1 answer
957 views

How to replicate a mongodb pod with its persistent storage (Minikube - Kubernetes)

I made these settings : apiVersion: v1 kind: PersistentVolumeClaim metadata: labels: name: mongo-claim0 name: mongo-claim0 namespace: my-app spec: ...
0 votes
1 answer
5k views

mongod.service: Failed with result 'exit-code'

I'm trying to run mongodb server : sudo systemctl start mongod this gives me no error, but when I try to check the status, I get error saying : mua@mua  ~  sudo systemctl status mongod ...
0 votes
1 answer
657 views

Mongodb 3.6.3 disappears after 2 weeks on centos 7 ec2 instance

My Mongodb has disappeared 2 times, after 2 weeks, over the weekend within a 4 week time period. I had a snapshot to recover from but I can't keep on recovering my db every 2 weeks. In an ec2 ...
1 vote
1 answer
3k views

How to restore Mongo DB tar.gz archive

Using the Mongo DB Atlas cloud service (MongoDB Version: 3.4.16), the below backup archive of a MongDB was generated: Cluster0-shard-0-1531635127-5b4b0df33b34b92b0f50a045.tar.gz In this file I can ...
1 vote
2 answers
3k views

Why mongodb never end some connection

My mongod runs out of connections from time to time. But when I restart the instance, it becomes normal. I check the log and found some connections were created and never be ended. This cause the ...
0 votes
1 answer
141 views

How to parse MongoDB int32 in node.js

I am using MongoDB for a discord bot I am working on, and I want to retrieve a user's balance. My current code is function findBalance(id){ MongoClient.connect(url, function(err, db) { if (err) throw ...
6 votes
1 answer
1k views

What kind of database to store Quotes

I'm designing a very simple application to send positive text messages to subscribers at a certain frequency. These are just famous, motivational, encouraging and positive quotes. When I first thought ...
0 votes
1 answer
625 views

Invalid access at address: 0 for Mongo v4.0.5

I am running mongo on kubernettes in statefulsets. It was working fine for weeks then all of a sudden this morning i started getting errors where mongodb was failing. I tried running: mongod --...
0 votes
1 answer
743 views

How to update collections and restore while doing mongorestore?

is there any way that i can update the collection and restore the same from dump created by mongodump cmd . when we do mongorestore , it directly restores from the dump , but my requireemnet is to ...
0 votes
1 answer
440 views

Slow performance of query with $and & $or operators

My query with $and, $or operators is performing poorly. Even though I've built a compound index on all three fields that are specified in my query criteria, the query does a complete collection scan. ...
2 votes
1 answer
225 views

Efficient way to store geographical routes in MongoDB

I need to store a taxi route into MongoDB, however I'm not sure what is the best way to do this. Since the route is only needed for the taxi order, the first idea I had is to store it in the order, ...
1 vote
1 answer
879 views

Connection string for connecting mongo database with SSL enabled

Am facing some below problem in my mongodb replication environment I have 3 replica set environment with SSL enabled and ssl mode as preferSSL 3 servers has 3 different Key file with common CA file ...
0 votes
1 answer
595 views

MongoDB convert standalone mongod to sharded replica set cluster

I have a single replica set having 3 mongod instance, collection in this instance has data already. I want to convert this instance to sharded cluster. I followed Convert a Replica Set to a Sharded ...
0 votes
1 answer
137 views

Is ObjectId as shard key unique across shards or just within a shard?

In my sharded cluster of version 4.2, one collections is sharded on _id where _id is just a default ObjectId. I'm seeing multiple documents with same _id on different shards' primaries. When I specify ...
2 votes
1 answer
2k views

MongoDB: Mongoimport server selection error , connection refused, too many files open

Trying to insert several JSON files to MongoDB collections using shell script as following, #!/bin/bash NUM=50000 for ((i=o;i<NUM;i++)) do mongoimport --host localhost --port 27018 -u 'admin' -...
3 votes
3 answers
6k views

Getting empty folder when using mongodump to back up my MongoDB

Basically, I have a problem with using mongodump to back up my MongoDB. This is the general syntax I use in SSH: mongodump -d myDatabaseName -o ~/backups/my_backup This is the resulting message: ...
1 vote
2 answers
575 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
1 answer
553 views

NoSQL- automatically cache and update references to other documents as embedded

To avoid having to look up referenced documents, one practice is to embed them (e.g. https://docs.mongodb.com/manual/tutorial/model-embedded-one-to-many-relationships-between-documents/). Is there ...
1 vote
1 answer
329 views

MongoDB instance for production

I am seeking advice before releasing my mongodb server into production from deployment mode. Just to point out the server is working fine on development mode. Scenario: Let's say I have two server ...
0 votes
0 answers
32 views

Restore Mongo DB backup

I have mongodb backup files as in.wt and.bson and some wieldtrigger files. I have installed mongodb on a new server and copied backed up files to /var/lib/mongo folder and restarted the mongodb ...
0 votes
0 answers
17 views

what causes sudded increase in size of WiredTigerHS.wt in mongodb5.0

I have mongodb 5.0.8 on linux We run multiple clusters but I see that on one cluster , with 3 shards there is a simultaneous increase on all shard servers in WiredTigerHS.wt file at times in my ...
2 votes
1 answer
554 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 ...
1 vote
2 answers
3k views

Issue while restarting - MongoDB

I had tried to start the MongoDB service using the following command in linux machine. service mongod restart I am getting the following error Stopping mongod: ...
2 votes
2 answers
14k views

Is it possible to delete cache in Mongo?

My case is that I run several queries in Mongo and measure the response time. I know that Mongo uses Memory Mapped files and cache some data in RAM. If I create an index and run a query the execution ...

1
2 3 4 5
47