说明:ranger1.2.1 在集成LDAP使用过程中发现用户数据同步参数不生效,排查发现是一个bug。
    ranger.usersync.sleeptimeinmillisbetweensynccycle 默认是3600000 1h同步一次。实际生产不能满足。
    在ambari页面修改也不能生效。排查ranger日志发现并没有生效。
    具体可见 https://issues.apache.org/jira/browse/RANGER-681
    ugsync/src/main/java/org/apache/ranger/unixusersync/config/UserGroupSyncConfig.java 代码修改后 重新编译 打包 替换 class

    [
    Linux centos 安装 maven 3.5.4**](https://www.cnblogs.com/chuyi-/p/10655007.html)
    1.编译环境 maven 和jdk

    直接下载

    二、安装与部署
      1、maven 解压

    1
    2
    3
    4
    # maven 解压
    tar zvxf apache-maven-3.5.4-bin.tar.gz
    # 把maven转换到指定目录
    mv apache-maven-3.5.4 /usr/local/

      2、修改配置文件

    1
    2
    3
    4
    5
    # 打开全局配置文件
    vim /etc/profile
    # 添加maven全局配置参数
    export MAVEN_HOME=/usr/local/apache-maven-3.5.4/
    export PATH=$MAVEN_HOME/bin:$PATH# 让配置文件生效source /etc/profile

      3、查询是否成功

    1
    2
    # 查询maven版本号
    mvn —version

      4、配置阿里云镜像仓库

    • 如下图把参数放到对应参数下

    Ranger1.2.1+LDAP bug fix - 图1

    1
    2
    3
    4
    5
    6
    7
    # 配置参数

    alimaven
    aliyun maven
    http://maven.aliyun.com/nexus/content/groups/public/
    central

    说明: jdk1.8+、maven 3.3.3+

    Ranger1.2.1+LDAP bug fix - 图2

    Ranger1.2.1+LDAP bug fix - 图3
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (generate-version-annotation) on project ranger-util: An Ant BuildException has occured: exec returned: 1
    [ERROR] around Ant part …… @ 4:48 in /mnt/vdb/ranger-ranger-1.2/ranger-util/target/antrun/build-main.xml
    [ERROR] -> [Help 1]

    异常原因:
    yum -y install git

    编译命令:

    mvn clean compile package assembly:assembly install -DskipTests -Drat.skip=true

    Ranger1.2.1+LDAP bug fix - 图4
    ranger 1.2 集成ladp 同步用户信息 同步时间频率bug问题:

    1. Ranger
    2. RANGER-681

    Update default sync intervals for LDAP and UNIX

    https://issues.apache.org/jira/browse/RANGER-681

    https://reviews.apache.org/r/39078/diff/2/#0

    https://reviews.apache.org/r/39078/diff/2#0

    ugsync/src/main/java/org/apache/ranger/unixusersync/config/UserGroupSyncConfig.java

    ranger bug 修改:
    ranger-usersync/dist/unixusersync-1.2.0.3.1.0.0-78.jar 中 org.apache.ranger.unixusersync.config UserGroupSyncConfig class 文件

    [root@hdp2 usersync]# pwd
    /var/log/ranger/usersync
    [root@hdp2 usersync]# cat usersync.log|grep “LdapDeltaUserGroupBuilder updateSink started”

    Ranger1.2.1+LDAP bug fix - 图5

    修复好的jar可直接下载替换使用
    unixusersync-1.2.0.3.1.0.0-78.jar

    然后重启 RANGER USERSYNC 这个服务就ok