Set up MongoDB on Windows Server
Preparation
Make sure your system is up-to-date. Use Windows Update to verify that you have installed the latest security updates and fixes for your version of Windows.
Install MongoDB
Follow the official MongoDB installation guide for Windows.
Configure MongoDB for Relution
If you are going to install Relution on another machine, you need to configure MongoDB to listen on all network interfaces. If Relution is going to be installed on the same machine you can skip these steps. Open the configuration file in a text editor like Notepad.
-
Go to
""%ProgramFile%\MongoDB\Server\3.6\"
-
Open “mongod.cfg” in a text editor (e.g. Notepad)
-
Find the section “network interfaces”
# network interfaces net: port: 27017 bindIp: 127.0.0.1 # Listen to local interface only, comment to listen on all interfaces.
Comment the bindIp
so that it looks like this:
# network interfaces net: port: 27017 # bindIp: 127.0.0.1 # Listen to local interface only, comment to listen on all interfaces.
Restart the MongoDB service using either the Services manager
(services.msc
) or the command prompt.
net stop MongoDB
net start MongoDB
Check installation
Verify MongoDB is running as expected by opening its log file.
-
Go to
"c:\data\log\"
-
Open “mongod.log” in a text editor (e.g. Notepad)
You should see a message similar to:
... NETWORK [initandlisten] waiting for connections on port 27017
You can now use the command line utility to connect to the MongoDB instance.
"C:\Program Files\MongoDB\Server\3.6\bin\mongo.exe"
Type exit
to disconnect again.
Firewall configuration
If you install Relution on another machine, you need to open port
27017
on this machine, so Relution can talk to MongoDB. If Relution is
going to be installed on the same machine you can skip these steps.
-
Open
Windows Firewall with Advanced Security
-
Navigate to
Inbound Rules
-
Click
New Rule…
in the Actions pane -
Select
Program
-
Click
Next
-
Select
This program path
-
Use
Browse…
to select the MongoDB’s service executable(
C:\Program Files\MongoDB\Server\3.6\bin\mongo.exe
) -
Click
Next
-
Select
Allow the connection
-
Click
Next
-
Select
Domain
and/orPrivate
depending on your network infrastructure -
Click
Next
-
Enter a name for the rule
-
Click
Finish