I want to insert some data into Mongo DB using Java (on Ubuntu-Eclipse), but failed to connect to DB Server (on Windows XP Virtual manchine). The error is below:
Java. Io. ioexception: couldn't connect to [/192.168.1.72: 27017] BC: java.net. connectexception: Connection timed out
First, I can connect in WINXP using Mongo 192.168.1.72: 27017
Sencondly, I try connect in Ubuntu using Mongo 192.168.1.72: 27017 (I need to install Mongo client usingSudo apt-Get install MongoDB-clients)
And the connection failed again:
MongoDB shell version: 1.4.4
URLs: 192.168.1.72: 27017
Connecting to: 192.168.1.72: 27017/test
Tue Jun 5 16:19:47 JS error: Error: couldn't connect to server 192.168.1.72: 27017 192.168.1.72: 27017 (Anon): 954
Tue Jun 5 16:19:47 user exception 12513: connect failed
Exception: connect failed
So far, I did not find the resolution.
But when I connect in Ubuntu to another MongoDB server, it connects successfully.
So I think this is because of some configuration about MongoDB server in my WINXP.