Apache Ranger 审核日志通过 SSL 与 Solr 云模式连接

发布于 2025-01-15 23:53:24 字数 1726 浏览 4 评论 0原文

我有三个节点,其中 Solr 和 ZooKeeper 启用了 TLS/SSL,其中 ZK 仅在 securePort 和 Solr - HTTPS 中侦听。

现在我想将 Solr 连接到 Apache Ranger 以获取审核日志 我正在设置:

ranger.audit.solr.urls = https://HOST1:8983/solr/ranger_audits

并且

ranger_admin_solr_zookeepers = HOST1:2281,HOST2:2281,HOST3:2281

Apache Ranger 不处于 SSL 模式,并且仅侦听 HTTP。

对于 Solr,我已成功创建同名的 ranger_audits 配置集和集合。 ZooKeeper 选举也成功,我有 1 个领导者和 2 个追随者。

因此,除了 Apache Ranger 审核通信之外,一切都按预期进行。 Apache Ranger的版本是2.0。 动物园管理员版本 - 3.6.3 Solr 版本 - 8.11.1

使用当前设置,在 Ranger UI 中打开审核选项卡时出现以下异常:

2022-03-22 06:54:08,189 [http-bio-6080-exec-2] INFO  org.apache.ranger.common.RESTErrorUtil (RESTErrorUtil.java:326) - Operation error. response=VXResponse={org.apache.ranger.view.VXResponse@7ef95c52statusCode={1} msgDesc={Error running solr query, please check solr configs. java.util.concurrent.TimeoutException: Could not connect to ZooKeeper HOST1:2281,HOST2:2281,HOST3:2281 within 15000 ms} messageList={[VXMessage={org.apache.ranger.view.VXMessage@3bd495a3name={ERROR_SYSTEM} rbKey={xa.error.system} message={System Error. Please try later.} objectId={null} fieldName={null} }]} }
javax.ws.rs.WebApplicationException

更新:

解决方案是提供 jaas.conf 和 java 属性来解决该问题。

-Dzookeeper.client.secure=true 
-Djava.security.auth.login.config=/etc/ranger/admin/conf/jaas.conf 

jaas.conf 的示例为:

Client {
   org.apache.zookeeper.server.auth.DigestLoginModule required
   username="admin"
   password="admin-pass";
};

请注意,这不是完整的解决方案,从 Ranger 到通过 HTTPS ZooKeepers 的连接仍然存在问题。

I have three nodes with Solr and ZooKeeper with enabled TLS/SSL where the ZK listen only in securePort and Solr - HTTPS.

Now I want to connect Solr to Apache Ranger for audit logs
where I am setting:

ranger.audit.solr.urls = https://HOST1:8983/solr/ranger_audits

and

ranger_admin_solr_zookeepers = HOST1:2281,HOST2:2281,HOST3:2281

The Apache Ranger is not in SSL mode and listen only on HTTP.

For Solr I have successfully create ranger_audits configset and collection with the same name.
ZooKeeper election is also successful where I have 1 leader and 2 followers.

So everything works as expected except the Apache Ranger audit communication.
The version of the Apache Ranger is 2.0.
ZooKeeper version - 3.6.3
Solr version - 8.11.1

With the current settings I get the following exception when open audit tab in Ranger UI:

2022-03-22 06:54:08,189 [http-bio-6080-exec-2] INFO  org.apache.ranger.common.RESTErrorUtil (RESTErrorUtil.java:326) - Operation error. response=VXResponse={org.apache.ranger.view.VXResponse@7ef95c52statusCode={1} msgDesc={Error running solr query, please check solr configs. java.util.concurrent.TimeoutException: Could not connect to ZooKeeper HOST1:2281,HOST2:2281,HOST3:2281 within 15000 ms} messageList={[VXMessage={org.apache.ranger.view.VXMessage@3bd495a3name={ERROR_SYSTEM} rbKey={xa.error.system} message={System Error. Please try later.} objectId={null} fieldName={null} }]} }
javax.ws.rs.WebApplicationException

UPDATE:

The solution is to provide jaas.conf and java properties which fixed the problem.

-Dzookeeper.client.secure=true 
-Djava.security.auth.login.config=/etc/ranger/admin/conf/jaas.conf 

The sample of the jaas.conf is:

Client {
   org.apache.zookeeper.server.auth.DigestLoginModule required
   username="admin"
   password="admin-pass";
};

Please note that this is not complete solution and the connection from Ranger to through HTTPS ZooKeepers is still problematic.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文