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.
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 ...
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 ...
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 ...
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 ...
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 ...
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/...
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 ...
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 ...
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 ...
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....
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 ...
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 ...
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") ...
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
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 ...
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.
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 ...
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. ...
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 ...
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 ...
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 ...
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 --...
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( { ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
mongodb × 898linux × 95
ubuntu × 79
amazon-ec2 × 55
amazon-web-services × 46
database × 46
replication × 45
node.js × 36
centos × 33
sharding × 30
php × 25
docker × 25
azure × 23
backup × 22
replica-set × 20
kubernetes × 19
ssl × 17
performance × 17
ssh × 16
nginx × 15
apache-2.2 × 14
debian × 14
windows × 13
networking × 13
centos7 × 13