Products | Versions |
---|---|
TIBCO ActiveMatrix BusinessWorks Plug-in for MongoDB | 6.2.0 |
User might face Test Connection failure while trying to connect to MongoDB server using ip address instead of localhost in designtime.
Below is the error popup:
"
Connection Failed !
Timed out after XXXX ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=<IP_Address>, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused: connect}}]
"
One possible scenario in which this issue is encountered is when MongoDB server has been started without the required option in the command because if the server has been started without specifying the 'bind_ip', it will bind to localhost and remote systems will be unable to connect to this server. Below is the command without the required option:
mongod.exe --dbpath "c:\data".
Start the server with --bind_ip <address> to specify which IP addresses it should serve responses from, or with --bind_ip_all to bind to all interfaces. e.g below command should be executed:
mongod.exe --bind_ip <IP Address> --dbpath "c:\data"