Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
5
votes
1answer
1k views

Mongo replication lag slowly increasing

I am running a replica-set in production with slaveOk = false using mongo 2.0.7 in AWS The replication lag on one of the servers is close to 58 hours. This replication lag is sometimes decreasing ( at ...
0
votes
1answer
870 views

MongoDB unrecoverable replication error

One of member of my MongoDB replica set decided it would not restart, with the following error (reformatted for readability): Starting rollback due to OplogStartMissing: our last op time fetched: (...
0
votes
0answers
11 views

Schema design: Anonymous user's data across registration

This is a schema design question; implementation is going to be Mongo, but answers are platform agnostic. Given an app, which has users, sessions, and items. All visitors will have a session ...
0
votes
0answers
12 views

MongoDB restoring to existing replica set (avoid creating a new one)

I have a MongoDB cluster runnning on 3 AWS EC2 instances, 1 for primary and 2 secondary nodes. I'm trying to perform a backup and restore without having to recreate the replica set. mongodump seems a ...
0
votes
1answer
9 views

How to store null in a double field in mongodb

My mongodb schema has a field of "double" data type. Sometimes, when there is no value for this field, mongo is storing it as 0.0 but I need it to store as null My Schema: db.createCollection("...
0
votes
0answers
17 views

MongoDB replica set in swarm gets very slow when one node is down

I created a 3 nodes replicaset with mongodb that I host in a swarm environment. To do so, I created 3 services mongo1, mongo2, mongo3 with the same configuration. When I challenged the resiliency of ...
3
votes
2answers
2k views

MongoDB restore with replica set

I have MongoDB setup like this: Primary | Server1 -----------+--------- Secondary | Server2 -----------+--------- Arbiter | Server3 -----------+--------- Backup | Server4 I ...
0
votes
1answer
11 views

Mongodb Index not used in case of $or query

I have added created a collection first and created index db.first.createIndex({a:1, b:1, c:1, d:1, e:1, f:1}); and inserted data db.first.insert({a:1, b:2, c:3, d:4, e:5, f:6}); db.first.insert({a:...
1
vote
2answers
1k views

How do i copy my mongodb data-files to mongodb server

I actually copied above two files in MongoDB's data folder which is default in windows machine (C:\data\db ). But when I start mongo shell and type show dbs, it will not show my database. Steps I ...
0
votes
1answer
3k views

Can't start mongodb server using 'sudo service mongod start'

I'm trying to set up a dummy mongodb server on my local device so I can play around with it and make mistakes so that I can feel confident editing the actual server. I use the following code to start ...
2
votes
1answer
1k views

How to get all documents from a particular chunks in MongoDB?

From mongos log, I got the following message balancer move failed: { chunkTooBig: true, estimatedChunkSize: 408839903, ok: 0.0, errmsg: "chunk too big to move" } from: shard4 to: shard1 I know ...
1
vote
0answers
9 views

does mongodb have any compiled list of non compatible functions on sharded cluster?

does mongodb have any compiled list of non compatible functions on sharded cluster? I was looking for a compile list of non compatible functions on sharded clusters, so we can anticipate the changes ...
0
votes
0answers
9 views

MongoDB insert data if not exists and update only the array if exists on large amount of documents

So I have about 1M records to first insert and then subsequently update an array in them whenever I run the script. A typical record { "_id" : Object(), "id" : "my_unique_id", ...
0
votes
0answers
8 views

Collection data not seen in mongos sharding

I have configured sharding with 3 replica sets as shards and one config server in replication. One Mongos router is running. Have restored a collection into new database in one of the shards using ...
2
votes
3answers
2k 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: ...
2
votes
2answers
2k views

Help restoring a mongodump 3.4 backup into a different instance

I am working on backup recovery for MongoDB 3.4. We have an instance that is running and being used. I set up a instance for doing testing of the backup and recovery process. In order to get data I ...
0
votes
0answers
10 views

Mongodb Ops Manager url changed [on hold]

Recently we successfully updated the hostnames of the mongodb servers from short hostname to FQDN. Now we are not getting automation logs on the server, however we are able to see the logs on the ops ...
5
votes
2answers
788 views

Chunk Size is shown as 1 KB in mongo db logs even it is set to 300 MB

I am running a mongo cluster. Chunk size set is 300 MB but for today morning it is showing me in logs that chunk size is 1024 Byte. I checked in current op there also it is showing chunks of 1024 byte....
0
votes
1answer
905 views

How to repair mongodb collection when index is corrupt?

Mongo version: 2.6 I think one or more of my MongoDB index is corrupt which is not letting me delete the corrupt collection or make a backup with mongodump Below is the error i get when i try to ...
0
votes
0answers
14 views

indexSize mismatch between primary and secondary members on wired tiger engine

we are using mongoDB 4.0 on wired tiger engine. For the last couple of days, we are observing that indexSize of primary server(marked in blue in attached file) went up drastically compared to its ...
0
votes
2answers
30 views

usage percentage of Mongodb internal cache

I've ran two performance test on a MongoDB server with identical environment/settings AFAIK. I found that the throughput was 10% apart. When I inspected the mongostat logs, I found that Mongodb in ...
0
votes
1answer
519 views

Adding secondary via rs.add on MongoDB

I have a master and slave on Linux (centOS 7). The rs.initiate(cfg) was done, but its shows the below output when trying to add secondary via rs.add: genienational:PRIMARY> rs.add("localhost....
0
votes
0answers
17 views

swap collections in mongoDB

I receive current day transactional data which I dump into a collection called 'collA'. The data will be reportable for max of 4 days, after this the data becomes useless to me. Are the below two ...
-1
votes
0answers
16 views

to write and read in real time daily 15GB data - help select DB [on hold]

Currently, data is managed in a file(csv). The amount of data collected during the day is about 15GB per day. (10-15 GB) Currently, it is saved only as a file and later processed and analyzed. but ...
0
votes
1answer
31 views

MongoDB 4.2 using change streams with read concern majority disabled in a PSA deployment

I currently run a PSA (Primary, Secondary, Arbiter) deployment and thous only have two databearing nodes. In case of a databearing node going down, read concern majority prevented the change stream to ...
4
votes
1answer
989 views

MongoDB can't add new replica set member [rsSync] SEVERE: Got signal: 6

I have a replica set and I added a new member to the set. The initialSync begins for the new member and rs.status (on primary) shows STARTUP2 as status. However, after a long enough time, there's a ...
2
votes
2answers
1k views

How to run Mongo database db.currentOp(true) command using API

Using the Mongo Java API I can run the currentOp() command like this: MongoClient mongoClient = null; mongoClient = new MongoClient( "127.0.0.1", 27017); db = mongoClient.getDB("admin"); db.command("...
0
votes
1answer
931 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 ...
0
votes
1answer
1k views

How can I perform a mongoimport to a host that requires an SSL Certificate?

I am trying to load some sample JSON data into a MongoDB database (hosted on IBM Bluemix). The connection requires SSL, and a SSL Certificate has been provided, but I keep getting an error when I ...
0
votes
1answer
340 views

Error while doing in replicaset in windows (MongoDB)

I tried doing the replicatset in windows, but im getting the below error. I checked the mongo process and killed the existing process. Even though the error exists. help me on this pls Thx ...
-1
votes
4answers
19k views

Mongodb exception: connect failed

Here's the environment: Linux(x64): 16.04 MongoDB: 3.2.15 Error: root@system-test:~# mongo MongoDB shell version: 3.2.15 connecting to: test 2017-07-25T07:31:28.528+0000 W NETWORK [thread1] Failed ...
0
votes
1answer
1k views

Binding specific ips with Mongodb

I am using Mongodb 3.6.3 on Centos 7. I am running the below command: sudo mongod --storageEngine wiredTiger --dbpath /data --bind_ip_all --logpath /var/log/mongodb/mongod.log --fork and ...
1
vote
1answer
307 views

Service Discovery for MongoDB

What is the best way of implement a Service Discovery like ETCD for use in a mongodb cluster? I wish have, 1 master for HA and two nodes, in my master i have a static ip, but nodes maybe can changes ...
0
votes
1answer
2k views

How to load balance mongodb replica cluster

I have created a mongod replica cluster of 2 nodes , mongo1 and mongo2. to load balance I have added following rule in my haproxy listen mongo_replica_cluster bind *:27017 mode tcp ...
0
votes
2answers
469 views

How can I find out who is trying to connect to my MongoDB?

I have a MongoDB server that I recently configured to allow only SSL connections. Now my mongo.log is filled with this: 2017-05-30T17:39:24.528+0000 I NETWORK [conn7881820] AssertionException ...
0
votes
1answer
31 views

MongoDB is not using the index I created for this specific query

MongoDB 4.0. I have a simple query: db.product.find({ modifiedOn: { $gte: ISODate("2019-08-02T03:00:00.000Z") } }) .limit(10) And a simple index on modifiedOn....
1
vote
1answer
687 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 ...
1
vote
1answer
182 views

mongodb “WriteConcernFailed” on a replica set

I have a replica set of 4 members. 1 primary, 1 arbiter, 1 secondary, and another one that should be secondary, but have issues and is not connected. (in a "connecting..." state). When the ...
6
votes
4answers
8k views

Secondary and Arbiter stuck in Startup

I'm using MongoDB version 3.0.0. I'm trying to setup mongodb replication on our machine. Replication was initially setup but due to some changes on the VM the entire thing crashed. When I tried to set ...
0
votes
2answers
2k views

Cannot connect to mongos

Following the MongoDB Sharding Documentation, I start a mongos using a configuration file with the specifics of my config server. It seems rather straightforward, yet I am running into an issue. I ...
0
votes
2answers
20 views

MongoDB 2.0.9 IndexStats

I am trying to get the index usage statistics in a mongoDB 2.0.9. I found a similar question in https://stackoverflow.com/questions/44813787/how-to-check-index-usage-in-mongodb but this only applies ...
0
votes
1answer
28 views

mongoDB won't stop with shutdown or kill

Not sure If I can make the same question already made here but here it goes. I have a mongodb fork and running with high CPU usage. I'm trying to shut it down but nothing seems to work. 2729 mwon ...
1
vote
1answer
22 views

Sharded Mongodb stalls randomly

I have setup Sharded MongoDB cluster using hashed sharding in kuberenetes.I first created the config server Replicaset and then created 2 shard replicasets. Finally created mongos to connect to the ...
0
votes
1answer
22 views

Add a new node to Mongo Replicaset using Rsync

I have a 3 shard mongo cluster. Each shard has a 3 node replica set. On each shard, the data size is 3 TB. I want to add 1 more node to each replica set. But its taking lot of time. The initial sync ...
0
votes
1answer
27 views

Connectivity issues in replication process

I've been trying to add a new node to a replica set without success due to these errors: 2019-08-12T06:48:15.031+0200 I ASIO [NetworkInterfaceASIO-RS-0] Ending connection to host mongo03:...
0
votes
1answer
19 views

Benchmarking MongoDB full text search vs MSSQL full text search

I'm working on a project for comparing mongodb and mssql databases performance on full text search. I started with using YCSB benchmark but now that I have a deeper understanding about this benchmark, ...
0
votes
1answer
26 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
1answer
2k views

How to find sources of connections to Mongodb?

In the Mongodb, I can see there are 54 connections from different applications in my local server. Is there anyway to see which one of my applications are using Mongodb more than the others? Imagine I ...
0
votes
0answers
23 views

What does config shard mean here?

I created a MongoDB sharded cluster with replica set rsa, rsb and rsc. Configuration server replica set is configRS. Initially shard status listed only these shards as primary shard for the sharded ...
1
vote
4answers
2k views

MongoDB: Server sockets closed after a few minutes

I am working with multiple AWS intances connected to the same MongoDB database (inside Compose.io Elastic deployment). But i am getting the error server <url>:<port> sockets closed after a ...