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
相关推荐
Data跳动4 小时前
Spark内存都消耗在哪里了?
大数据·分布式·spark
woshiabc1115 小时前
windows安装Elasticsearch及增删改查操作
大数据·elasticsearch·搜索引擎
lucky_syq6 小时前
Saprk和Flink的区别
大数据·flink
lucky_syq6 小时前
流式处理,为什么Flink比Spark Streaming好?
大数据·flink·spark
袋鼠云数栈6 小时前
深入浅出Flink CEP丨如何通过Flink SQL作业动态更新Flink CEP作业
大数据
Java程序之猿6 小时前
微服务分布式(一、项目初始化)
分布式·微服务·架构
清平乐的技术专栏6 小时前
Hive SQL 查询所有函数
hive·hadoop·sql
来一杯龙舌兰6 小时前
【RabbitMQ】RabbitMQ保证消息不丢失的N种策略的思想总结
分布式·rabbitmq·ruby·持久化·ack·消息确认
小白学大数据7 小时前
如何使用Selenium处理JavaScript动态加载的内容?
大数据·javascript·爬虫·selenium·测试工具
15年网络推广青哥7 小时前
国际抖音TikTok矩阵运营的关键要素有哪些?
大数据·人工智能·矩阵