- Windows环境IDEA下Ranger1.2.0源码编译
- 一、本地环境准备
- 二、源码编译
- 三、使用idea打开项目
- 1. 安装数据库Mysql版
- 2. 配置Tomcat,发布 security-admin-web项目。
- 3. 修改security-admin中以下文件
- 4. 编译启动Tomcat即可。
- 四、遇到问题
- 专栏导航
- 其他专栏
- git(2.16.2)
- maven(3.6.1)
- idea(2020.1)
- python(2.7.18)
- Tomcat(7.0.105)
以上安装步骤均可以百度
二、源码编译用git clone 代码,Ranger官方版本1.2.0 仓库地址https://github.com/apache/ranger.git,
在cmd或者git bash 进入项目工程对应目录
使用如下命令编译源代码,注意编译超级费时间
mvn -DskipTests=true clean compile package install assembly:assembly
找到 security-admin-web模块,在安装脚本里security-admin/scripts/install.properties
找出mysql所需要的sql脚本db/mysql/optimized/current/ranger_core_db_mysql.sql
和db/mysql/xa_audit_db.sql
,安装数据库。数据库安装详细过程(略)。
-
src\main\resources\conf.dist\ranger-admin-site.xml中的
ranger.jpa.jdbc.url
,ranger.jpa.jdbc.user
,ranger.jpa.jdbc.password
ranger.jpa.jdbc.url jdbc:log4jdbc:mysql://127.0.0.1/ranger ranger.jpa.jdbc.user root ranger.jpa.jdbc.password 123456
-
src\main\webapp\META-INF\applicationContext.xml中的叫propertyConfigurer的bean
classpath:conf.dist/core-site.xml classpath:conf.dist/ranger-admin-default-site.xml classpath:conf.dist/ranger-admin-site.xml
1.python版本问题
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: Execute failed: java.io.IOException: Cannot run program "python" (in directory "E:\code\openSource\ranger\ranger-util"): CreateProcess error=2, 系统找不到指定的文件。
[ERROR] around Ant part ...... @ 4:48 in E:\code\openSource\ranger\ranger-util\target\antrun\build-main.xml
[ERROR] -> [Help 1]
解决方案: 安装Python 且要是2版本的。
-
Tomcat版本问题
org.apache.catalina.loader.VirtualWebappLoader
解决方案: 之前使用9版本的Tomcat ,改为7.0.105就可以了。
Ranger Admin组件 Ranger HDFS 组件、Ranger-usersync组件安装说明 Ranger admin web 模块分析之policy查询缓存
其他专栏Kafka专栏 数据结构 设计模式