Re: How to get a list of servers per collection in sorlcloud using java api?

2012-11-22 Thread Luis Cappa Banda
Hello, Joe.

Try something like this using SolrJ library:

String endpoints[] = // your Solr server endpoints. Example:
http://localhost:8080/solr/core1
String zookeeperEndpoints = // your Zookeeper endpoints. Example:
localhost:9000
String collectionName = // Your collection name. Example: core1

LBHttpSolrServer lbSolrServer = new LBHttpSolrServer(endpoints);
this.cloudSolrServer = new CloudSolrServer(zookeeperEndpoints,
lbSolrServer);
this.cloudSolrServer.setDefaultCollection(collectionName);


You have now created a CloudSolrServer instance which can manage Solr
server operations: add a new document, delete, update, etc.

Regards,


 - Luis Cappa.

2012/11/22 joe.cohe...@gmail.com joe.cohe...@gmail.com

 I want to write a function that will go thorugh all the servers that store
 a
 specific collection and perform a tsk on it, suppose RELOAD CORE task.
 How can I get a list of all solr servers/urls that run a specific
 collection?



 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/How-to-get-a-list-of-servers-per-collection-in-sorlcloud-using-java-api-tp4021863.html
 Sent from the Solr - User mailing list archive at Nabble.com.




-- 

- Luis Cappa


Re: How to get a list of servers per collection in sorlcloud using java api?

2012-11-22 Thread Luis Cappa Banda
Hello,

As far as I know, you cannot do that at the moment, :-/

Regards,


 - Luis Cappa.


2012/11/22 joe.cohe...@gmail.com joe.cohe...@gmail.com

 Thanks Rakudten.
 I had my question mis-phrased.
 What I need is being able to get the solr servers storing a collection by
 giving the zookeeper server as an input.

 something like:

 // returns a list of solr servers in the zookeeper ensemble that store the
 given collection
 ListString getServers(String zkhost, String collectionName)




 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/How-to-get-a-list-of-servers-per-collection-in-sorlcloud-using-java-api-tp4021863p4021883.html
 Sent from the Solr - User mailing list archive at Nabble.com.




-- 

- Luis Cappa


Re: How to get a list of servers per collection in sorlcloud using java api?

2012-11-22 Thread Sami Siren
On Thu, Nov 22, 2012 at 7:20 PM, joe.cohe...@gmail.com 
joe.cohe...@gmail.com wrote:

 Thanks Rakudten.
 I had my question mis-phrased.
 What I need is being able to get the solr servers storing a collection by
 giving the zookeeper server as an input.

 something like:

 // returns a list of solr servers in the zookeeper ensemble that store the
 given collection
 ListString getServers(String zkhost, String collectionName)


You can use ZKStateReader (#getClusterState) to get this info.

--
 Sami Siren