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

Ranger does not connect to Hive in HDP 2.4,

Ranger does not connect to Hive in HDP 2.4,

We enabled Hive plugin for Ranger, but when I test the connection, it fails .

/var/log/ranger/admin/xa_portal.log log shows the following error , when I try to test the connection to Hive .

2016-07-14 17:24:32,006 [timed-executor-pool-0] INFO org.apache.ranger.plugin.client.BaseClient (BaseClient.java:104) - Init Login: security not enabled, using username 2016-07-14 17:24:32,006 [timed-executor-pool-0] INFO apache.ranger.services.hive.client.HiveClient (HiveClient.java:75) - Since Password is NOT provided, Trying to use UnSecure client with username and password 2016-07-14 17:24:32,077 [timed-executor-pool-0] ERROR apache.ranger.services.hive.client.HiveResourceMgr (HiveResourceMgr.java:51) - <== HiveResourceMgr.testConnection Error: org.apache.ranger.plugin.client.HadoopException: Unable to execute SQL [show databases like "*"]. 2016-07-14 17:24:32,078 [timed-executor-pool-0] ERROR org.apache.ranger.services.hive.RangerServiceHive (RangerServiceHive.java:58) - <== RangerServiceHive.validateConfig Error:org.apache.ranger.plugin.client.HadoopException: Unable to execute SQL [show databases like "*"]. 2016-07-14 17:24:32,078 [timed-executor-pool-0] ERROR org.apache.ranger.biz.ServiceMgr$TimedCallable (ServiceMgr.java:434) - TimedCallable.call: Error:org.apache.ranger.plugin.client.HadoopException: Unable to execute SQL [show databases like "*"]. 2016-07-14 17:24:32,078 [http-bio-6080-exec-9] ERROR org.apache.ranger.biz.ServiceMgr (ServiceMgr.java:120) - ==> ServiceMgr.validateConfig Error:java.util.concurrent.ExecutionException: org.apache.ranger.plugin.client.HadoopException: Unable to execute SQL [show databases like "*"].

10 REPLIES 10

Re: Ranger does not connect to Hive in HDP 2.4,

Hi @Anilkumar Panda

It looks like you aren't providing a password "Since Password is NOT provided, Trying to use UnSecure client with username and password" - are you connecting to Hive via beeline?

Re: Ranger does not connect to Hive in HDP 2.4,

I am getting this error when I try to check the connectivity to the repo .

5856-rangerhiveconnection.png

Interestingly, if I configure policies , those reflect back on the HDP cluster .

Re: Ranger does not connect to Hive in HDP 2.4,

May i know if it is secure cluster?

if it is secure cluster then following link may be helpful

https://github.com/abajwa-hw/security-workshops/blob/master/Setup-ranger-22.md#setup-hdfs-repo-in-ra...

Re: Ranger does not connect to Hive in HDP 2.4,

Hi @deepak sharma No it is not a secured cluster .

Re: Ranger does not connect to Hive in HDP 2.4,

can you please check share the repo config screenshot? and please validate if username password is correct in repo config

Re: Ranger does not connect to Hive in HDP 2.4,

can you please check if there is a default policy maintained for hive user

Re: Ranger does not connect to Hive in HDP 2.4,

Hi @deepak sharma , I am not sure where to look for this ? Can you please guide me .

I can see, some policies in the Ranger Access Manager.

5892-ranger2.png

I assign some users access here, and try them on beeline, it works.Eg in the above screenshot, the user besides amabri-qa is able to access,(view tables, select etc) via beeline console .

However on this page .

5893-rangerhiveconnection.png

. I am not able to connect to hive. I am able to make a successful connection to Yarn and HDFS .

Re: Ranger does not connect to Hive in HDP 2.4,

can you please add "hive" user in the policy for resource database=*,table=*, i guess first policy is your default policy

screen-shot-2016-07-21-at-121835-am.png

Re: Ranger does not connect to Hive in HDP 2.4,

New Contributor

2016-12-15 19:31:54,727 [timed-executor-pool-0] ERROR org.apache.hive.jdbc.HiveConnection (HiveConnection.java:588) - Error opening session org.apache.thrift.TApplicationException: Required field 'client_protocol' is unset! Struct:TOpenSessionReq(client_protocol:null, configuration:{use:database=default}) at org.apache.thrift.TApplicationException.read(TApplicationException.java:111) at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:71) at org.apache.hive.service.cli.thrift.TCLIService$Client.recv_OpenSession(TCLIService.java:156) at org.apache.hive.service.cli.thrift.TCLIService$Client.OpenSession(TCLIService.java:143) at org.apache.hive.jdbc.HiveConnection.openSession(HiveConnection.java:578) at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:192) at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105) at java.sql.DriverManager.getConnection(DriverManager.java:571) at java.sql.DriverManager.getConnection(DriverManager.java:215) at org.apache.ranger.services.hive.client.HiveClient.initConnection(HiveClient.java:466) at org.apache.ranger.services.hive.client.HiveClient.access$100(HiveClient.java:45) at org.apache.ranger.services.hive.client.HiveClient$2.run(HiveClient.java:80) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:356) at org.apache.ranger.services.hive.client.HiveClient.initHive(HiveClient.java:78) at org.apache.ranger.services.hive.client.HiveClient.<init>(HiveClient.java:60) at org.apache.ranger.services.hive.client.HiveClient.testConnection(HiveClient.java:554) at org.apache.ranger.services.hive.client.HiveResourceMgr.testConnection(HiveResourceMgr.java:49) at org.apache.ranger.services.hive.RangerServiceHive.validateConfig(RangerServiceHive.java:56) at org.apache.ranger.biz.ServiceMgr$ValidateCallable.actualCall(ServiceMgr.java:484) at org.apache.ranger.biz.ServiceMgr$ValidateCallable.actualCall(ServiceMgr.java:471) at org.apache.ranger.biz.ServiceMgr$TimedCallable.call(ServiceMgr.java:432) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 2016-12-15 19:31:54,727 [timed-executor-pool-0] ERROR apache.ranger.services.hive.client.HiveResourceMgr (HiveResourceMgr.java:51) - <== HiveResourceMgr.testConnection Error: org.apache.ranger.plugin.client.HadoopException: Unable to connect to Hive Thrift Server instance. 2016-12-15 19:31:54,728 [timed-executor-pool-0] ERROR org.apache.ranger.services.hive.RangerServiceHive (RangerServiceHive.java:58) - <== RangerServiceHive.validateConfig Error:org.apache.ranger.plugin.client.HadoopException: Unable to connect to Hive Thrift Server instance. 2016-12-15 19:31:54,728 [timed-executor-pool-0] ERROR org.apache.ranger.biz.ServiceMgr$TimedCallable (ServiceMgr.java:434) - TimedCallable.call: Error:org.apache.ranger.plugin.client.HadoopException: Unable to connect to Hive Thrift Server instance. 2016-12-15 19:31:54,728 [http-bio-6080-exec-10] ERROR org.apache.ranger.biz.ServiceMgr (ServiceMgr.java:120) - ==> ServiceMgr.validateConfig Error:java.util.concurrent.ExecutionException: org.apache.ranger.plugin.client.HadoopException: Unable to connect to Hive Thrift Server instance.

can you help me ? i tests connections in ranger.I deploy ranger by ambari.

thank you very much @

Ryan Cicak

,

2016-12-15 19:31:54,727 [timed-executor-pool-0] ERROR org.apache.hive.jdbc.HiveConnection (HiveConnection.java:588) - Error opening session org.apache.thrift.TApplicationException: Required field 'client_protocol' is unset! Struct:TOpenSessionReq(client_protocol:null, configuration:{use:database=default}) at org.apache.thrift.TApplicationException.read(TApplicationException.java:111) at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:71) at org.apache.hive.service.cli.thrift.TCLIService$Client.recv_OpenSession(TCLIService.java:156) at org.apache.hive.service.cli.thrift.TCLIService$Client.OpenSession(TCLIService.java:143) at org.apache.hive.jdbc.HiveConnection.openSession(HiveConnection.java:578) at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:192) at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105) at java.sql.DriverManager.getConnection(DriverManager.java:571) at java.sql.DriverManager.getConnection(DriverManager.java:215) at org.apache.ranger.services.hive.client.HiveClient.initConnection(HiveClient.java:466) at org.apache.ranger.services.hive.client.HiveClient.access$100(HiveClient.java:45) at org.apache.ranger.services.hive.client.HiveClient$2.run(HiveClient.java:80) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:356) at org.apache.ranger.services.hive.client.HiveClient.initHive(HiveClient.java:78) at org.apache.ranger.services.hive.client.HiveClient.<init>(HiveClient.java:60) at org.apache.ranger.services.hive.client.HiveClient.testConnection(HiveClient.java:554) at org.apache.ranger.services.hive.client.HiveResourceMgr.testConnection(HiveResourceMgr.java:49) at org.apache.ranger.services.hive.RangerServiceHive.validateConfig(RangerServiceHive.java:56) at org.apache.ranger.biz.ServiceMgr$ValidateCallable.actualCall(ServiceMgr.java:484) at org.apache.ranger.biz.ServiceMgr$ValidateCallable.actualCall(ServiceMgr.java:471) at org.apache.ranger.biz.ServiceMgr$TimedCallable.call(ServiceMgr.java:432) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 2016-12-15 19:31:54,727 [timed-executor-pool-0] ERROR apache.ranger.services.hive.client.HiveResourceMgr (HiveResourceMgr.java:51) - <== HiveResourceMgr.testConnection Error: org.apache.ranger.plugin.client.HadoopException: Unable to connect to Hive Thrift Server instance. 2016-12-15 19:31:54,728 [timed-executor-pool-0] ERROR org.apache.ranger.services.hive.RangerServiceHive (RangerServiceHive.java:58) - <== RangerServiceHive.validateConfig Error:org.apache.ranger.plugin.client.HadoopException: Unable to connect to Hive Thrift Server instance. 2016-12-15 19:31:54,728 [timed-executor-pool-0] ERROR org.apache.ranger.biz.ServiceMgr$TimedCallable (ServiceMgr.java:434) - TimedCallable.call: Error:org.apache.ranger.plugin.client.HadoopException: Unable to connect to Hive Thrift Server instance. 2016-12-15 19:31:54,728 [http-bio-6080-exec-10] ERROR org.apache.ranger.biz.ServiceMgr (ServiceMgr.java:120) - ==> ServiceMgr.validateConfig Error:java.util.concurrent.ExecutionException: org.apache.ranger.plugin.client.HadoopException: Unable to connect to Hive Thrift Server instance.

can you help me ? i tests connections in ranger.I deploy ranger by ambari.

thank you very much @

Ryan Cicak