testbook

HiveServer2部署

LDAP认证模式

  • 部署LDAP服务器。
    参见:LDAP部署手册
  • 修改 hive-site.xml:
    属性
    hive.security.authorization.enabled true
    hive.metastore.execute.setugitrue
    hive.metastore.execute.setugitrue
    hive.security.authorization.createtable.owner.grantsALL
    hive.server2.enable.doAstrue
    hive.server2.authenticationLDAP
    hive.server2.authentication.ldap.urlldap://inceptor_server_ip
    hive.server2.authentication.ldap.baseDNou=Manager,dc=transwarp,dc=io
    hive.semantic.analyzer.hookorg.apache.hadoop.hive.ql.parse.SimpleAdminAuthSemanticAnalyzerHook
  • 重启Metastore和Inceptor Server:
    service hive-metastore-inceptor1 restart
    service hive-server-inceptor1 restart
    
  • 向 LDAP 中添加 Inceptor 普通用户(zhu) 及 超级用户(hive)
    参见:LDAP部署手册
  • 连接 Inceptor Server
    /usr/lib/hive/bin/beeline -u jdbc:hive2://inceptor_server_ip:10000 -n hive -p (password you set)
    
    或者
    /usr/lib/hive/bin/beeline
    beeline> !connect jdbc:hive2://inceptor_server_ip:10000
    
  • 为 zhu 赋予对 default 数据库创建表的权限
    grant create on database default to user zhu;
    
  • 取消上述权限
    revoke create on database default from user zhu;