[JAVA-1048] Not able to connect mongo db on ec2 server from standalone Java program Created: 08/Nov/13 Updated: 11/Sep/19 Resolved: 08/Nov/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Authentication |
| Affects Version/s: | 2.4 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Blocker - P1 |
| Reporter: | rengith manickam | Assignee: | Unassigned |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | connection | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Amazon ec2 server |
||
| Description |
|
Hi All, Here is error I am getting when I run the program from my local machine... Nov 08, 2013 7:14:04 AM com.mongodb.DBTCPConnector initDirectConnection Here is my java program: public static void main(String[] args) throws UnknownHostException { catch (MongoException.Network e) { // You should get this exception if the server is unavailable e.printStackTrace(); } } Could you please tell where to change the firewall setting in amazon ec2 server/is there anything has to do in my local machine? Thanks, |
| Comments |
| Comment by rengith manickam [ 08/Nov/13 ] |
|
Thanks a lot..Now I can able to connect the database after changing the security group setting. As you mentioned, Hereafter I will use mongodb-user mailinglist or stackoverflow for general questions. Thanks, |
| Comment by Ross Lawley [ 08/Nov/13 ] |
|
Hi Rengith, You will need to add a security group exception for the port 27017 if you are using default config for you to access it from outside. For security group configuration, please check the amazon EC2 documentation. And if you are using a different port on Mongo, change the security group port accordingly. This isn't an issue in the java driver per sae so for future reference the best place for general questions like this one would be the mongodb-user mailinglist or stackoverflow. All the best, Ross |