문제

My out-of-the-box Solr 4.3.1 does not recognize the trailing /replication at the end of masterUrl in the slave setting.

Here's the relevant part of my solrconfig.xml on the slave:
<requestHandler name="/replication" class="solr.ReplicationHandler">
<lst name="slave">
<str name="masterUrl">http://mymaster:myport/solr/mycorename/replication</str>
<str name="pollInterval">00:00:60</str>
</lst>
</requestHandler>

And here's the relevant part on the master:
<requestHandler name="/replication" class="solr.ReplicationHandler">
<lst name="master">
<str name="replicateAfter">commit</str>
<str name="replicateAfter">startup</str>
<str name="replicateAfter">optimization</str>
<str name="confFiles">schema.xml,stopwords.txt</str>
</lst>
</requestHandler>

And this is the error I'm getting on the slave, every minute (like specified by pollInterval):
Master at: http://mymaster:myport/solr/collection1 is not available. Index fetch failed. Exception: Host name may not be null

http://wiki.apache.org/solr/SolrReplication says to hit the masterUrl with a browser to make sure it's right; a response status OK is a must. When I hit mymaster:myport/solr/mycorename/replication with a browser, I get the response status OK. When I hit mymaster:myport/solr/mycorename, I get a 404.

An extensive Google search didn't yield anything definitive on how to set a master URL and have Solr not trim the word 'replication'.

Is there something I'm missing in my config(s) that makes Solr strip the trailing /replication from masterUrl? Is there a way I can configure the master to have a replication URL that doesn't require trailing /replication?

Thanks

도움이 되었습니까?

해결책

I realize this is a bit old, but some pointers if you're still working on it:

don't add the /replication to your masterURL tag

Getting a 404 for mymaster:myport/solr/mycorename is normal.

If you have only one core, chances are you can set the master URL to just mymaster:myport/solr/

This is a pretty good reference as well: https://cwiki.apache.org/confluence/display/solr/Index+Replication

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top