Hello Everyone, Hope all are doing well,
I will share an stranger issue regarding the Replica Set and hope to figure an solution for it.
I have a three nodes Replica Set:
1.) MongoNode1:27017 (Primary) IP: 10.10.15.100
CFG File: bindIp: 127.0.0.1,MongoNode1,10.10.15.100
2.) MongoNode2:27017 (Secondery) IP: 10.10.15.101
CFG File: bindIp: 127.0.0.1,MongoNode2,10.10.15.101
3.) MongoNode3:27017 (Arbitar) IP: 10.10.15.102
CFG File: bindIp: 127.0.0.1,MongoNode3,10.10.15.102
Everything was grate until we decided to buy a new server to work as primary instead of MongoNode1
But We forced to assign the MongoNode1 IP to The new PC, So the structure converted to the following:
1.) MongoNode4:27017 (Primary) IP: 10.10.15.100
CFG File: bindIp: 127.0.0.1,MongoNode4,10.10.15.100
2.) MongoNode1:27017 (Secondery) IP: 10.10.15.103
CFG File: bindIp: 127.0.0.1,MongoNode1,10.10.15.103
3.) MongoNode2:27017 (Secondery) IP: 10.10.15.101
CFG File: bindIp: 127.0.0.1,MongoNode2,10.10.15.101
4.) MongoNode3:27017 (Arbitar) IP: 10.10.15.102
CFG File: bindIp: 127.0.0.1,MongoNode3,10.10.15.102
In this case we just replaced the local IP address between 2 machines the new primary and the old primary and for sure we rebuild the replica set again but there are a stranger issue happened, the service is not running automatically in the new primary with the following error:
{"t":{"$date":"2023-06-22T07:46:08.622+03:00"},"s":"E", "c":"CONTROL", "id":20568, "ctx":"initandlisten","msg":"Error setting up listener","attr":{"error":{"code":9001,"codeName":"SocketException","errmsg":"The requested address is not valid in its context."}}}
We tried everything even we tried to reinstall the new primary machine OS, also tried to reset the network many-times from the routers and PC.
Note: we can start the mongo manually from the services after we login to windows but it cannot start automatically never if we restarted the primary pc.
so what is the advice in this this case?
Thank you.