Solr 4.x and Jetty install on Ubuntu

There are a couple of more configuration file change since the inception of Solr 4.x. The first configuration change is to set up the multiple cores. It says 4.4 will be the last version that supports core tags. It recommends to move on to this new set up. The new tag seems to be confusing. But you don’t have to worry about what it does. Basically it replaces core tags and you don’t have to define core configuration. I feel this is clean.

<solr>
  <solrcloud>
    <str name="host">127.0.0.1</str>
    <int name="hostPort">${hostPort:8086}</int>
    <str name="hostContext">${hostContext:solr}</str>
    <int name="zkClientTimeout">${solr.zkclienttimeout:30000}</int>
    <str name="shareSchema">${shareSchema:false}</str>
    <str name="genericCoreNodeNames">${genericCoreNodeNames:true}</str>
  </solrcloud>
 
  <shardHandlerFactory name="shardHandlerFactory" class="HttpShardHandlerFactory">
    <int name="socketTimeout">${socketTimeout:120000}</int>
    <int name="connTimeout">${connTimeout:15000}</int>
  </shardHandlerFactory>
</solr>

Then, create core.properties file under the core directory. You can put more configuration file but the very basic is to put “name=collection1” as the example file indicates.

When you look at the jetty/logs you may face log4j warning. It was kind of tricky to figure out how to set it. But as the documentation reads (http://wiki.apache.org/solr/SolrLogging) just copy the four jar files to jetty/lib/ext folder. That will do.