Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
929 views

mongodb replication failed with socketexception and listener

I'm trying to set up mongodb replication using two servers in different data center. For the purposes of this question, I'll say their IP address are 1.1.1.1 and 2.2.2.2. I installed a clean version ...
0
votes
0answers
21 views

What's the easiest way to automate Mongodb backups, for offline storage? [duplicate]

So, I'm almost finished building my first major production web app, and am wondering how to manage backups. Weekly cold snapshot backups via my vps online admin seem ideal - but weekly downtime sounds ...
0
votes
1answer
954 views

Is mongodb upsert the right option for write intensive use case?

I'm designing a data model for a transactional use case which is write intensive. The write load would be 900 - 1,600 Transactions Per Second (TPS) which would account for 30 million Inserts/Updates ...
0
votes
1answer
225 views

In MongoDB serverStatus(), what is the meaning of “connection data handles currently active”?

When running db.serverStatus() in the MongoDB shell (3.4, WiredTiger), the results contain the following data: { "connection data handles currently active" : 94862, "connection sweep ...
0
votes
1answer
543 views

mongo cluster collection count showing different every time

I had a replica set earlier which I have converted to cluster. Current configuration is: 3 shard 4 router 4 config server When I am trying to get count of one of collection sometime it is showing ...
0
votes
0answers
18 views

Can MongoDB support TTL per document, not per index?

I am trying to do a Redis-like collection in MongoDB. I need a collection of documents that expire and are automatically deleted after a certain time. I can use TTL Indexes but with this, every ...
0
votes
1answer
249 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 ...
0
votes
1answer
772 views

Mongodb what is the cost of array queries?

As far as I can tell, find queries in mongodb involving an array appear very expensive. Take as example the queries given in: https://docs.mongodb.com/manual/tutorial/query-array-of-documents/ db....
1
vote
1answer
113 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 ...
0
votes
0answers
4 views

Modify number of file WiredTigerLog in mogodb

How can I modify the number of WiredTigerPreplog and WiredTigerLog in journal directory ? There are allways 2 WiredTigerPrepl and 1 WiredTigerLog. Thanks MongoDB : "version": "4.4.4&...
1
vote
1answer
126 views

MongoDB as a log storage. Choosing shard key

I'm designing a log storage system based on MongoDB. I want to shard a log collection to increase ingestion and capacity (distribute writes to several machines) while allow fast search. I should be ...
1
vote
1answer
172 views

Why aggregate query with lookup is extremely slow?

I have a mongodb query that works but takes too long to execute and causes my CPU to spike to 100% while it is executing. It is this query here: db.logs.aggregate([ { $lookup: { ...
0
votes
1answer
252 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
1answer
36 views

Unable to start mongod daemon and it looks its crashing

DummyD3 is node3 of 3 node replication cluster. DummyD2 is primary and DummyD1 is Secondary (which is in sync with primary). I tried deleting the data under data path and did rsync from other ...
0
votes
2answers
389 views

Handling Bus Error in Mongo Service

I have a Mongo service with which multiple hosts are interacting. The host on which the Mongo service is running is quite special -- it has 3TB of RAM. However, that host also throws intermittent Bus ...
1
vote
1answer
384 views

It is possible to take incremental backup in mongoDB Shard cluster? without opsmanager

Shard MongoDB Cluster: 3-router 3-config 2-shard (3-replica's per shard) We are tring to take incremental backup for every one hour. We gone through few google links, but no luck. As per our above ...
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 ...
2
votes
1answer
155 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
112 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
938 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
20 views

Unable to start mongod daemon after upgrading OS from Ubuntu 16 to 18

Unable to start mongod daemon after upgrading OS from Ubuntu 16 to 18 root@dummy2:~# mongod --version db version v4.0.4 git version: f288a3bdf201007f3693c58e140056adf8b04839 OpenSSL ...
0
votes
1answer
16 views

Rename all databases when doing a mongorestore?

I have a datadump but I need to change the name of every database while restoring them, if a database is named "customers" it needs to be "customer2", "products" to "...
0
votes
1answer
15 views

how to mongorestore mongoDB 4.2 to documentDB 4.0?

I need to do mongorestore from my mongodb 4.2 to DocumenDb 4.0 compatible i got the command from aws which is this mongorestore --ssl --host="abc.aws.com:27017" --username=user --password=...
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 ...
1
vote
1answer
166 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....
0
votes
0answers
19 views

Why does the size of fields in a collection in mongodb database affect query performance?

I had a collection that was growing and with it's growth had a crazy increase in query response times. The collection records looked something like this: { orderStat: { type: String }, items:...
0
votes
1answer
151 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 ...
0
votes
1answer
7 views

Mongodb migration and appending data to existing database

I have two databases in two different machines containing data in same schema. Both have relational mappings in form of ObjectIDs as it is done in NoSQL database. The task at hand is to pick one ...
0
votes
2answers
262 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 ...
2
votes
3answers
10k 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/...
0
votes
1answer
87 views

Mongo zoned sharding with a single value

We have a database with around 50 collections, and 70 million records. All records belong to specific customers and have a customerId property. Currently all clients are in the USA. However, we're in ...
0
votes
2answers
27 views

mongo db-Either all host names in a replica set configuration must be localhost references, or none must be; found 1 out of 2 [closed]

while adding secondary member in replica set, i get following error: "Either all host names in a replica set configuration must be localhost references, or none must be; found 1 out of 2" my ...
0
votes
1answer
130 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 ...
0
votes
1answer
176 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
284 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
9 views

threshold replica lag for secondaryPrefered mongod

Example: 3 node on RS with mongos and mongoc(cluster) On one Secondary node(on RS) we have replica lag, e.g. - 1h. So, if my read preference is - secondaryPrefered and if I read data from RS, can it ...
1
vote
1answer
223 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
0answers
9 views

Mongodb Downgrade issue

I have upgraded mongodb to 4.4 from 4.2 in our dev server(RHEL 8). But unable to downgrade it from version 4.4 to 4.2 (Tried after changing package /etc/yum.repos.d/mongodb.repo). Getting error ...
1
vote
2answers
38 views

Nosql vs sql for genre management

I'm looking to keep a simple database for movies, with details like Name, YearofRelease, Genre etc. The key factor is the genres entry, where a movie could fall into multiple genres. Using a sql based ...
1
vote
1answer
125 views

Not able to connect to Mongodb vie mongo shell

I am no able to connect to mongodb via mongo shell. command: sudo mongo --tls --tlsCertificateKeyFile server.pem --tlsCAFile CA_INTERMEDIATE --host "mongodb://xxx:xxx@some-url:27020/data_base?ssl=...
0
votes
1answer
24 views

what will happen if MongoDB primary host is down and secondary is out of sync. will we lose transaction?

In our environment, we have one primary(A) and two secondaries(B & C nodes) running in Mongodb 4.0 version. secondary(C) server is newly added and sync is happening on that. Cluster is running ...
0
votes
1answer
22 views

mongodump failing to connection replica set

I'm able to connect to secondary node from arbiter node of the replica set. mongo -u backup02 -p backup02_password --port 8133 --host p1dummy:8133,p2dummy:8133,drdummy:8133 --authenticationDatabase ...
0
votes
0answers
11 views

My Mongos can't authenticate to my replica set

I have 3 config servers in a replica set and when I use the command: sudo mongos --configdb crs/the 3 config servers:port# --keyfile "Keyfile", I keep getting this error: [mongosMain] Unable ...
0
votes
1answer
278 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 ...
0
votes
2answers
94 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
386 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-...
0
votes
1answer
21 views

How to warm a MongoDB index

We're running a huge MongoDB with a large index (made of of four fields) which was created ad-hoc and should now be superseded by slimmer one (of the first two fields). But the problem is we can't ...
0
votes
0answers
24 views

Why mongodb's storage size is larger on secondary than on primary?

I don't understand why the storage size is significantly larger on the secondary than on the primary (450 GB vs 375 GB). hardware, operating system, file system and mongodb configurations are ...
0
votes
0answers
44 views

How to ETL SQL Server resultset to mongo DB

Let's say I have multiple columns on sql server that I want to join and save the resultset into a single mongodb collection for faster lookup and calculations ( I'm talking about over 15 tables and ...
0
votes
1answer
38 views

Do you think using ObjectID as field name is a bad practice? What can go wrong if I follow this design?

I design a MongoDB collection where I am planning to use mongo ObjectID as a field name. The ObjectID is a PostID and in the array, I track all the userID who liked or disliked the post.

1
2
3 4 5
45