Objective
What Apache Ranger is, it is a centralized management framework for the Hadoop platform that provides comprehensive data security access control and monitoring, Apache top-level projects. No nonsense, in fact this article is not so big on, is a step by step teach you how to import Ranger source to idea, and run debugging its Web module.
Import source
- The first step of course is to download the source code, where the latest version of the 1.1.0
git clone https://github.com/apache/ranger.gitgit Checkout release-ranger-1.1.0
- Compile, choose to compile all here, of course, you can choose a specific module to compile, time will be relatively long
MVN Clean Compile package install assembly:assembly
- Add idea-related configurations and dependencies
MVN Idea:idea
- Direct import on the line, what? You won't even import it.
Run the Debug Security-admin Web module
First initialize the database, it is recommended to choose Mysql,postgresql I initialize the time reported n many wrong, directly give up.
Change Security-admin/src/main/resources/conf.dist/ranger-admin-site.xml
Configure audit logs, no SOLR can be used without the control
<property> <name>ranger.audit.solr.urls</name> <value>http://localhost:6083/ solr/ranger_audits</value> <description></description> </property> < property> <name>ranger.audit.source.type</name> <value>solr</value> <description></description>
Configure Ranger database and user name password
<property> <name>ranger.jpa.jdbc.url</name> <value>jdbc:log4jdbc:mysql:// localhost:3306/pranger3</value> <description></description> </property> <property> <name>ranger.jpa.jdbc.user</name> <value>admin</value> <description></description> </property> <property> <name> ranger.jpa.jdbc.password</name> <value>admin</value> <description></ Description> </property>
Configure Web. xml
There are two ways of doing this:
第一种
Security-admin/src/main/resources/conf.dist set to
resources
Directory
Modify Security-admin/src/main/webapp/web-inf/web.xml
<context-param> <param-name>contextConfigLocation</param-name> <param-value> Meta-inf/applicationcontext.xml Web-inf/classes/security-applicationcontext.xml Meta-inf/scheduler-applicationcontext.xml</param-value > </context-param>
Modify Security-admin/src/main/webapp/meta-inf/applicationcontext.xml
<property name= "Locations" > <list> <!--<value>classpath:xa_default.properties</ Value>- <!--<value>classpath:xa_system.properties</value>- <!--< Value>classpath:xa_custom.properties</value>- <!--<value>classpath:xa_ Ldap.properties</value>- <value>classpath:core-site.xml</value> <value> Classpath:ranger-admin-default-site.xml</value> <value>classpath:ranger-admin-site.xml</ value> </list> </property>
The second type only changes the configuration file
Modify Security-admin/src/main/webapp/web-inf/web.xml
<context-param> <param-name>contextConfigLocation</param-name> <param-value> Meta-inf/applicationcontext.xml Web-inf/classes/conf.dist/security-applicationcontext.xml meta-inf/scheduler-applicationcontext.xml</ param-value> </context-param>
Modify Security-admin/src/main/webapp/meta-inf/applicationcontext.xml
<property name= "Locations" > <list> <!--<value>classpath:xa_default.properties</ Value>- <!--<value>classpath:xa_system.properties</value>- <!--< Value>classpath:xa_custom.properties</value>- <!--<value>classpath:xa_ Ldap.properties</value>- <value>classpath:conf.dist/core-site.xml</value> < Value>classpath:conf.dist/ranger-admin-default-site.xml</value> <value>classpath:conf.dist/ ranger-admin-site.xml</value> </list> </property>
Add Tomcat
Then you can run the debug, enjoy the debug debugging it.
Apache Ranger 1.1.0 Source import idea and run Debug Security-admin Web module