Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Ranger - Unable to re-install

avatar
Expert Contributor

Ranger Version: 0.5.0.2.4

Ambari version :2.2.2.1

HDP Version: 2.4.0

I Installed successfully for the first time and I am trying to re-install in Ranger on the same cluster. Before re-installing I ran these commands to clean up.


    // get the service
curl -u admin:admin -X GET  http://localhost:8080/api/v1/clusters/dx/services/RANGER

// stop the service
curl -u admin:admin -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo":{"context":"Stop Service"},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' http://localhost:8080/api/v1/clusters/dx/services/RANGER

// delete the service
curl -u admin:admin -H 'X-Requested-By: ambari' -X DELETE http://localhost:8080/api/v1/clusters/dx/services/RANGER

While re-installing it says unable to connect to the database. MySQL is located on the same host where Ranger is being installed. Do I have to clean up some of the properties or folder structure before re-installing ?

[root@usw2dxdpmn01 ~]# /usr/java/default/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://ranger/mysql -u rangeradmin -p xxxxxxx
SQLException : SQL state: 08S01 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure


The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. ErrorCode: 0

I tried with mysql and I am able to connect.

[root@usw2dxdpmn01 ~]# mysql -urangeradmin -pxxxxxxx
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 47
Server version: 5.1.73 Source distribution


Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Any help ,pointers is highly appreciated.

1 ACCEPTED SOLUTION

avatar
Expert Contributor

I resolved the problem by dropping the ranger folder under /usr/hdf/2.4.0/ranger-*

View solution in original post

2 REPLIES 2

avatar
Super Collaborator

Not sure about the Ranger re-installation, but it looks like the MySQL SQLException is occurring because you have left out the server name in the -cstring option.

avatar
Expert Contributor

I resolved the problem by dropping the ranger folder under /usr/hdf/2.4.0/ranger-*