On 4/6/2016 3:26 PM, Don Bosco Durai wrote:
> I want to automate the entire process from my Java process which is not 
> running on any of the servers were SolrCloud is running. In short, I don’t 
> have access to bin/solr or server/scripts/cloud-scripts, etc from my 
> application. So I was wondering if there were any way, like uploading a zip 
> with the configs (schema.xml, solrconfig.xml, etc.). One workaround I can 
> thinking is of making direct zookeeper calls.

If you're using a dependency management system like maven or ivy, you
could probably request solr-core, which would let you use ZkCLI or
ZkConfigManager directly in your own code.  That would be a VERY
significant increase in the size of your app, in the form of dependent
jars.  Although this might work, it's a sledgehammer approach.  There
are 72 direct dependencies for 5.5.0, and some of those have further
dependencies.  Some of solr-core's dependencies are quite large.

http://mvnrepository.com/artifact/org.apache.solr/solr-core

You could look at the code for ZkConfigManager and the classes it uses,
see how they use zookeeper to send configs, and directly implement the
zookeeper calls required.  Solr implements a wrapper around the
zookeeper client called SolrZkClient, a wrapping that you might want to
strip away, so you don't need the solr-core jar and its dependencies. 
This approach requires the most work.

The way the class inheritance is arranged is terrible for user code that
wants to do SolrCloud config manipulation.  I'll see if I can come up
with something to fix that, but it's not going to happen immediately.

An option that approaches the problem from another direction: Copy
WEB-INF/lib and other things (like log4j.properties and the logging jars
in server/lib/ext) to somewhere on your client system and run ZkCLI
directly as an external process from your own code, just like the zkcli
script does ... or possibly even using a modified zkcli script.  This is
not as clean as a code-based solution, but it would be relatively easy
to implement.

Thanks,
Shawn

Reply via email to