Hi Solr List,

We're trying to set up java-based replication with Solr 1.4 (dist tarball). We are running this to start with on a pair of test servers just to see how things go.

There's one major problem we can't seem to get past. When we replicate manually (via the admin page) things seem to go well. However, when replication is triggered by a commit event on the master, the master gets a NullPointerException and no replication seems to take place.

SEVERE: java.lang.NullPointerException
at org.apache.solr.handler.ReplicationHandler $4.postCommit(ReplicationHandler.java:922) at org .apache .solr .update.UpdateHandler.callPostCommitCallbacks(UpdateHandler.java:78) at org .apache .solr.update.DirectUpdateHandler2.commit(DirectUpdateHandler2.java: 411) at org .apache .solr .update .processor .RunUpdateProcessor.processCommit(RunUpdateProcessorFactory.java:85) at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java: 169)
        at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69)
at org .apache .solr .handler .ContentStreamHandlerBase .handleRequestBody(ContentStreamHandlerBase.java:54) at org .apache .solr .handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
        at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)
at org .apache .solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:336) at org .apache .solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:239) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1115) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 361) at org .mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 766) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 417) at org .mortbay .jetty .handler .ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org .mortbay .jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 152)
        at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 534) at org.mortbay.jetty.HttpConnection $RequestHandler.content(HttpConnection.java:879)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
at org .mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: 409) at org.mortbay.thread.QueuedThreadPool $PoolThread.run(QueuedThreadPool.java:522)



This is the master config:

  <requestHandler name="/replication" class="solr.ReplicationHandler" >
    <lst name="master">
<!--Replicate on 'optimize'. Other values can be 'commit', 'startup'. It is possible to have multiple entries of this config string-->
        <str name="replicateAfter">commit</str>

<!--Create a backup after 'optimize'. Other values can be 'commit', 'startup'. It is possible to have multiple entries of this config string. Note that this is
        just for backup, replication does not require this. -->
        <!-- <str name="backupAfter">optimize</str> -->

<!--If configuration files need to be replicated give the names here, separated by comma --> <str name = "confFiles "> solrconfig_slave .xml:solrconfig.xml,schema.xml,synonyms.txt,stopwords.txt,elevate.xml</ str>

<!--The default value of reservation is 10 secs.See the documentation below.
        Normally , you should not need to specify this -->
        <str name="commitReserveDuration">00:00:10</str>
    </lst>
  </requestHandler>


and... the slave config:

  <requestHandler name="/replication" class="solr.ReplicationHandler" >
    <lst name="slave">

<!--fully qualified url for the replication handler of master . It is possible to pass on this as a request param for the fetchindex command--> <str name="masterUrl">http://hostname.obscured.com:8080/solr/calendar_core/replication </str>

<!--Interval in which the slave should poll master .Format is HH:mm:ss .
         If this is absent slave does not poll automatically.
But a fetchindex can be triggered from the admin or the http API -->
        <str name="pollInterval">00:00:20</str>

        <!-- THE FOLLOWING PARAMETERS ARE USUALLY NOT REQUIRED-->
<!--to use compression while transferring the index files. The possible values are internal|external if the value is 'external' make sure that your master Solr has the settings to honour the accept-encoding header.
         see here for details http://wiki.apache.org/solr/SolrHttpCompression
If it is 'internal' everything will be taken care of automatically. USE THIS ONLY IF YOUR BANDWIDTH IS LOW . THIS CAN ACTUALLY SLOWDOWN REPLICATION IN A LAN-->
        <str name="compression">internal</str>
        <!-- ??? -->

<!--The following values are used when the slave connects to the master to download the index files. Default values implicitly set as 5000ms and 10000ms respectively. The user DOES NOT need to specify these unless the bandwidth is extremely low or if there is an extremely high latency-->
        <str name="httpConnTimeout">5000</str>
        <str name="httpReadTimeout">10000</str>

<!-- If HTTP Basic authentication is enabled on the master, then the slave can be configured with the following
        <str name="httpBasicAuthUser">username</str>
        <str name="httpBasicAuthPassword">password</str>-->
        <!-- we use firewall for security... -->

     </lst>
  </requestHandler>


Does anyone know off the top of their head what this might indicate, or know what further troubleshooting steps we should be taking to isolate the issue?

Also, on a (probably) unrelated topic, we're kinda confused by this section of the slave config:

<!--to use compression while transferring the index files. The possible values are internal|external if the value is 'external' make sure that your master Solr has the settings to honour the accept-encoding header.
         see here for details http://wiki.apache.org/solr/SolrHttpCompression
If it is 'internal' everything will be taken care of automatically. USE THIS ONLY IF YOUR BANDWIDTH IS LOW . THIS CAN ACTUALLY SLOWDOWN REPLICATION IN A LAN-->
        <str name="compression">internal</str>

Since we *are* on a LAN, what exactly should we be doing here? The language is somewhat unclear... I thought that meant that we should just comment out the line altogether, but others think it means that we should leave it set to "internal". We get that compression is probably unnecessary for our more vanilla setup, we're just not 100% sure how to express that correctly.

Thanks in advance for any advice!

--
Steve

Reply via email to