Skip to main content
32 votes
Accepted

"Excess arguments." while doing "systemd daemon-reload" during MongoDB configuration

I guess you should use systemctl daemon-reload instead of systemd daemon-reload.
Ha Hacker's user avatar
  • 436
18 votes
Accepted

Why does the official docker image for mongo not use XFS, and then warn about not using it?

The full answer. A docker image doesn't have a file system. A docker image is a bunch of tar files each representing a layer plus some JSON files with the image metadata. When a docker image is pulled ...
AlexD's user avatar
  • 11.6k
10 votes

How to correctly configure MongoDB to use Letsencrypt SSL on Ubuntu

You combine the wrong pem files. You need to combine privkey.pem with cert.pem. cat /etc/letsencrypt/live/example.com/privkey.pem /etc/letsencrypt/live/example.com/cert.pem > /etc/ssl/mongo.pem ...
Herman Fransen's user avatar
10 votes
Accepted

MongoDB on NVMe in production

You can RAID NVMe, but you just can't RAID them with a traditional RAID controller. For example, if you're on an Intel CPU and running compatible Intel drives then you can use their Rapid Storage ...
Mark Henderson's user avatar
7 votes
Accepted

Why doesn't MongoDB automatically restart?

Unexpected shutdown is definitely a case where admin intervention would be strongly recommended, although you can always change the service default for your deployments. If the reason for a mongod ...
Stennie's user avatar
  • 1,300
6 votes

How can I connect to a MongoDB Replica Set behind a proxy?

I have recently had a similar situation. Consider some DNS cheating, where the client uses "real" DNS names, and the mongodb replica set members use the same names but override them in /etc/hosts to ...
Aaron Oas's user avatar
6 votes

Restarting MongoDB automatically if it crashes

I don't think newer versions of MongoDB/Ubuntu use upstart. Here's how I achieved this on Ubuntu 18.04, MongoDB 4.0.2: Open /lib/systemd/system/mongod.service in a text editor: sudo nano /lib/systemd/...
joe's user avatar
  • 183
6 votes
Accepted

Speed up mongodump+mongorestore

Don't know why I didn't think of it: ssh *** ". /etc/profile; mongodump --host=127.0.0.1:27017 --db=**** --archive --gzip" | mongorestore --host=127.0.0.1:27017 --drop --archive --gzip Was 1603.96 ...
warvariuc's user avatar
  • 398
6 votes

Unable to rsync due to broken pipe

It turns out rsync accesses rsync on the remote server, and the versions where not the same between my servers. I was running 3.1.1 on the destination server, but 3.1.0 on the source server, and ...
Cerin's user avatar
  • 3,950
5 votes

Mongodb - proper way to rotate logs

My solution for MongoDB v4.4 & Ubuntu 18.04 Create logrotate config /etc/logrotate.d/mongodb /var/log/mongodb/mongod.log { rotate 7 size 100M missingok create 0600 mongodb mongodb ...
gr8's user avatar
  • 51
5 votes
Accepted

mongodb, does one *need* a replica set for a minimal production db?

You can have a production environment running on a single MongoDB instance. Under very special circumstances. Let us see what those circumstances are after we cleared up some things about replica sets....
Markus W Mahlberg's user avatar
5 votes
Accepted

How to Change Replica Set Protocol Version in MongoDB.

You need to restart the mongod service after rs.reconfig(cfg). The reconfig will change the protocol version but it will be active after the restart. First you need to restart the secondary, then do a ...
Andrada's user avatar
  • 66
4 votes

how to connect to mongodb server via ssh tunnel

I've done few configurations on my Ubuntu 18 Vagrant box in order to successfully connect MongoDB remotely using Robo 3T GUI. I've explained in the following steps. On Ubuntu server, to open mongo ...
Krishna's user avatar
  • 149
4 votes

How to reset MongoDB replica set settings

edit /etc/mongod.conf and comment out replication: block service mongod restart mongo local --eval "db.dropDatabase()" service mongod stop on mongo primary : rs.add("this node") ...
blueheart_2's user avatar
4 votes

mongoDB won't connect remotely

With mongoDB server version 3.6.4, Ubuntu 16.4.4 I solved this by setting the net section in /etc/mongod.conf like this: net: port: 27017 bindIpAll: true # bindIp: 127.0.0.1
Mirko's user avatar
  • 141
4 votes

Using different cloud hosts for app and db/will there be latency with Mongo Atlas?

I can tell you my own experience. I have a web server hosted in Azure which store into and retrieve data from a M10 MongoDB Atlas instance hosted in AWS. Both instantes are located in Europe ...
David López Pérez's user avatar
4 votes

Why doesn't MongoDB automatically restart?

If you are using systemd then Restart=always under the [Service] section should allow the service to restart after a crash.
Tux_DEV_NULL's user avatar
  • 1,123
4 votes

How to expose and access MongoDb ports in Kubernetes?

In Kubernetes, if you want to expose a Port to the outside world, you can use Service with Type NodePort or LoadBalancer. Type LoadBalancer is usually used on cloud providers since they provide ...
Artem Golenyaev's user avatar
4 votes
Accepted

Mongodb on AWS EC2 backup strategy

In general, do not trust any backup procedure until you have confirmed the integrity of a restore from long term media. You already have the capability to take a storage system layer backup online. ...
John Mahowald's user avatar
4 votes

Choosing right ec2 instance type for Mongodb with sharded cluster configuration

Without knowing your load patterns it’s impossible to tell what instance size you should use. Go ahead with an instance type that you think should work, even if it’s T3, monitor its CPU load, monitor ...
MLu's user avatar
  • 26.3k
4 votes

How to get public certificate info of a mongod instance

You can check the certificate details of your instance through your browser quite easily.please check this article for more reference Check SSL certificates in your browser You can also use this ...
asmath's user avatar
  • 409
3 votes

MongoDB: why the mongod service is shutdown?

Please check the valie of PIDFile in your mongod.service : [Service] ... deleted ... Type=forking PIDFile=/data/mongo/pid/mongod_27019.pid ... deleted ... Must have the same value with ...
CakEkoL's user avatar
  • 31
3 votes

Cannot connect to MongoDB in docker

I had the same problem but found another way to address this issue. You can just pass network parameter while running docker image and this way docker points to correct localhost. docker run --...
hyperloopfan's user avatar
3 votes
Accepted

Mongo forcing a log rotation on Windows

I found out that MongoDB has it's own logRoation for Windows build in. Rotate the log file by issuing the logRotate command from the admin database in a mongo shell: use admin db.runCommand( { ...
StuiterSlurf's user avatar
3 votes

Unable to rsync due to broken pipe

Solution: As explained by Cerin here, just upgrade your rsync versions to ensure that they are the exact same on both the sending and receiving PCs! I had this exact same problem: a broken pipe write ...
Gabriel Staples's user avatar
3 votes

What's causing Ubuntu to have BUG: soft lockup warning so often?

What you have is a multithreaded application in which one thread appears to have hit a kernel bug. Some analysis of the bug You have tried to shut down the process mongod with ID 1160. The main ...
kasperd's user avatar
  • 31.1k
3 votes

MongoDB Compass error. 'not master and slaveOk=false'

I received the same error when trying to connect with Compass (version 1.13.1) to a secondary node. It worked after I changed the connection Hostname to the Primary server, specified the Replica Set ...
Lark217's user avatar
  • 31
3 votes

Why doesn't MongoDB automatically restart?

If you're really concerned about high-availability, you'd be running a replicaset, and can deal with 1, or more, nodes failing. Having personally managed a large, sharded mongodb deployment in ...
Jason Floyd's user avatar
  • 1,922
3 votes

MongoDB is not connecting through window server?

It seems you have found the solution, posting an answer to add visibility. Mongodb was not listening on all the IP addresses. This was solve by binding the service to 0.0.0.0. For similar cases, you ...
mehdi sharifi's user avatar
3 votes

MongoDB won't run if dbPath is symlinked

You're almost certainly running into SELinux here. While it expects and permits access to the data directory /var/lib/mongo, or more specifically files and directories having the SELinux type ...
Michael Hampton's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible