Hi,
I am trying to setup mongodb replica set as follows:
systemLog:
destination:file
path:"C:\\data\\log\\mongodb.log"
logAppend:true
processManagement:
fork:true
net:
bindIp:127.0.0.1
port:27017
storage:
dbPath:"C:\\data"
replication:
replSetName:"data"
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Setting bindIp to 127.0.0.1 will only bind to the local loopback interface. You need to set that to an IP address that is accessible to the server. Is this local machine just a desktop setup? Is it behind a router? You’ll most likely need to set up some port forwarding in order to have an externally and stable IP address.
You’ll also want to read about the security consideration in the MongoDB documentation about making the database accessible externally. You most likely want to to set up firewall rules that only allow connections from whitelisted IP addresses.
Yes, it’s a typical desktop setup. Yes, behind wireless router. I checked my IP using whatsmyip.org - it’s 104.5.xx.xxx, while when I run ipconfig on my machine, it’s 192.168.x.x. It means that I don’t have static IP as you mentioned. What are the possible solutions?
I am thinking of talking to my ISP and getting static IP or as you mentioned use port forwarding (I am not familiar with it though) to make it static that way.
Thank you for mentioning about security and firewalls. Actually, the reason for not putting this database on remote server is security. I thought that this database will be connected to network only during certain times.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
