Created 11-05-2015 04:11 AM
Initial attempt to Add Ranger service to running HDP 2.3.2 cluster managed with Ambari 2.1.2 on Redhat 7.1, Oracle JDK 8 and Oracle 12C backend database for Ranger.
ambari ranger DB test connection successful but failed to connect database @step 6 with following error.
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. 2015-11-04 11:46:19,927 [I] Running DBA setup script. QuiteMode:True 2015-11-04 11:46:19,927 [I] Using Java:/usr/java/default/bin/java 2015-11-04 11:46:19,927 [I] DB FLAVOR:ORACLE 2015-11-04 11:46:19,927 [I] DB Host:roadrunner.example.com 2015-11-04 11:46:19,927 [I] ---------- Creat ing Ranger Admin db user ---------- 2015-11-04 11:46:19,927 [I] Checking connection SQLException : SQL state: 08006 java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection ErrorCode: 17002 2015-11-04 11:46:20,196 [E] Can't establish connection,Change configuration or Contact Administrator!!Following procedure and followed to re-add ranger service.1) curl -i -uadmin:admin -H "X-Requested-By: ambari" -d '{"HostRoles": { "state": "UNKNOWN"}}' -X DELETE "http://hdpqa001.example.com:8080/api/v1/clusters/hdpclu/services/RANGER"; HTTP/1.1 200 OK User: admin Set-Cookie: AMBARISESSIONID=1aul0secz52361k6uhu9akhjbd;Path=/;HttpOnly Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: text/plain Content-Length: 0 Server: Jetty(8.1.17.v20150415)2) Ambari add Ranger service wizard.------ Multiple attempts failed at stage 6 with a error popup "server error"What is best approach to cleanup and add Ranger service. Or Any debug options to collect Add service process logs to understand error.
Created 11-05-2015 04:14 AM
You have to check the listener settings for oracle. Please see this
Make sure that you are providing the correct service name or sid
IO Error: The Network Adapter could not establish the connection ErrorCode: 17002 2015-11-04 11:46:20,196 [E] Can't establish connection,Change configuration or Contact Administrator!!
Ranger cleanup from db
curl --user admin:admin -i -H "X-Requested-By: ambari" -X DELETE http://`hostname -f`:8080/api/v1/clusters/<cluster name>/services/RANGER
[root@nsfed01 ~]# psql dbname username
Password for user ambari: password given when you did ambari-server setup
psql (8.4.20)
Type "help" for help.
ambari=>
ambari=#
ambari=> delete from hostcomponentstate where component_name like '%RANGER%';
DELETE 1
ambari=> delete from hostcomponentdesiredstate where component_namelike '%RANGER%';
DELETE 1
ambari=> delete from servicecomponentdesiredstate where component_namelike '%RANGER%';
DELETE 1
ambari=> commit;
WARNING: there is no transaction in progress
COMMIT
ambari=> \q
Refresh browser and restart ambari.
Created 11-05-2015 04:14 AM
You have to check the listener settings for oracle. Please see this
Make sure that you are providing the correct service name or sid
IO Error: The Network Adapter could not establish the connection ErrorCode: 17002 2015-11-04 11:46:20,196 [E] Can't establish connection,Change configuration or Contact Administrator!!
Ranger cleanup from db
curl --user admin:admin -i -H "X-Requested-By: ambari" -X DELETE http://`hostname -f`:8080/api/v1/clusters/<cluster name>/services/RANGER
[root@nsfed01 ~]# psql dbname username
Password for user ambari: password given when you did ambari-server setup
psql (8.4.20)
Type "help" for help.
ambari=>
ambari=#
ambari=> delete from hostcomponentstate where component_name like '%RANGER%';
DELETE 1
ambari=> delete from hostcomponentdesiredstate where component_namelike '%RANGER%';
DELETE 1
ambari=> delete from servicecomponentdesiredstate where component_namelike '%RANGER%';
DELETE 1
ambari=> commit;
WARNING: there is no transaction in progress
COMMIT
ambari=> \q
Refresh browser and restart ambari.
Created 11-05-2015 01:40 PM
@Neeraj after this incident we corrected SID and ambari add service wizard failing to finish with error at stage 6 "Server Error". Opened support case for Ambari SME support to cleanup and redo add service.
Created 11-05-2015 03:15 PM
Thanks for taking time to update the thread