You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Ugo Matrangolo <ug...@gmail.com> on 2014/01/24 17:16:11 UTC

Loading resources from Zookeeper using SolrCloud API

Hi,

we have a quite large SOLR 3.6 installation and we are trying to update to
4.6.x.

One of the main point in doing this is to get SolrCloud and centralized
configuration using Zookeeper.

Unfortunately, some custom code we have (custom indexer extending
org.apache.solr.handler.dataimport.EntityProcessorBase) are trying to load
resources from the file system and this is now a problem given that
everything under solr.home/core/conf is under Zookeeper.

What is the best way to load resources from Zookeeper using SolrCloud API ?

Regards,
Ugo

Re: Loading resources from Zookeeper using SolrCloud API

Posted by Mark Miller <ma...@gmail.com>.
The best way is to use the ResourceLoader without relying on ResourceLoader#getConfigDir (which will fail in SolrCloud mode).

For example, see openSchema, openConfig, openResource.

If you use these API’s, your code will work both with those files being on the local filesystem for non SolrCloud mode and being in ZooKeeper in SolrCloud mode.

There are also low level API’s you could use, but I wouldn’t normally recommend that.

- Mark

On Jan 24, 2014, at 11:16 AM, Ugo Matrangolo <ug...@gmail.com> wrote:

> Hi,
> 
> we have a quite large SOLR 3.6 installation and we are trying to update to
> 4.6.x.
> 
> One of the main point in doing this is to get SolrCloud and centralized
> configuration using Zookeeper.
> 
> Unfortunately, some custom code we have (custom indexer extending
> org.apache.solr.handler.dataimport.EntityProcessorBase) are trying to load
> resources from the file system and this is now a problem given that
> everything under solr.home/core/conf is under Zookeeper.
> 
> What is the best way to load resources from Zookeeper using SolrCloud API ?
> 
> Regards,
> Ugo