Solr / CDH 下启用kerberos 开启http 权限验证的solrj开发

时间:2022-06-11 20:46:04

前提:最近用的CDH 下solr的高可用查询,由于开启了kerberos必须要http权限验证。而且必须采用solrj的CloudSolrServer。在研究一天之后,找到可行方案。直接上干货,希望后来者有所帮助。


参考文献:
https://hc.apache.org/httpcomponents-client-ga/httpclient/examples/org/apache/http/examples/client/ClientAuthentication.java
http://*.com/questions/21696651/java-http-authentification- 401-error-with-httpclient-library
http://wiki.apache.org/solr/LBHttpSolrServer