If everything is as on the above picture then simply close the Firewall by pressing on the “OK” button. If everything looks as above press on Add to allow the app in the Firewall as you can see above. On this window click on “Allow an app or feature through Windows Defender Firewall” your window will change and click on this window on “Allow another app…” and browse to the mongodb folder and choice for path: C:\Program Files\MongoDB\Server\4.0\bin\mongod.exe, it should look like this: Search for “Windows Defender Firewall” and open the application: Step 4: Fix the Windows Defender Firewall (on all three servers). When you have done this open “Services” find “MongoDB” and restart the service and continue below once you have done this on all three the servers.
So the whole config should probably looks something like this now: (for this tutorial this is perfectly fine, for production, I would recommend you fill in the private IP address of the server) Now on each of the servers we have to alter the config file slightly so open the following file on each server:Ĭ:\Program Files\MongoDB\Server\4.0\bin\mongod.cfg Step 3: Update the MongoDB configuration file Remember that you will need to repeat the above steps for the two other servers. You should now have finished the installation so simply press “Finish”. You can now press the “Install” button to start the installation.
I will again leave everything selected and click once more on “Next” to continue. I will leave everything default for this tutorial and simply press “Next” to continue.
Press you wish to install the “Complete” version on the picture above. Read the license and then tick the box you accept the license and press next on the picture above. Just follow the pictures below to install MongoDB, you have to do this on all three servers. Įven it does say Windows Server 2008 it does work perfectly fine on Windows Server 2019! MongoDB provides windows installer packages so simply download their msi file from their website. Step 1: Download MongoDB (on all three servers)
Server Type: t2.large (T Server Type is probably not a good match for a production DB however for this tutorial it is cheap and will do its part)Īs a pre-requirement all servers should be in the same workgroup or in the same domain, if they are not then you have to add all the servers in your hosts file so MongoDB knows how to connect to them. I am using AWS for this setup and created three servers that have Windows Server 2019 installed. In this guide, I will show some simple steps of how to set up a MongoDB installation in replication on Windows Server.