问题
Need help to configure shardsWhitelist in Solr 6.6. I have the below line in Solr.xml
<str name="shardsWhitelist">${solr.shardsWhitelist:}</str>
And I added the following in solrconfig.xml
<requestHandler name="/select" class="solr.SearchHandler">
<shardHandler class="HttpShardHandlerFactory">
<int name="socketTimeOut">1000</int>
<int name="connTimeOut">5000</int>
<str name="shardsWhitelist">https://<URL1>/solr/core0,<URL2>/solr/core0,<URL3>/solr/core0</str>
</shardHandler>
But, I can’t get the solr to acknowledge the configuration:
HttpShardHandlerFactory shardsWhitelist not configured but required (in lieu of ZkController and ClusterState) when using the 'shards' parameter. set -Dsolr.disable.shardsWhitelist=true to disable shards whitelist checks
回答1:
Make sure to NOT use https/http.
${solr.shardsWhitelist::PORT/solr/CORENAME,:PORT/solr/CORENAME}
Example: ${solr.shardsWhitelist:something.com:8985/solr/core_0,something.com:8985/solr/core2}
回答2:
You must specify the shardHandlerFactory
element.
The shardHandler
element is incorrect.
<requestHandler name="/select" class="solr.SearchHandler">
<shardHandlerFactory class="HttpShardHandlerFactory">
<int name="socketTimeOut">1000</int>
<int name="connTimeOut">5000</int>
<str name="shardsWhitelist"><URL1>/solr/core0,<URL2>/solr/core0,<URL3>/solr/core0</str>
</shardHandlerFactory>
来源:https://stackoverflow.com/questions/59036314/configuring-shardswhitelist-in-solr-6-6