1 Ranger Introduction
Apache Ranger provides a centralized security management framework that enables granular data access control for components such as hive,hbase for Hadoop ecosystems. By manipulating the Ranger console, administrators can easily configure policies to control user access to the HDFs folder, HDFs file, database, table, field permissions. These policies can be set for different users and groups, and permissions can be seamlessly interfaced with Hadoop.
2 Preparation
2.1 Environmental Description
1 Ranger source code compilation relies on the following Linux components: Maven,git,gcc,mysql
2 Installing git and gcc with yum installation, please configure Local source
3 Install MySQL is make sure to clean up the system comes with MySQL.
Linux system version in virtual machine
[Email protected] ranger-0.5.0-usersync]# cat/etc/issue | grep Linux
Red Hat Enterprise Linux Server release 6.5 (Santiago)
Java version
[Email protected] native]# java-version
Java version "1.7.0_67"
Note: The official website emphasizes that it must be 1.7 or higher.
Java (TM) SE runtimeenvironment (build 1.7.0_67-b01)
Java HotSpot (TM) 64-bitserver VM (build 24.65-b04, Mixed mode)
Version 2.1.3mysql
[Email protected] native]# mysql-uroot-proot-e "select version ()";
warning:using a password onthe command line interface can be insecure.
+-----------+
| Version () |
+-----------+
| 5.6.14 |
+-----------+
Note:
1 Mysql Drive for Mysql-connector-java-5.1.31-bin.jar
2 changed jar is renamed and placed in/usr/share/java/by other Ranger plugins
2.1.4 Maven Version
[Email protected] bin]# mvn-version
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9;2014-02-15t01:37:52+08:00)
Maven Home:/root/maven-3.2.1
Java version:1.7.0_67,vendor:oracle Corporation
Java Home:/root/jdk1.7.0_67/jre
Default Locale:en_us,platform Encoding:utf-8
OS name: "Linux", Version: "2.6.32-431.el6.x86_64", Arch: "AMD64", Family: "Unix"
2.1.5 git version
[[email protected] native]# git version
git version 1.7.1
2.2 Preparing for compilation
2.2.1 Installing MAVEN
[Email protected] ~]# cd/root
#
#https://maven.apache.org/download.cgi Latest Version
#http://apache.opencas.org/maven/binaries/apache-maven-3.2.1-bin.tar.gz
TAR–ZXVF apache-maven-3.2.1-bin.tar.gz
MV Apache-maven-3.2.1-bin maven-3.2.1
#修改环境变量, define Maven_home in ~/.bash_profile and append to Path
Export maven_home=/root/maven-3.2.1
: $MAVEN _home/bin: $PATH
#source环境变量, test the MAVEN version
SOURCE ~/.bash_profile
Mvn–version
2.2.2 Installing git
This is installed through the local source Yum method.
Yum Install git
2.2.3 Installing GCC
Yum Install GCC
2.2.4 Installing MySQL
1) Install MySQL service, client
RPM–IVH mysql-shared-5.6.14-1.el6.x86_64.rpm
RPM–IVH mysql-shared-compat-5.6.14-1.el6.x86_64.rpm
RPM–IVH mysql-server-5.6.14-1.el6.x86_64.rpm
RPM–IVH mysql-client-5.6.14-1.el6.x86_64.rpm
2) Start the MySQL service
Service MySQL Start
3) Modify the initial MySQL password, first find the initial password at the time of installation, in the change to their own password
[Email protected] ~]#cat/root/.mysql_secret
# The random password set for the root user at Tue Dec 2221:17:22 (local time):rumkbqcy
Mysql–uroot-p Rumkbqcy
Set Password=password (' root ')
3. Compiling
First to https://github.com/apache/incubator-ranger.gitclone down Ranger source code. (At that time because of proxy reasons in the terminal has been clone not down, helpless had to download the ZIP format in the web version)
After entering the Unzip folder directory, use the
export maven_opts= "-xmx512m" setting parameter, otherwise error: GC Overhead limit exceeded (however I set to 512 still not, changed to 1024)
MVN Clean Compile package assembly:assembly install-dmaven.test.skip=true;
The unit tests are all skipped here because some unit tests have problems that affect compilation.
There was an n-th problem in the middle. The specific changes are as follows:
Maven settings.xml file modifies the URL of the remote repository:
<mirror> <id>central_mirror</id> <url>http://repo1.maven.org/maven2/</url > <mirrorOf>central</mirrorOf> </mirror>
After that, modify the Pom file for the Ranger project root, as follows:
<repository> <id>apache.snapshots.https</id> <name>apache Development Snapshot Repository</name> <!--url>https://repository.apache.org/content/repositories/snapshots</ url--> <url>http://repo1.maven.org/maven2/</url> <snapshots> <enabled> true</enabled> </snapshots> </repository>
Other issues that have been encountered later have been written in other blogs, the main source of their own experience is too little, too young, there are a lot of problems.
Finally saw, moved all to cry ....
Find compiled and packaged files
LS target/*.tar.gz
The results are as follows:
4. Configuration
Ranger Store Logs in Solr, Rangeradmin UI relies on SOLR components to complete the audit log query, so you need to install and configure SOLR first
Note: the current (hdfs-plugin) test log audit did not choose SOLR mode, but the first configuration of standalone mode SOLR.
4.1 SOLR or Solrcloud installation configuration
Cd/root/incubator-ranger/security-admin/contrib/solr_for_audit_setup
#打开install the. properties file, the values for the modified parameters are as follows:
In fact, open the Install.properities file, you will find that the above settings have default values, and some may be commented out.
#安装单节点的solr
./setup.sh
#按照如下安装提示启动, Stop SOLR Services
Cat/opt/solr/ranger_audit_server/install_notes.txt
#启动solr
/opt/solr/ranger_audit_server/scripts/start_solr.sh
#验证solr服务是否可正常使用
lsof–i:6083
http://192.168.56.101:6083
#确保防火墙已经关闭
Chkconfig iptables off
4.2 Ranger Admin Installation Configuration
Cp/opt/ranger/incubator-ranger-master/target/ranger-0.6.0-snapshot-admin.tar.gz/opt
Cd/opt
You can see that the tar.gz file is already in the OPT directory
#安装Ranger Admin
./setup.sh
See the following results, but also tears ran, because MySQL has solved a lot of problems ....
#启动Ranger Admin Service
Ranger-admin start
#验证Ranger Admin Service, if the Ranger login interface appears, said okay. Note: username/password Admin/admin
lsof–i:6080
Visit page: http://localhost:6080, appeared, the installation was successful. Ha ha
User name: admin; Password: admin login to enter after, appear:
Temporarily, after the refinement of the continuation of the blog ... Hurry back ...
Apache Ranger0.6 Version source code compilation