Support Questions
Find answers, ask questions, and share your expertise

Installation failed of Ranger Admin HDP 2.4

Highlighted

Installation failed of Ranger Admin HDP 2.4

New Contributor

Our HDP deployment has been painfully upgraded from pre-HDP 1.9 to 2.4. We need table based user control, so I went through the steps outlined in Ambari to install Ranger. After fulfilling the prerequisites, I used to wizard to install the package, only to be met with an error which seems to point to an issue in the CLASSPATH, however everything seems to be in the right place. One odd thing I notice is that the script 'ranger_admin.py' is being executed from the directory:

var/lib/ambari-agent/cache/common-services/RANGER/0.4.0/

In HDP 2.4, rangers version is 0.5, I am wondering if it is missing the correct update packages?

It complains about the CLASSPATH, but I can not seem to get around it. Any help to solve this issue and move forward with installation would be appreciated. Thanks!

Following is the STDERR:

stderr: Traceback (most recent call last): File "/var/lib/ambari-agent/cache/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py", line 155, in <module> RangerAdmin().execute() File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 219, in execute method(env) File "/var/lib/ambari-agent/cache/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py", line 42, in install setup_ranger_db() File "/var/lib/ambari-agent/cache/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py", line 177, in setup_ranger_db user=params.unix_user, File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 154, in __init__ self.env.run() File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run self.run_action(resource, action) File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action provider_action() File "/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py", line 238, in action_run tries=self.resource.tries, try_sleep=self.resource.try_sleep) File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 70, in inner result = function(command, **kwargs) File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 92, in checked_call tries=tries, try_sleep=try_sleep) File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 140, in _call_wrapper result = _call(command, **kwargs_copy) File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 291, in _call raise Fail(err_msg) resource_management.core.exceptions.Fail: Execution of 'python /usr/hdp/current/ranger-admin/dba_script.py -q' returned 1. 2017-01-13 14:31:24,366 [I] Running DBA setup script. QuiteMode:True 2017-01-13 14:31:24,366 [I] Using Java:/usr/jdk64/jdk1.7.0_45/bin/java 2017-01-13 14:31:24,366 [I] DB FLAVOR:MYSQL 2017-01-13 14:31:24,366 [I] DB Host:namenode.localdomain 2017-01-13 14:31:24,366 [I] ---------- Verifing DB root password ---------- 2017-01-13 14:31:24,367 [I] DBA root user password validated 2017-01-13 14:31:24,367 [I] ---------- Verifing Ranger Admin db user password ---------- 2017-01-13 14:31:24,367 [I] admin user password validated 2017-01-13 14:31:24,367 [I] ---------- Creating Ranger Admin db user ---------- 2017-01-13 14:31:24,367 [JISQL] /usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://namenode.localdomain/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();" Cannot find the driver class "com.mysql.jdbc.Driver" in the current classpath. 2017-01-13 14:31:24,487 [E] Can't establish db connection.. Exiting..

6 REPLIES 6
Highlighted

Re: Installation failed of Ranger Admin HDP 2.4

@Spencer Kuhl

The above stack trace shows the error message as "Cannot find the driver class "com.mysql.jdbc.Driver" in the current classpath. 2017-01-13 14:31:24,487 [E] Can't establish db connection.. Exiting.."

Did you copy the mysql driver jar ?

Highlighted

Re: Installation failed of Ranger Admin HDP 2.4

@spencer kuhl

As part of installation - you will have to install mysql connector and set that in ambari by running the command. you can find the documentation at

https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.0/bk_Ranger_Install_Guide/content/configuring...

Highlighted

Re: Installation failed of Ranger Admin HDP 2.4

New Contributor

Hi Apappu,

Yes, I have verified that we have the mysql connector in

/usr/share/java/mysql-connector-java.jar

I have also ran the following command before attempting installation

ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar

This is part of the reason why the error message was so confusing, I thought everything was in place.

Highlighted

Re: Installation failed of Ranger Admin HDP 2.4

New Contributor

@apappu

I can not seem to find a simple solution to this problem. Are there any major issues involved with completely removing ranger from ambari and trying the installation over again to see if something was configured incorrectly?

http://stackoverflow.com/questions/34163185/how-to-completelly-remove-ranger-admin-server-and-ranger...

Highlighted

Re: Installation failed of Ranger Admin HDP 2.4

Super Collaborator
@Spencer Kuhl

According to the command line I see /usr/share/java/mysql-connector-java.jar is include with java -cp so it is definitely that path is exists. But can you please make sure if it is a link to an existing jar file like below

[hdp1 ~]$ ls -l /usr/share/java/mysql-connector-java.jar
lrwxrwxrwx 1 root root 31 Jun  7  2016 /usr/share/java/mysql-connector-java.jar -> mysql-connector-java-5.1.17.jar
 
Highlighted

Re: Installation failed of Ranger Admin HDP 2.4

New Contributor

I can verify that a link exists to an existing file.

/usr/share/java/mysql-connector-java.jar -> mysql-connector-java-5.1.17.jar
Don't have an account?