Apache Ranger 2.4.0 安装部署

1、安装ranger admin

2、源码编译Ranger

wget https://www.apache.org/dist/ranger/2.4.0/apache-ranger-2.4.0.tar.gz

tar zxvf apache-ranger-2.4.0.tar.gz

cd apache-ranger-2.4.0

mvn -Pall clean

mvn clean package -DskipTests

maven settting可以设置阿里云进行资源下载加速

复制代码
    <mirror>
      <id>alimaven</id>
          <name>aliyun maven</name>
          <url>https://maven.aliyun.com/nexus/content/groups/public/</url>
          <mirrorOf>central</mirrorOf>
    </mirror>
    <mirror>
        <id>nexus-aliyun</id>
        <mirrorOf>central</mirrorOf>
        <name>Nexus aliyun</name>
        <url>https://maven.aliyun.com/repository/public</url>
    </mirror>

3、创建ranger用户

groupadd -g 1025 ranger

useradd -g ranger -u 1025 -d /home/ranger ranger

echo ranger:rangerpwd | chpasswd

mkdir -p /opt/ranger

su - ranger

4、配置install.properties文件

复制代码
tar -zxvf ranger-2.4.0-admin.tar.gz 


提前下载mysql connector:

wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.28/mysql-connector-java-8.0.28.jar



修改如下属性:

SQL_CONNECTOR_JAR=/opt/module/ranger/ranger-2.4.0-admin/mysql-connector-java-8.0.28.jar

db_root_user=root

db_root_password=root

db_host=localhost



db_name=ranger

db_user=rangeradmin

db_password=root



rangerAdmin_password=root

rangerTagsync_password=root

rangerUsersync_password=root

keyadmin_password=root


policymgr_external_url=http://localhost:6080


hadoop_conf=/BigData/run/hadoop/etc/hadoop

5、DB 权限处理

复制代码
GRANT ALL PRIVILEGES ON *.* TO 'rangeradmin'@'tv3-hadoop-01' identified by 'root';
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'%' identified by 'root';
GRANT ALL PRIVILEGES ON *.* TO 'rangeradmin'@'%' identified by 'root';
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'localhost' identified by 'root';
GRANT ALL PRIVILEGES ON *.* TO 'rangeradmin'@'localhost' identified by 'root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
flush privileges;

6、初始化ranger admin

./setup.sh

相关报错:

复制代码
2024-06-30 00:00:40,823  [I] Env filename : /etc/ranger/admin/conf/ranger-admin-env-logdir.sh
Traceback (most recent call last):
  File "db_setup.py", line 1451, in <module>
    main(sys.argv)
  File "db_setup.py", line 1418, in main
    run_env_file(env_file_path)
  File "db_setup.py", line 163, in run_env_file
    set_env_val(command)
  File "db_setup.py", line 152, in set_env_val
    (key, _, value) = line.partition("=")
TypeError: a bytes-like object is required, not 'str'

解决方案:

db_setup.py 152 行做下修改

复制代码
 #(key, _, value) = line.partition("=")
 (key, _, value) = line.decode('ascii').partition("=")

显示内容包括下面的话代表安装成功:

Installation of Ranger PolicyManager Web Application is completed

7、进行环境软连接

复制代码
[root@tv3-hadoop-01 ranger-2.4.0-admin]# ./set_globals.sh 
usermod: no changes
[2024/06/30 00:04:39]:  [I] Soft linking /etc/ranger/admin/conf to ews/webapp/WEB-INF/classes/conf
You have new mail in /var/spool/mail/root

8、服务启动

复制代码
启动服务

sudo -i -u ranger ranger-admin start
相关推荐
青云交6 分钟前
Java 大视界 -- Java 大数据在智能电网电力市场交易数据分析与策略制定中的关键作用(162)
java·大数据·数据分析·交易策略·智能电网·java 大数据·电力市场交易
宝哥大数据24 分钟前
Flink内存模型--flink1.19.1
大数据·flink
一个天蝎座 白勺 程序猿29 分钟前
大数据(4.5)Hive聚合函数深度解析:从基础统计到多维聚合的12个生产级技巧
大数据·hive·hadoop
小马爱打代码37 分钟前
Kafka - 消息零丢失实战
分布式·kafka
爱编程的王小美39 分钟前
用户行为分析系统开发文档
大数据
长河40 分钟前
Kafka系列教程 - Kafka 运维 -8
运维·分布式·kafka
白雪讲堂2 小时前
AI搜索品牌曝光资料包(精准适配文心一言/Kimi/DeepSeek等场景)
大数据·人工智能·搜索引擎·ai·文心一言·deepseek
浩浩kids3 小时前
Hadoop•踩过的SHIT
大数据·hadoop·分布式
qr9j422333 小时前
elasticsearch 如果按照日期进行筛选
大数据·elasticsearch·jenkins
DavidSoCool3 小时前
es分页边界数据重复问题处理
大数据·elasticsearch·搜索引擎