Created on 10-17-2016 04:57 PM - edited 08-17-2019 08:47 AM
Pre-requisite :
Remove the incubator-ranger project from eclipse if it's already there and close the eclipse.
For example : git clone https://github.com/apache/incubator-ranger.git
For example : export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64
For example : cd /usr/local wget http://mirror.fibergrid.in/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz tar xvf apache-maven-3.3.9-bin.tar.gz
Set maven command line tool in the system path environment variable:
For example : export M2_HOME=/usr/local/apache-maven-3.3.9 export M2=$M2_HOME/bin export PATH=$M2:$PATH
Note : vim /etc/profile and add above export path variables there or add them in current user profile i.e .bashrc. Reconnect from the terminal to see changes. Remove older version of maven from machine to avoid maven version conflicts.
For example : mvn clean compile package install assembly:assembly
To add eclipse related config and dependency execute :
For example : mvn eclipse:eclipse
=> After clicking on properties menu; property window shall appear for the ranger-admin module.
=> On this window click on -> Java Build Path -> Libraries tab as shown below on attached screen, scroll down and select spring library of which version need to be changed. Note : In this article, we shall cover case for the spring-bean library only but you need to change the version of all 4 libraries mentioned in the previous step.
=> After selecting the spring-bean jar click on Edit button which is appearing at the right side of the screen. After clicking on edit button ‘edit variable entry’ prompt window shall appear as shown below on attached screen.
=> Click on Extension... button and select spring-beans-3.1.3.RELEASE.jar library as shown in attached screen below;
=> Click on OK button to confirm and save the changes.
=> Similarly change the version of spring-context, spring-core and spring-web libraries.
agents-common/pom.xml :
Replace : <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> with : <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${mysql-connector-java.version}</version> </dependency>
pom.xml
Remove : <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${mysql-connector-java.version}</version> <scope>test</scope> </dependency>
security-admin/pom.xml
Remove : <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <version>${springframework.spring.version}</version> </dependency>
security-admin/src/main/resources/conf.dist/ranger-admin-site.xml
Replace: <property> <name>ranger.audit.solr.urls</name> <value>http://##solr_host##:6083/solr/ranger_audits</value> <description></description> </property> with : <property> <name>ranger.audit.solr.urls</name> <value>http://localhost:6083/solr/ranger_audits</value> <description></description> </property>
Replace : <property> <name>ranger.audit.source.type</name> <value>db</value> <description></description> </property> With : <property> <name>ranger.audit.source.type</name> <value>solr</value> <description></description> </property>
Also make sure ranger admin db is setup and credentials are configured properly in below given properties :
<property> <name>ranger.jpa.jdbc.url</name> <value>jdbc:log4jdbc:mysql://localhost/ranger</value> <description></description> </property> <property> <name>ranger.jpa.jdbc.user</name> <value>rangeradmin</value> <description></description> </property> <property> <name>ranger.jpa.jdbc.password</name> <value>rangeradmin</value> <description></description> </property>
security-admin/src/main/webapp/META-INF/applicationContext.xml
Replace : <value>classpath:core-site.xml</value> <value>classpath:ranger-admin-default-site.xml</value> <value>classpath:ranger-admin-site.xml</value> With : <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>
security-admin/src/main/webapp/WEB-INF/log4j.properties
Add below line after 'log4j.rootLogger = warn,xa_log_appender' logdir=/tmp
security-admin/src/main/webapp/WEB-INF/web.xml
Replace : <context-param> <param-name>contextConfigLocation</param-name> <param-value>META-INF/applicationContext.xml WEB-INF/classes/conf/security-applicationContext.xml META-INF/scheduler-applicationContext.xml</param-value> </context-param> With : <context-param> <param-name>contextConfigLocation</param-name> <param-value>META-INF/applicationContext.xml WEB-INF/classes/conf/security-applicationContext.xml META-INF/scheduler-applicationContext.xml</param-value> </context-param>