更新时间:2022-09-30 GMT+08:00
分享

客户端和服务端配置

SparkSQL权限管理功能相关的配置如下所示,客户端与服务端的配置相同。要使用表权限功能,需要在服务端和客户端添加如下配置。
  • “spark-defaults.conf”配置文件
    表1 参数说明(1)

    参数

    描述

    默认值

    spark.sql.authorization.enabled

    是否开启datasource语句的权限认证功能。建议将此参数修改为true,开启权限认证功能。

    true

  • “hive-site.xml”配置文件
    表2 参数说明(2)

    参数

    描述

    默认值

    hive.metastore.uris

    Hive组件中MetaStore服务的地址,如“thrift://10.10.169.84:21088,thrift://10.10.81.37:21088”

    -

    hive.metastore.sasl.enabled

    MetaStore服务是否使用SASL安全加固。表权限功能需要设置为“true”

    true

    hive.metastore.kerberos.principal

    Hive组件中MetaStore服务的Principal,如“hive/hadoop.<系统域名>@<系统域名>”。

    hive-metastore/_HOST@EXAMPLE.COM

    hive.metastore.thrift.sasl.qop

    开启SparkSQL权限管理功能后,需将此参数设置为“auth-conf”

    auth-conf

    hive.metastore.token.signature

    MetaStore服务对应的token标识,设为“HiveServer2ImpersonationToken”

    HiveServer2ImpersonationToken

    hive.security.authenticator.manager

    Hive客户端授权的管理器,需设为“org.apache.hadoop.hive.ql.security.SessionStateUserGroupAuthenticator”

    org.apache.hadoop.hive.ql.security.SessionStateUserMSGroupAuthenticator

    hive.security.authorization.enabled

    是否开启客户端的授权,需设为“true”

    true

    hive.security.authorization.createtable.owner.grants

    将哪些权限赋给创建表的owner,建议设置为“ALL”

    ALL

  • MetaStore服务的core-site.xml配置文件
    表3 参数说明 (3)

    参数

    描述

    默认值

    hadoop.proxyuser.spark.hosts

    允许Spark用户伪装成来自哪些host的用户,需设为“*”,代表所有节点。

    -

    hadoop.proxyuser.spark.groups

    允许Spark用户伪装成哪些用户组的用户,需设为“*”,代表所有用户组。

    -

分享:

    相关文档

    相关产品