如何让 SolrCloud 使用 HTTPS 创建集合?

How to make SolrCloud use HTTPS for creating collections?

我正在 Windows Server 2016 上设置 SolrCloud 7.2.1,遵循入门指南:https://lucene.apache.org/solr/guide/7_2/getting-started-with-solrcloud.html#GettingStartedwithSolrCloud-InteractiveStartup

我必须指定主机,因为出于某种原因 SOLR_HOST 变量没有任何作用。本地主机一直在尝试。 所以指定主机,一切正常,直到必须创建一个新的集合。 由于某种原因,我收到以下错误:

ERROR: Failed to create collection 'collectionname' due to: {solrurl:8984_solr=org.apache.solr.client.solrj.SolrServerException:IOException occured when talking to server at: http://solrurl:8984/solr, solrurl:8983_solr=org.apache.solr.client.solrj.SolrServerException:IOException occured when talking to server at: http://solrurl:8983/solr}

这里有点纳闷,不明白为什么用HTTP而不是HTTPS

我可以毫无问题地使用 HTTPS 调用 URL。 在 Solr Web 界面中创建新集合时,会发生相同的错误。 SOLR_SSL_ENABLED 变量设置为 true。

那么我该如何改变这种行为呢?我必须事先做些什么才能让 Solr 接受对 solr.in.cmd 和 solr.in.sh 的更改吗?

如果您想通过 SSL 使用节点间通信,您必须 tell Solr to use that first before bringing the nodes up

您可以使用捆绑的 zkcli 工具先设置集群 属性:

server/scripts/cloud-scripts/zkcli.sh -zkhost localhost:2181 -cmd clusterprop -name urlScheme -val https