开源大数据集群部署(十)Rangerusersync部署

云的事随心讲 2024-02-23 18:55:46

作者:櫰木

ranger usersync部署

解压包

[root@hd1.dtstack.com ranger]# pwd/opt/ranger[root@hd1.dtstack.com ranger]# tar -zxvf ranger-2.3.0-usersync.tar.gz -C /opt/[root@hd1.dtstack.com ranger]# cd ranger-2.3.0-usersync

修改配置install.properties,需要修改内容如下:

POLICY_MGR_URL = http://hd1.dtstack.com:6080SYNC_INTERVAL = 5rangerUsersync_password=Ranger@123usersync_principal=rangerusersync/hd1.dtstack.com@DTSTACK.COMusersync_keytab=/etc/security/keytab/rangerusersync.keytabhadoop_conf=/opt/hadoop/etc/hadoop

初始化

[root@hd2.dtstack.com ranger-2.3.0-usersync]# ./setup.sh

启动

[root@hd2.dtstack.com ranger-2.3.0-usersync]# ranger-usersync start

验证

页面验证是否安装成功:在Ranger控制台可以看到users中同步的用户信息。

FQA

问题一

在install.properties中的keytab必须配置以下principal的

usersync_principal=rangerusersync/hd1.dtstack.com@DTSTACK.COMusersync_keytab=/etc/security/keytab/rangerusersync.keytab

由于这个有两种认证方式。帐号密码和keytab的方式。用户必须为rangerusersync这个特定帐号,其他帐号会出现无法获取json的情况。问题2

需要注意rangeradmin的install.properties中的keytab和principal必须一致。不然会出现此错误

集成ldap 使其同步ldap用户到ranger

1、修改配置

cd /opt/ranger-2.3.0-usersync/SYNC_SOURCE = ldapSYNC_LDAP_URL = ldap://hd.dtstack.com:389SYNC_LDAP_BIND_DN = uid=admin,cn=users,cn=accounts,dc=dtstack,dc=comSYNC_LDAP_BIND_PASSWORD = Admin@123SYNC_LDAP_DELTASYNC =SYNC_LDAP_SEARCH_BASE = cn=accounts,dc=dtstack,dc=comSYNC_LDAP_USER_S EARCH_BASE = cn=users,cn=accounts,dc=dtstack,dc=comSYNC_LDAP_USER_SEARCH_SCOPE = subSYNC_LDAP_USER_OBJECT_CLASS = personSYNC_LDAP_USER_SEARCH_FILTER =SYNC_LDAP_USER_NAME_ATTRIBUTE = uidSYNC_LDAP_USER_GROUP_NAME_ATTRIBUTE = memberof,ismemberofSYNC_LDAP_USERNAME_CASE_CONVERSION=lowerSYNC_LDAP_GROUPNAME_CASE_CONVERSION=lower SYNC_GROUP_SEARCH_ENABLED= trueSYNC_GROUP_USER_MAP_SYNC_ENABLED= trueSYNC_GROUP_SEARCH_BASE= cn=groups,cn=accounts,dc=dtstack,dc=com

SYNC_LDAP_URL #ldpa地址SYNC_LDAP_BIND_DN #查询用户SYNC_LDAP_BIND_PASSWORD #密码SYNC_LDAP_SEARCH_BASE #搜索域SYNC_LDAP_USER_SEARCH_BASE #搜索用户的域SYNC_LDAP_USER_NAME_ATTRIBUTE #用户名属性SYNC_GROUP_SEARCH_BASE #搜索组的域

通过ldapsearch进行查询

ldapsearch -x -H ldap://hd.dtstack.com:389 -b cn=users,cn=accounts,dc=dtstack,dc=com -D "uid=admin,cn=users,cn=accounts,dc=dtstack,dc=com" -w Admin@123

配置完成后,执行setup.sh生成新的配置确认ranger.usersync.enabled 为truecat conf/ranger-ugsync-site.xml

<property> <name>ranger.usersync.enabled</name> <value>true</value></property>

2、重启ranger-usersync执行ranger-usersync restart查看ranger页面确认用户是否同步上来

更多技术信息请查看云掣官网

0 阅读:0

云的事随心讲

简介:感谢大家的关注