[JAVA-162] Unable to connection to a set of slave servers Created: 07/Sep/10 Updated: 10/Oct/10 Resolved: 10/Oct/10 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Cluster Management |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Joseph Wang | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
If you pass in a list of servers, one must be master. If you just want to connect to a slave, do "new Mongo(new ServerAddress(ip))". On Tue, Sep 7, 2010 at 10:46 AM, Joseph Wang <josephykwang@yahoo.com> wrote: String[] servers = server_list.split(","); try { } catch (Exception ex) { } if (serverCount > 0) { m = new Mongo(addr, opt); } From: Kristina Chodorow <kristina@10gen.com> What does your code look like? Are you calling "new Mongo(ip1, ip2)"? If you're connecting to a slave, you should just say "new Mongo(ip1)". On Tue, Sep 7, 2010 at 1:01 AM, Joseph Wang <josephykwang@yahoo.com> wrote: MongoConnnection: add server ip-10-160-86-4 at port 10000 SEVERE: switched to: ip-10-160-86-4:10000 but isn't master |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 10/Oct/10 ] |
|
This doesn't make sense in the context of replica sets. |
| Comment by Joseph Wang [ 28/Sep/10 ] |
|
Connections to two regular slaves. |
| Comment by Eliot Horowitz (Inactive) [ 27/Sep/10 ] |
|
Do you mean a list of regular slaves or in a repclia set? |