Sample Header Ad - 728x90

Replica Set in MongoDB by using IPs instead of domains?

0 votes
2 answers
5966 views
I want to use MongoDB in replica-set mode over 2 servers by IPs.But when I deployed the secondary one on other server, I faced the issues about connecting between 2 instance. For example, the primary located on server 192.168.1.1:27018 with hostname COM1 and the second located on server 192.168.1.2:27018 with hostname COM2. Despite of configuring like this net: bindIp: 0.0.0.0, COM1|192.168.1.1, COM2|192.168.1.2 port: 27018 But in MongoDB's log, it responses that cant hear from COM1:27018 or can find COM2:27018, I don't know how to map these addresses with these IPs. Please help me, thanks!
Asked by iamatsundere181 (101 rep)
Mar 27, 2019, 10:36 AM
Last activity: Jul 25, 2025, 08:04 AM