In this article, we will see to troubleshoot the problem for connectivity between different MongoDB servers. I got below error when tried to restore database from local to remote host.
2019-11-20T15:56:59.536-0800 error connecting to host: could not connect to server: server selection error: server selection timeout
current topology: Type: Single
Servers:
Addr: 192.168.152.141:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: connection(192.168.152.141:27017[-121]) connection is closed
Continue reading MongoDB error connecting to host: could not connect to server: server selection error: server selection timeout