> For the complete documentation index, see [llms.txt](https://documentation.alluxio.io/ee-da-cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.alluxio.io/ee-da-cn/security/ranger.md).

# Apache Ranger 集成

通过[Apache Ranger](https://ranger.apache.org/)，管理员能够对各类数据资源的权限策略进行集中管理。至于 Ranger 与 Alluxio 的集成，其具体方式会因不同用例而存在差异：

* **Ranger 在 HDFS 侧集成**：Alluxio 可正常与 HDFS 通信，Ranger 在 HDFS 层面执行访问权限管理，Alluxio 侧无需额外配置。
* **Ranger 在计算引擎（如 Spark 和 Trino）侧集成**：Ranger 在计算引擎侧进行权限管理，Alluxio 无需进行额外配置。
* **Ranger 作为 Alluxio 命名空间的授权工具**：目前，Alluxio 尚不支持 Ranger 对 Alluxio 命名空间访问权限管理。

## Ranger 作为 HDFS 的授权工具

当 Ranger 充当 HDFS 的授权工具时，Alluxio 与 HDFS 的通信保持正常状态。在此情况下，Ranger 负责在 HDFS 上实施访问权限管控，Alluxio 这一侧无需进行任何额外的配置工作，二者协同工作，确保整个数据访问流程在安全且稳定的权限管理下顺利开展。这种模式充分利用了 Ranger 在 HDFS 授权方面的功能，简化了 Alluxio 的配置复杂度，为数据资源的权限管理提供了高效的解决方案。

### 允许 Alluxio 访问启用 Ranger 的 HDFS

如果要让 Alluxio 能够访问启用了Ranger的HDFS，可为 Alluxio 进程用户（如`alluxio`）配置 Ranger 策略，并授予必要的权限。

**总结**：当 Ranger 在 HDFS 侧开展访问权限管理工作时，Alluxio 可照常运行，无需任何特殊配置。

## Ranger 与 计算引擎 (Spark, Trino) 侧集成

Spark 和 Trino 等计算引擎与 Ranger 集成后，可在内部执行访问控制策略：

* \*\*Trino：\*\* Trino coordinator 会在执行查询之前检查并执行 Ranger 中定义的策略，确保用户拥有合理的权限。
* \*\*Spark：\*\* Spark 经配置后可与 Ranger 集成，并执行相应的访问策略。

Alluxio 作为数据缓存层，不执行表级别或 schema 级别的策略。由于 Alluxio 对表无感知，因此不会直接与 schema 级别的数据交互，也不会执行表的相关策略。

**总结**：当 Spark 和 Trino 等计算引擎与 Ranger 集成后，会在内部执行访问策略。在此类情况下，无需对Alluxio 进行额外配置。

## Ranger 在 Alluxio 命名空间级别的执行

Alluxio 命名空间提供了数据的统一视图和组织，可统一多个底层存储系统。目前 Alluxio 尚不支持在 Alluxio 命名空间级别直接集成 Ranger 进行权限的管理。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.alluxio.io/ee-da-cn/security/ranger.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
