Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
242 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 ...
0
votes
0answers
20 views

Can the Atlas search filter in MongoDB cloud be used to query between dates?

All the examples I read online seem to refer to using the compass or the command line, not MongoDB cloud. I try emulate the same query code in the search filter but not having any luck. For example ...
1
vote
1answer
1k views

How indexing on a date field that is constantly updated and or omitted affect performance?

In MongoDB, I have a collection with a date field called last_updated I would like to index. Reason being, I am often querying on a date range of that field in addition to sorting by that field and ...
3
votes
2answers
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 ...
1
vote
1answer
112 views

MongoDB replicate data item across multiple shards

Is it possible to replicate a data item across multiple shards? My end goal is to determine how up-to-date the data in a replica slave is. I'm only concerned with subsets of the data, so I don't ...
2
votes
1answer
4k 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 -...
1
vote
1answer
143 views

Import indexes from MongoDB v2.4 to MonDB v3.6.4

I have migrated the collection.bson file from MongoDB 2.4 to MongoDB 3.6.4 as collection.json. But their is 1 more file collection.metadata.json in MongoDB 2.4. How can I import this to MongoDB 3....
3
votes
1answer
4k views

Speeding up MongoBD query { $ne: [] }

I'm currently doing a MongoDB aggregation but then have a query looking for all documents where a certain field, whose value is an array, is empty. obs = db.collection.count({'things.titles': {'$ne':...
0
votes
1answer
111 views

MongoDb: sharded replica set: data distribution

How does the data get distributed among the shards? How to backup and restore an infrastructure with 2 shards (3 config servers and 1 mongos) When should I choose MongoDb Shard with Replica Set vs ...
0
votes
1answer
205 views

What is mongodb logging as a COMMAND?

Relating to mongodb's documentation, database commands such as count will be logged as component COMMAND. However neither db.count() nor db.runCommand({count:'mycollection'}) produces a COMMAND log ...
0
votes
1answer
172 views

mongos is not listen when configured for sharded architecture (version 3.4)

Deal all, I am trying to mount a sharded mongodb server. I configured a replica set, and a configure replicat set. Both replicate are composd from 3 servers root 23792 1 0 14:43 ? 00:...
0
votes
1answer
93 views

Unable to add replica set to shard

I was trying to add a new replica set to my mongodb sharded cluster but I keep getting the following error: { "ok" : 0, "errmsg" : "Could not verify that config servers were active and ...
0
votes
1answer
148 views

ADD new node Replication in MongoDB

Here i found some trouble. and i don't known why! Now I have one replication with 3 members (1 of primary, 2 of secondary), And i want to add another one (secondary) to sync the data. the data has ...
1
vote
1answer
220 views

MongoDB Shard distribution issue

I am facing an issue in the shard distribution. MongoDB Version: 3.0.15 I have a collection that is sharded. I have two shards. Output of db.getCollection('event').stats() { "sharded" : true, "...
0
votes
1answer
38 views

Even with 90000 NOFILE mongo crashes with Too many open files in system

we suddenly got MongoDB servers crashing on docker container mongo:4.4 with this error: couldn't open [/proc/1/stat] Too many open files in system","file":"src/mongo/util/...
0
votes
1answer
125 views

Unable to perform queries through mongos

I have setup a minimal replicated configuration with mongodb 3.6.3,it seems to be everything fine but when I connect to the mongos (which as far as I understand acts like a kind of load balancer in ...
2
votes
1answer
154 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 ...
0
votes
1answer
41 views

How do I import the _id index from a MongoDB collection as a hash index for a PostgreSQL table (from a CSV export from MongoDB)?

I want to be able to keep track of the _id index values that get the MongoDB collection uses when I export the MongoDB collection (via CSV) and import the data into a PostgreSQL DB table (basically ...
0
votes
1answer
827 views

MongoDB Replica Set Sync data by Copying Data Files from Another Member

I used MongoDB 3.6 and was following MongoDB documentation: https://docs.mongodb.com/manual/tutorial/resync-replica-set-member to do a full copy of data from Primary node to another mongod instance....
0
votes
2answers
245 views

Can MongoDB manage balancing between the Mongos Dynamically using TCP Balancer

If I have a business where I maintain 10 applications and I need to divide the request load of these 10 applications between 3 Mongos Dynamically. Like the TCP Loadbalancer need to connect to MongoDB ...
0
votes
2answers
90 views

How to install MongoDB database as a service in ESxi?

I want to know is it possible to install mongodb directly to the ESXi without guest OS? Please tell me how to setup Data storage as a service environment inside ESXi.
0
votes
2answers
370 views

Mongodb chunksize issue

I have a collection which have size : 60 GB I want to shard this collection. Shard key is hash index and unique. I followed this document https://docs.mongodb.com/manual/reference/limits/#Sharding-...
2
votes
1answer
99 views

From RDBMSs to MongoDB [closed]

I've worked exclusively with RDBMSs for the past 10 years and am trying to explore something new to me like MongoDB. I’m trying to learn about data model design in this environment and because ...
0
votes
1answer
209 views

Mongo slow startup after upgrade to 4.2.5

I have upgraded the MongoDB replica set, which consists of 3 members, from 4.0.11 to 4.2.5. After upgrading, startup lasts about 5 minutes. Before upgrading it was instant. It is related to ...
2
votes
2answers
129 views

Should I put users in admin DB or in the DB that they should have access to [closed]

What would the pros / cons be of putting users that should have access to one database in the admin database instead of the database that they should have access to? Background: I'm a C# developer. ...
0
votes
1answer
105 views

The reading with secondaryPreferred when chunk migration occurred often fail

We have some problems regarding balancer configuration. Our application which is set up with secondaryPreferred often fails to read documents from the secondary when balancer( chunk migration ) is ...
0
votes
1answer
255 views

Error Message while executing command in Arbiter for log rotation

While running the command in the shell db.adminCommand( { logRotate : 1 } ) of arbiter it showing an error message as not authorized to run this command but in primary and secondary of replicaset its ...
3
votes
2answers
861 views

How to promote hidden mongo node to primary?

We are trying to implement DR setup for our mongodb replica set and currently three nodes in DR are configured to run as hidden nodes. We are trying to test failover to DR which will require promoting ...
0
votes
1answer
89 views

Why does a query on a sparse index perform much faster than a query on a partial index in MongoDB?

I created a sparse index in my MongoDB Atlas like so: db.detection_events.createIndex({"emp_id": 1}, {sparse: true}) When I performed this operation: db.detection_events.count({"emp_id": {$exists: ...
0
votes
1answer
55 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
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
1
vote
1answer
20 views

MongoDB: Queries running twice slow on NEW server compared to OLD server

I transferred current/old running DB into a new standalone server for MongoDB. To do this, I performed the following: Took dump of data from OLD server Restored data from the generated dump into NEW ...
1
vote
1answer
83 views

MongoDB different members of cluster choosing different index

Here's behavior I can't explain at all: I have 5-replica-set sharded cluster. I have a query that on 4 of the 5 RSs, it uses one index. But on one of the 5 RSs, it uses a different index. And that ...
1
vote
1answer
426 views

mongodump: fact.bson: input/output error

We are trying to export 1.5TB database into mongodb. But its fail after 100gb and giving us below error. As we notice root mount point got 100% space. We are using below command: mongodump -u admin -...
1
vote
0answers
27 views

Which NoSQL for storing images as 2D arrays (BLOBs)

I have large number of images that I need to access on per-pixel-basis in my app. The images are downloaded from web and are quite large (4k). Update is done several times a day (tousands of images), ...
1
vote
0answers
22 views

Notification for host failure and health status [closed]

I set up a MongoDB cluster with replica sets. I wish to have something like a dashboard or a "health status". My current solution is to connect to the cluster and query the replication state ...
0
votes
1answer
178 views

Mongo: how to covert a string to decimal?

I have written millions of documents with $CURRENT_CASH_BALANCE as strings instead of decimals. How can I convert them all to decimals?
2
votes
0answers
59 views

mongorestore --drop slow on small db

I'm using a real Mongo instance for my integration tests. On every test, I call mongorestore my_db_state --drop because I need a clean db to start the next test. On my tiny db (with only one test user ...
0
votes
1answer
18 views

How many cluster must i created on MongoDB Atlas?

I want to implement MongoDB transactional. But there is a term that must not single alone server. So, how many clusters must I create to an implement that?
0
votes
1answer
7k views

Can't solve MongoParseError: Invalid connection string

I'm not able to solve MongoParseError. First my I tried this mongoose.connect(`mongodb://${process.env.DB_USER}:${process.env.DB_PASSWORD}@db:27017/${process.env.DB_NAME}`, {useNewUrlParser: true}); ...
1
vote
0answers
27 views

mongodb switches from primary state to secondary during script

I have a mongodb replicaset setup using bitnami/helm which lives on my k8 cluster. I have a cron job that runs every night to store data in a my mongo db. It often fails when it tries to connect to ...
0
votes
1answer
62 views

MongoDB high usage WiredTiger

We are having difficulty with MongoDB high RAM usage in AWS EC2 Instance ubuntu with 30GB RAM. In our server, there are over 3K databases and It's out of memory from time to time. I read a lot about ...
0
votes
1answer
367 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
0answers
26 views

MongoDB 4.2 Shard Cluster: what is db.cache.chunks.DB and how to flush it

Here is my MongoDB cluster (I didn't draw about Mongos but exist) I made "news_cat" db and created some collections and I did sharding. I delete DB ("news_cat") in Mongos using db....
0
votes
1answer
480 views

Is it possible to retrieve a history of the remote connections to the MongoDB including the IP addresses and the executed commands?

For some reasons I disabled the user access control and somehow all collections have been wiped out. So I want an activity log to find out how this happened I need a list like this: | Date/Time ...
1
vote
1answer
2k views

MongoDB merge two collections and drop documents with same value in field

In my database I have two collections, but some documents were added (possibly) at different times to both collections. I could use mongodump and then mongorestore for merging. But then I have the ...
0
votes
0answers
18 views

MongoDB too many forked processes

We are having an issue with the MongoDB high usage memory, this is an AWS EC2 server running only MongoDB on docker container. total used free shared buff/cache ...
0
votes
1answer
86 views

updating single row in MYSQL

We have a situation where we need to update on a single row several thousands time a second and this requirement lasts continuously for 5 hours every day due to the nature of the business. Design ...
1
vote
1answer
110 views

create mongodb user to only read in replica set (not in master)

We have a Mongodb with ReplicaSet and a readonly user. This user can read from both Master and Replica Set. Some of the developers might accidentally run heavy queries from Master with this readonly ...
0
votes
1answer
1k views

Change in bind_ip value is not reflecting

I have mongo installed on Centos instance in AWS and I am connecting to the mongoDB server from my system. To connect from remote system we need to change bind_ip value to 0.0.0.0 in /etc/mongod.conf ...

1
3 4
5
6 7
44