Presto之hive.hdfs.impersonation.enabled & hive.hdfs.wire-encryption.enabled

当hive.hdfs.impersonation.enabled设为true时,Presto会使用hive.hdfs.presto.principal指定的用户代理客户端与HDFS交互,文件属组为客户端用户。若设为false,则直接用该principal用户交互。hive.hdfs.wire-encryption.enabled为true则数据传输加密。配置涉及到的包括core-site中的代理白名单和数据传输安全设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一. hive.hdfs.impersonation.enabled

     1. hive.hdfs.impersonation.enabled设置为true后,Presto将使用hive.hdfs.presto.principal设置的用户去代理客户端用户与hdfs进行交互,但是hdfs端看到的用户都是客户端用户,因此如果创建文件,那么文件的属组将为客户端用户。如果hive.hdfs.impersonation.enabled=false,则Presto将直接使用hive.hdfs.presto.principal设置的用户与hdfs进行交互,所以如果新建文件,文件的数组将为hive.hdfs.presto.principal用户。

      2. hive.hdfs.impersonation.enabled的实现原理是通过创建访问Hdfs的Ugi来控制的。如果hive.hdfs.impersonation.enabled为true,则创建ProxyUGI:UserGroupInformation.createProxyUser(user, hadoopAuthentication.getUserGroupInformation()) ,如果为false,则直接使用hadoopAuthentication.getUserGroupInformation()的UGI访问hdfs。

      3. hive.hdfs.presto.principal可以代理哪些用户,是由core-site文件中的hadoop.proxyuser.xxx.hosts和hadoop.proxyuser.xxx.groups控制的,如果不在core-site中开放代理的白名单,Presto通过RPC连接hdfs的时候,将提示xxx is not allowed to impersonate yyy的错误。

二. hive.hdfs.wire-encryption.enabled

     1. hive.hdfs.wire-encryption.enabled配置的含义是指的是DataNode与客户端之间传递数据时候,是否会进行加密。如果将hive.hdfs.wire-encryption.enabled设置为true,Presto在访问hdfs时候会将配置dfs.encrypt.data.transfer设置为true和hadoop.rpc.protection设置为privacy实现Presto与DataNode之间数据传递加密。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值