[JAVA-600] Getting com.mongodb.MongoException: can't find a master exception on AWS Created: 10/Jul/12 Updated: 11/Sep/19 Resolved: 10/Jul/12 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Connection Management |
| Affects Version/s: | 2.7.3 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Blocker - P1 |
| Reporter: | Sankate Sharma | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | driver, replicaset | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Amazon web services |
||
| Issue Links: |
|
||||
| Description |
|
Hello, We are trying to deploy our app on AWS. We are running a replica set configuration with 2 data nodes and 1 arbiter. Same configuration works fine on local environment but throws following exception on AWS com.mongodb.MongoException: can't find a master Here is the config of replia set , , { "_id" : 2, "host" : "domU-12-31-39-04-D6-95.compute-1.internal:27017", "arbiterOnly" : true } ] I have installed mongo shell on the app server(TOMCAT) host and I am able to connect to PRIMARY via the shell, that rules out networking issue. The code which gets the connection string is as follows addrs List is created using What are we missing in all this? Same code works on 3 node replica set on local machine. Here is config from my local setup , , { "_id" : 2, "host" : "MPKL09407ef8d.local:27098" } ] Thanks |
| Comments |
| Comment by Kristina Chodorow (Inactive) [ 10/Jul/12 ] | |||
|
Can the appserver connect to the members of the replica set using the hostnames in the config, as well? (domU-12-31-39-04-D6-95.compute-1.internal:27017, ip-10-46-167-177.ec2.internal:27017, and ip-10-46-223-117:27017?) | |||
| Comment by Sankate Sharma [ 10/Jul/12 ] | |||
|
Hi Kristina Yes, I am able to connect to all three nodes from shell. Here is the output of rs.status() PRIMARY> rs.status() , , , | |||
| Comment by Kristina Chodorow (Inactive) [ 10/Jul/12 ] | |||
|
Did you try connecting with the shell using the hostnames Java's using in particular, i.e.,
and that works? Also, can you run rs.status() once you've started the mongo shell and send the output? |