Ubuntu16.04安装Ranger2.1.0

1.编译ranger项目

git clone https://github.com/apache/ranger.git
cd ranger
git checkout -b release-ranger-2.1.0 release-ranger-2.1.0
mvn clean package -DskipTests -Drat.skip=true

需要注意的是,ranger2.1.0编译的时候,maven的版本需要大于3.6.0,否则会出现下面报错

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (enforce-versions) on project ranger: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

编译成功

编译后可以看出target目录下的文件如下

 

2.安装ranger

创建linux ranger用户和组

sudo groupadd ranger
sudo useradd ranger -g ranger -r --no-log-init -d /var/lib/ranger
sudo mkdir /var/lib/ranger
sudo mkdir /var/run/ranger
sudo chown -R ranger:ranger /var/lib/ranger
sudo chown -R ranger:ranger /var/run/ranger

解压ranger-2.1.0-admin.tar.gz

tar -zxvf ranger-2.1.0-admin.tar.gz -C ~/software

由于ranger依赖Mysql数据库,所以需要有一个mysql环境

在准备好mysql之后,编译配置install.properties,添加如下内容

db_root_user=root
db_root_password=xxxx
db_host=localhost

db_name=ranger
db_user=ranger
db_password=ranger

#audit_store=solr

然后使用root用户运行,该脚本将会初始化mysql里面的用户和表,以及系统os上的ranger用户,命令等

root@master:~/software/ranger-2.1.0-admin# ./setup.sh

启动ranger,需要使用ranger用户,否则会报 -bash: ./ews/ranger-admin-services.sh: 权限不够

sudo -iu ranger
ranger-admin start

停止

ranger-admin stop

之后访问 6080 端口,默认的账号密码都是admin

 

posted @ 2016-12-26 10:37  tonglin0325  阅读(1492)  评论(0编辑  收藏  举报