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

Unable to Install Ranger.

Unable to Install Ranger.

New Contributor

HDP - 3.1.1

Ranger - 1.2.0

 

I get this error: - 

Traceback (most recent call last):
  File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 150, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 314, in _call
    raise ExecutionFailed(err_msg, code, out, err)
ExecutionFailed: Execution of 'ambari-python-wrap /usr/hdp/current/ranger-admin/db_setup.py -changepassword  -pair admin [PROTECTED] [PROTECTED]  -pair rangerusersync [PROTECTED] [PROTECTED]  -pair rangertagsync [PROTECTED] [PROTECTED]  -pair keyadmin [PROTECTED] [PROTECTED] ' returned 1. 2020-03-27 02:43:03,104  [I] DB FLAVOR :MYSQL
2020-03-27 02:43:03,104  [I] --------- Verifying Ranger DB connection ---------
2020-03-27 02:43:03,104  [I] Checking connection..
2020-03-27 02:43:03,105  [JISQL] /opt/jdk/jdk1.8.0_241/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-connector-java-8.0.19.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://reportingservice-ambarisvr.eastus.cloudapp.azure.com/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \;  -query "select 1;"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2020-03-27 02:43:03,669  [I] Checking connection passed.
2020-03-27 02:43:03,669  [JISQL] /opt/jdk/jdk1.8.0_241/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-connector-java-8.0.19.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://reportingservice-ambarisvr.eastus.cloudapp.azure.com/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \;  -query "select version from x_db_version_h where version = 'DEFAULT_ALL_ADMIN_UPDATE' and active = 'Y';"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2020-03-27 02:43:04,233  [JISQL] /opt/jdk/jdk1.8.0_241/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-connector-java-8.0.19.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://reportingservice-ambarisvr.eastus.cloudapp.azure.com/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \;  -query "select version from x_db_version_h where version = 'DEFAULT_ALL_ADMIN_UPDATE' and active = 'N';"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2020-03-27 02:43:04,801  [JISQL] /opt/jdk/jdk1.8.0_241/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-connector-java-8.0.19.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://reportingservice-ambarisvr.eastus.cloudapp.azure.com/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \;  -query "insert into x_db_version_h (version, inst_at, inst_by, updated_at, updated_by,active) values ('DEFAULT_ALL_ADMIN_UPDATE', current_timestamp, 'Ranger 1.2.0.3.1.4.0-315', current_timestamp, 'reportingservice-ambarisvr.eastus.cloudapp.azure.com','N') ;"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2020-03-27 02:43:05,404  [I] Ranger all admins default password change request is in process..
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
[EL Severe]: 2020-03-27 02:43:40.359--ServerSession(358636931)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Connections could not be acquired from the underlying database!
Error Code: 0
[EL Severe]: ejb: 2020-03-27 02:43:40.366--ServerSession(358636931)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Connections could not be acquired from the underlying database!
Error Code: 0
[EL Severe]: 2020-03-27 02:44:10.874--ServerSession(358636931)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Connections could not be acquired from the underlying database!
Error Code: 0
[EL Severe]: ejb: 2020-03-27 02:44:10.875--ServerSession(358636931)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Connections could not be acquired from the underlying database!
Error Code: 0
2020-03-27 02:44:10,935  [JISQL] /opt/jdk/jdk1.8.0_241/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-connector-java-8.0.19.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://reportingservice-ambarisvr.eastus.cloudapp.azure.com/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \;  -query "delete from x_db_version_h where version = 'DEFAULT_ALL_ADMIN_UPDATE' and active = 'N' and updated_by='reportingservice-ambarisvr.eastus.cloudapp.azure.com';"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2020-03-27 02:44:11,523  [E] Ranger all admins default password change request failed

The above exception was the cause of the following exception:

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/RANGER/package/scripts/ranger_admin.py", line 258, in <module>
    RangerAdmin().execute()
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 352, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/RANGER/package/scripts/ranger_admin.py", line 114, in start
    self.configure(env, upgrade_type=upgrade_type, setup_db=params.stack_supports_ranger_setup_db_on_start)
  File "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/RANGER/package/scripts/ranger_admin.py", line 160, in configure
    params.keyadmin_username, params.default_keyadmin_user_password, params.keyadmin_user_password)
  File "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/RANGER/package/scripts/setup_ranger_xml.py", line 744, in setup_ranger_all_admin_password_change
    Execute(password_change_cmd, environment = env_dict, user = params.unix_user, tries = 3, try_sleep = 5, logoutput = True)
  File "/usr/lib/ambari-agent/lib/resource_management/core/base.py", line 166, in __init__
    self.env.run()
  File "/usr/lib/ambari-agent/lib/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/ambari-agent/lib/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/ambari-agent/lib/resource_management/core/providers/system.py", line 263, in action_run
    returns=self.resource.returns)
  File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 72, in inner
    result = function(command, **kwargs)
  File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 102, in checked_call
    tries=tries, try_sleep=try_sleep, timeout_kill_strategy=timeout_kill_strategy, returns=returns)
  File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 150, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 314, in _call
    raise ExecutionFailed(err_msg, code, out, err)
resource_management.core.exceptions.ExecutionFailed: Execution of 'ambari-python-wrap /usr/hdp/current/ranger-admin/db_setup.py -changepassword  -pair admin [PROTECTED] [PROTECTED]  -pair rangerusersync [PROTECTED] [PROTECTED]  -pair rangertagsync [PROTECTED] [PROTECTED]  -pair keyadmin [PROTECTED] [PROTECTED] ' returned 1. 2020-03-27 02:44:16,794  [I] DB FLAVOR :MYSQL
2020-03-27 02:44:16,794  [I] --------- Verifying Ranger DB connection ---------
2020-03-27 02:44:16,794  [I] Checking connection..
2020-03-27 02:44:16,794  [JISQL] /opt/jdk/jdk1.8.0_241/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-connector-java-8.0.19.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://reportingservice-ambarisvr.eastus.cloudapp.azure.com/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \;  -query "select 1;"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2020-03-27 02:44:17,359  [I] Checking connection passed.
2020-03-27 02:44:17,360  [JISQL] /opt/jdk/jdk1.8.0_241/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-connector-java-8.0.19.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://reportingservice-ambarisvr.eastus.cloudapp.azure.com/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \;  -query "select version from x_db_version_h where version = 'DEFAULT_ALL_ADMIN_UPDATE' and active = 'Y';"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2020-03-27 02:44:17,919  [JISQL] /opt/jdk/jdk1.8.0_241/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-connector-java-8.0.19.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://reportingservice-ambarisvr.eastus.cloudapp.azure.com/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \;  -query "select version from x_db_version_h where version = 'DEFAULT_ALL_ADMIN_UPDATE' and active = 'N';"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2020-03-27 02:44:18,475  [JISQL] /opt/jdk/jdk1.8.0_241/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-connector-java-8.0.19.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://reportingservice-ambarisvr.eastus.cloudapp.azure.com/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \;  -query "insert into x_db_version_h (version, inst_at, inst_by, updated_at, updated_by,active) values ('DEFAULT_ALL_ADMIN_UPDATE', current_timestamp, 'Ranger 1.2.0.3.1.4.0-315', current_timestamp, 'reportingservice-ambarisvr.eastus.cloudapp.azure.com','N') ;"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2020-03-27 02:44:19,059  [I] Ranger all admins default password change request is in process..
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
[EL Severe]: 2020-03-27 02:44:54.053--ServerSession(358636931)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Connections could not be acquired from the underlying database!
Error Code: 0
[EL Severe]: ejb: 2020-03-27 02:44:54.06--ServerSession(358636931)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Connections could not be acquired from the underlying database!
Error Code: 0
[EL Severe]: 2020-03-27 02:45:24.559--ServerSession(358636931)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Connections could not be acquired from the underlying database!
Error Code: 0
[EL Severe]: ejb: 2020-03-27 02:45:24.559--ServerSession(358636931)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Connections could not be acquired from the underlying database!
Error Code: 0
2020-03-27 02:45:24,619  [JISQL] /opt/jdk/jdk1.8.0_241/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-connector-java-8.0.19.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://reportingservice-ambarisvr.eastus.cloudapp.azure.com/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \;  -query "delete from x_db_version_h where version = 'DEFAULT_ALL_ADMIN_UPDATE' and active = 'N' and updated_by='reportingservice-ambarisvr.eastus.cloudapp.azure.com';"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2020-03-27 02:45:25,215  [E] Ranger all admins default password change request failed
3 REPLIES 3
Highlighted

Re: Unable to Install Ranger.

@Punjala 

 

First, do you have the mysql connector for java enabled?

 

To use MySQL with Ranger, you must download the https://dev.mysql.com/downloads/connector/j/ from MySQL. Once downloaded to the Ambari Server host, run: 
ambari-server setup --jdbc-db=mysql --jdbc-driver=/path/to/mysql/com.mysql.jdbc.Driver

 

Next, have you confirmed that ranger metastore database is setup, with user, password, and correct permissions from ranger host to metastore host?   In Ambari during Ranger Install, you can use the Test Connection to make sure this stuff works.

Highlighted

Re: Unable to Install Ranger.

Mentor

@Punjala 

There error message points to a driver MySQL driver but also warning of a newer driver  class is `com.mysql.cj.jdbc.Driver'  when posting your log try to strip it of you real host name  you never trust people out there!! reporxxxxxvice-ambarxxxxvr.xxxus.cloxxxpp.azure.com

 

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

 

Check the mysql-connect-java.jar is present

 

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

 

I always prefer to create  the database and strip the database of useless schemas and test my connectivity 
Create the Ranger database. Assuming you are using MySQl or MariaDB on the localhost where ranger is being installed, else you will need to specify a remote connecting. You must ensure that the host running your database is accessible. 

 

CREATE USER 'ranger'@'localhost' IDENTIFIED BY 'ranger';
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'localhost';
CREATE USER 'ranger'@'%' IDENTIFIED BY 'ranger';
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'%';
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'ranger'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

 

Log in as ranger database user with correct password

 

# mysql -uranger -pranger

 

Show availability of the ranger database

 

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| ranger             |
+--------------------+
2 rows in set (0.00 sec)

 

Test id ranger can create objects in the above database.

 

MariaDB [(none)]> use ranger;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed

 

Now when you are deploying the cluster you have all the inputs at hand and it will succeed.

Highlighted

Re: Unable to Install Ranger.

New Contributor

Same problem here.

Don't have an account?