I try to add another net with the its corresponding bind ip and port to my AMI ec2 mongod.conf file so I will be able to create a 2 node replica set but when I run the command "sudo service mongos restart", mongos won't start. Here is my mongos.conf file:
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# Where and how to store data.
storage:
dbPath: /var/lib/mongo
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:
# how the process runs
processManagement:
fork: true # fork and run in background
pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
timeZoneInfo: /usr/share/zoneinfo
# network interfaces
net:
port: 27017
bindIp: 172.31.90.193 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
net:
port: 27017
bindIp: 172.31.92.31
#security:
#operationProfiling:
replication:
replSetName: "Midterm"
#sharding:
## Enterprise-Only Options
#auditLog:
#snmp:
Does anyone know why this is happening? I tried doing this in a vm using vagrant and it worked. Why would be any different in AMI ec2?
**UPDATE:
This is what the security group of one of my instances looks like: