springsolrspring-data-solr

How to Get Clusterstate of SolrCloud with Spring Data Solr?


I have a SolrCloud cluster and there are many Solr instances running within it. They are managed over a distributed Zookeeper ensemble.

Is there any way for Spring Solr data that will give external Zookeeper ensemble host names to a method so that we can retrieve the cluster state (i.e. clusterstate.json)?


Solution

  • I used that:

    CloudSolrServer solrServer;
    ...
    solrServer.getZkStateReader().getClusterState();
    ...