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
相关推荐
皓7412 分钟前
服饰电商行业知识管理的创新实践与知识中台的重要性
大数据·人工智能·科技·数据分析·零售
Mephisto.java4 分钟前
【大数据学习 | kafka高级部分】kafka的kraft集群
大数据·sql·oracle·kafka·json·hbase
Mephisto.java6 分钟前
【大数据学习 | kafka高级部分】kafka的文件存储原理
大数据·sql·oracle·kafka·json
Hsu_kk43 分钟前
Hive 查询用户连续三天登录的所有记录
数据仓库·hive·hadoop
yx9o1 小时前
Kafka 源码 KRaft 模式本地运行
分布式·kafka
ycsdn101 小时前
Caused by: org.apache.flink.api.common.io.ParseException: Row too short:
大数据·flink
Gemini19951 小时前
分布式和微服务的区别
分布式·微服务·架构
G丶AEOM1 小时前
分布式——BASE理论
java·分布式·八股
DolphinScheduler社区2 小时前
Apache DolphinScheduler + OceanBase,搭建分布式大数据调度平台的实践
大数据
时差9533 小时前
MapReduce 的 Shuffle 过程
大数据·mapreduce