Support Questions

Find answers, ask questions, and share your expertise

Has anybody managed to make "clustering" working with Solr in Cloudera Quickstart VM with CHD5?

avatar
Contributor

I get the following error in Solr log:

 

org.apache.solr.core.CoreContainer

Unable to create core: pdfcollection_shard1_replica1
org.apache.solr.common.SolrException: Error loading class 'solr.clustering.ClusteringComponent'
	at org.apache.solr.core.SolrCore.<init>(SolrCore.java:841)
	at org.apache.solr.core.SolrCore.<init>(SolrCore.java:631)
	at org.apache.solr.core.ZkContainer.createFromZk(ZkContainer.java:273)
	at org.apache.solr.core.CoreContainer.create(CoreContainer.java:671)
	at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:368)
	at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:360)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.solr.common.SolrException: Error loading class 'solr.clustering.ClusteringComponent'
	at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:449)
	at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:381)
	at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:532)
	at org.apache.solr.core.SolrCore.createInitInstance(SolrCore.java:588)
	at org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:2215)
	at org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:2209)
	at org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:2242)
	at org.apache.solr.core.SolrCore.loadSearchComponents(SolrCore.java:1261)
	at org.apache.solr.core.SolrCore.<init>(SolrCore.java:768)
	... 11 more
Caused by: java.lang.ClassNotFoundException: solr.clustering.ClusteringComponent
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
	at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:789)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:270)
	at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:433)
	... 19 more

 

I changed the Solr configuration to use -Dsolr.clustering.enabled=true in Java Configuration Options forSolrServer (this gets applied to $CATALINA_OPT)

 

and copied the clustering jar file plus contribs from the parcels to my local lib

cp/opt/cloudera/parcels/CDH-5.0.0-1.cdh5.0.0.p0.47/lib/solr/solr-clustering-4.4.0-cdh5.0.0.jar lib

cp -R /opt/cloudera/parcels/CDH-5.0.0-1.cdh5.0.0.p0.47/share/doc/solr-doc-4.4.0+cdh5.0.0+178/solr-clustering/org/apache/solr/handler/clustering/* lib

 

then used full path in solrconfig.xml to point to the jar file.

<libpath="/home/cloudera/solr/lib/solr-clustering-4.4.0-cdh5.0.0.jar" />

 

and restarted solr using CM.

 

 

1 ACCEPTED SOLUTION

avatar
Contributor

in the meantime I could solve this myself

 

I copied the carrot2 libs from carrot2-java-api-3.9.3 (both required and optional) into  /var/lib/solr/carrot2/lib/

 

and added followig into solrconfig.xml

<lib dir="/var/lib/solr/carrot2/lib/" regex=".*\.jar" />

<lib path="/opt/cloudera/parcels/CDH-5.0.0-1.cdh5.0.0.p0.47/lib/solr/solr-clustering-4.4.0-cdh5.0.0.jar" />

 

After restarting Solr the clustering did work.

 

View solution in original post

1 REPLY 1

avatar
Contributor

in the meantime I could solve this myself

 

I copied the carrot2 libs from carrot2-java-api-3.9.3 (both required and optional) into  /var/lib/solr/carrot2/lib/

 

and added followig into solrconfig.xml

<lib dir="/var/lib/solr/carrot2/lib/" regex=".*\.jar" />

<lib path="/opt/cloudera/parcels/CDH-5.0.0-1.cdh5.0.0.p0.47/lib/solr/solr-clustering-4.4.0-cdh5.0.0.jar" />

 

After restarting Solr the clustering did work.