如果启用了身份验证,则 Solr CDCR 不起作用



我在我的测试环境中设置了CDCR,它可以很好地工作直到上传security.json文件到目标和源的Zookeeper群集solrclouds。security.json文件对于两个云以及集合名称。来源有下一个错误:

Request to collection col01 failed due to (401) 
org.apache.solr.client.solrj.impl.CloudSolrClient$RouteException: Error from server at http://targethost:port/solr/col01_shard1_replica1: Expected mime type application/octet-stream but got text/html. <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 401 Unauthorized request, Response code: 401</title>
</head>
<body><h2>HTTP ERROR 401</h2>
<p>Problem accessing /solr/col01_shard1_replica1/update. Reason:
<pre>    Unauthorized request, Response code: 401</pre></p>
</body>
</html>
    at org.apache.solr.client.solrj.impl.CloudSolrClient.directUpdate(CloudSolrClient.java:819)
    at org.apache.solr.client.solrj.impl.CloudSolrClient.sendRequest(CloudSolrClient.java:1263)
    at org.apache.solr.client.solrj.impl.CloudSolrClient.requestWithRetryOnStaleState(CloudSolrClient.java:1134)
    at org.apache.solr.client.solrj.impl.CloudSolrClient.request(CloudSolrClient.java:1073)
    at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:160)
    at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:177)
    at org.apache.solr.handler.CdcrReplicator.sendRequest(CdcrReplicator.java:136)
    at org.apache.solr.handler.CdcrReplicator.run(CdcrReplicator.java:116)
    at org.apache.solr.handler.CdcrReplicatorScheduler.lambda$null$0(CdcrReplicatorScheduler.java:81)
    at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:229)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://targethost:port/solr/col01_shard1_replica1: Expected mime type application/octet-stream but got text/html. <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 401 Unauthorized request, Response code: 401</title>
</head>
<body><h2>HTTP ERROR 401</h2>
<p>Problem accessing /solr/col01_shard1_replica1/update. Reason:
<pre>    Unauthorized request, Response code: 401</pre></p>
</body>
</html>
    at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:578)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:279)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:268)
    at org.apache.solr.client.solrj.impl.LBHttpSolrClient.doRequest(LBHttpSolrClient.java:447)
    at org.apache.solr.client.solrj.impl.LBHttpSolrClient.request(LBHttpSolrClient.java:388)
    at org.apache.solr.client.solrj.impl.CloudSolrClient.lambda$directUpdate$0(CloudSolrClient.java:796)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    ... 4 more

知道我该如何修复?谢谢!

i遇到了相同的问题,看来Target Solrcloud正在尝试使用PKIAuthenticationPlugin从源中对传入请求进行身份验证,但是由于默认情况下,源节点均未在目标上注册,因此后者给出以下错误:

错误(QTP1265210847-32([]

在对PKIAuthenticationPlugin.java进行了一些调查之后,我发现以下代码会拒绝认证请求:

Public Key getRemotePublicKey(String nodename) {
  if(!cores.getZkController().getZkStateReader().getClusterState(). getLiveNodes().contains(nodename)) 
return null;
}

因此,为了克服这一点,我只是将源的节点名称(位于/live_nodes部分(添加到目标Zookeeper,然后复制开始使用两侧强制执行的security.json

最新更新