Luis Cappa Banda skrev:
Thanks a lot, Per. Now I understand the whole scenario. One last question:
I've been searching trying to find some kind of request handler that
retrieves cluster status information, but no luck. I know that there exists
a JSON called clusterstate.json, but I don't know the way to get it in raw
JSON format.
If you want the clusterstate in raw JSON format, I believe there is currently no other way than go fetch it youself from ZK. Or maybe something in the admin-console /zookeeper will help you.
 Do you know how to get it status? Any request handler or Solr
query? Maybe checking directly from Zookeeper?
Yes, if you want it in raw JSON format. If you want the "information" parsed as a java object hierarchy you can access through ClusterState object. The best way to get a ClusterState (that keeps itself up to date with changing states) is probably to use the ZkStateReader: ZkStateReader zk = new ZkStateReader(<ZK-connection-string>, <zk-connection-timeout>, <zk-client-timeout>);
   zk.createClusterStateWatchersAndUpdate();
Then whenever you want a updated "picture" of the cluster state:
   zk.getClusterState();
You can also use a CloudSolrServer which carries a ZkStateReader if you are already using that one. But I guess not since it didnt sound like you would try the node-java bridge to be able to use SolrJ stuff in node.js
Best regards,

- Luis Cappa.

Reply via email to