Re: Loading resources from Zookeeper

2014-01-24 Thread Alan Woodward
Hi Ugo,

You can load things from the conf/ directory via SolrResourceLoader, which will 
load either from the filesystem or from zookeeper, depending on whether or not 
you're running in SolrCloud mode.

Alan Woodward
www.flax.co.uk


On 24 Jan 2014, at 16:02, Ugo Matrangolo wrote:

 Hi,
 
 I'm in the process to move our organization search infrastructure to
 SOLR4/SolrCloud. One of the main point is to centralize our cores
 configuration in Zookeeper in order to roll out changes wout redeploying
 all the nodes in our cluster.
 
 Unfortunately I have some code (custom indexers extending
 org.apache.solr.handler.dataimport.EntityProcessorBase) that are assuming
 to load resources from the filesystem and this is now a problem given that
 everything under solr.home/core/conf is hosted in Zookeeper.
 
 My question is : what is the best way to load a resource from Zookeeper
 using SOLR APIs ??
 
 Regards,
 Ugo



Re: Loading resources from Zookeeper using SolrCloud API

2014-01-24 Thread Mark Miller
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 ugo.matrang...@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