com.mongodb.MongoException: Could not find any valid secondaries with
the supplied tags ('{ "locale" : "sc"}'
at com.mongodb.DBTCPConnector$MyPort.get(DBTCPConnector.java:358)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:212)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:305)
at com.mongodb.DBCollection.findOne(DBCollection.java:647)
at com.mongodb.DBCollection.findOne(DBCollection.java:626)
My code looks like:
HashMap<String, String> tags = new HashMap<String, String>(1);
tags.put("locale", "sc");
...
dbCollection.setReadPreference(new
ReadPreference.TaggedReadPreference(tags));
My replica set is configured as:
PRIMARY> rs.conf()
{
"_id" : "test",
"version" : 3,
"members" : [
{
"_id" : 0,
"host" : "localhost:27020",
"priority" : 2,
"tags" : {
"locale" : "sc"
}
},
{
"_id" : 1,
"host" : "localhost:27021",
"tags" : {
"locale" : "in"
}
},
{
"_id" : 2,
"host" : "localhost:27022",
"tags" : {
"locale" : "de"
}
}
]
}
> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>
On Nov 26, 10:19 pm, Eliot Horowitz <el...@10gen.com> wrote:
> This is using master from github?
> Can you open a case @http://jira.mongodb.org/