1.主节点与备节点均已安装OpenLDAP且正常使用 2.集群已启用Kerberos  ###132.1 hive用户导入到OpenLDAP
[root@ip-172-31-24-169 ~]# vim group-hive.ldif
dn: cn=impala,ou=Group,dc=fayson,dc=com
objectClass: posixGroup
objectClass: top
cn: impala
userPassword: {SSHA}KYgsfyI/uny0dKPNeMRNG54BdwV6KlWA
gidNumber: 975
dn: cn=hive,ou=Group,dc=fayson,dc=com
objectClass: posixGroup
objectClass: top
cn: hive
userPassword: {SSHA}KYgsfyI/uny0dKPNeMRNG54BdwV6KlWA
gidNumber: 981
memberUid: impala

[root@ip-172-31-24-169 ~]# ldapadd -D "cn=Manager,dc=fayson,dc=com" -W -x -f group-hive.ldif

[root@ip-172-31-24-169 ~]# vim user-hive.ldif
dn: uid=hive,ou=People,dc=fayson,dc=com
uid: hive
cn: Hive
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {SSHA}KYgsfyI/uny0dKPNeMRNG54BdwV6KlWA
shadowLastChange: 17564
loginShell: /bin/false
uidNumber: 985
gidNumber: 981
homeDirectory: /var/lib/hive
gecos: Hive
dn: uid=impala,ou=People,dc=fayson,dc=com
uid: impala
cn: Impala
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {SSHA}KYgsfyI/uny0dKPNeMRNG54BdwV6KlWA
shadowLastChange: 17564
loginShell: /bin/bash
uidNumber: 979
gidNumber: 975
homeDirectory: /var/lib/impala
gecos: Impala

[root@ip-172-31-24-169 ~]# ldapadd -D "cn=Manager,dc=fayson,dc=com" -W -x -f user-hive.ldif

ldapsearch -D "cn=Manager,dc=fayson,dc=com" -W |grep hive
ldapsearch -D "cn=Manager,dc=fayson,dc=com" -W |grep impala

132.2 Hue集成OpenLDAP
    
- 保存以上配置后,在重启Hue服务前修改为
          - 用户登录测试
 - testldap用户可以正常登录

132.3 Hue集成Impala和Hive

- 通过CM在hue_safety_valve.ini中增加如下配置
[desktop]
ldap_username=hive
ldap_password=123456

<property>
<name>hadoop.proxyuser.hive.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hive.groups</name>
<value>*</value>
</property>

--authorized_proxy_user_config=hive=*
 ###132.4 未同步到Hue的用户登录测试与Hue集成功能验证
- 使用faysontest2用户直接登录Hue测试是否会在登录的时候自动创建LDAP用户。
[root@ip-172-31-24-169 ldap]# id faysontest2
uid=1999(faysontest2) gid=1989(faysontest2) groups=1989(faysontest2)
[root@ip-172-31-24-169 ldap]# more /etc/passwd |grep faysontest2
[root@ip-172-31-24-169 ldap]#
- testldap用户查看faysontest2用户不存在
 - 用faysontest2用户登录Hue
  - 可以看到faysontest2用户已被同步
 - 同步hive的LDAP用户
  - 同步hive的LDAP组
  - 更新hive用户的用户组为hive
  - 使用hive用户登录
  
大数据视频推荐: CSDN 人工智能算法竞赛实战 AIops智能运维机器学习算法实战 ELK7 stack开发运维实战 PySpark机器学习从入门到精通 AIOps智能运维实战 大数据语音推荐: ELK7 stack开发运维 企业级大数据技术应用 大数据机器学习案例之推荐系统 自然语言处理 大数据基础 人工智能:深度学习入门到精通
|