Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

HDP 2.3, Kerberos, Ranger. HDFS works as per policies. Hive/beeline fails with java connection errors


HDP 2.3, Kerberos, Ranger. HDFS works as per policies. Hive/beeline fails with java connection errors


connected using beeline

0. !connect jdbc:hive2://;principal=hive/

1. describe auto_policy_text; ===> works successfully

2. select * from auto_policy_text limit 10 ==> fails. There are no Kerberos tgt errors from what I see. EArlier there were some GSS errors and I as able to take care of them...

Any ideas?

35 rows selected (0.042 seconds) 0: jdbc:hive2://> select age from default.auto_policy_text; Getting log thread is interrupted, since query is done! Error: Connection refused (state=,code=0) org.apache.hive.service.cli.HiveSQLException: Connection refused at org.apache.hive.jdbc.Utils.verifySuccess( at org.apache.hive.jdbc.Utils.verifySuccessWithInfo( at at org.apache.hive.beeline.BufferedRows.<init>( at org.apache.hive.beeline.BeeLine.print( at org.apache.hive.beeline.Commands.execute( at org.apache.hive.beeline.Commands.sql( at org.apache.hive.beeline.BeeLine.dispatch( at org.apache.hive.beeline.BeeLine.execute( at org.apache.hive.beeline.BeeLine.begin( at org.apache.hive.beeline.BeeLine.mainWithInputRedirection( at org.apache.hive.beeline.BeeLine.main( at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( at sun.reflect.DelegatingMethodAccessorImpl.invoke( at java.lang.reflect.Method.invoke( at at org.apache.hadoop.util.RunJar.main( Caused by: org.apache.hive.service.cli.HiveSQLException: Connection refused at org.apache.hive.service.cli.operation.SQLOperation.getNextRowSet( at org.apache.hive.service.cli.operation.OperationManager.getOperationNextRowSet( at org.apache.hive.service.cli.session.HiveSessionImpl.fetchResults( at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke( at java.lang.reflect.Method.invoke( at org.apache.hive.service.cli.session.HiveSessionProxy.invoke( at org.apache.hive.service.cli.session.HiveSessionProxy.access$000( at org.apache.hive.service.cli.session.HiveSessionProxy$ at Method) at at at org.apache.hive.service.cli.session.HiveSessionProxy.invoke( at com.sun.proxy.$Proxy35.fetchResults(Unknown Source) at org.apache.hive.service.cli.CLIService.fetchResults( at org.apache.hive.service.cli.thrift.ThriftCLIService.FetchResults( at org.apache.hive.service.cli.thrift.TCLIService$Processor$FetchResults.getResult( at org.apache.hive.service.cli.thrift.TCLIService$Processor$FetchResults.getResult( at org.apache.thrift.ProcessFunction.process( at org.apache.thrift.TBaseProcessor.process( at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$TUGIAssumingProcessor.process( at org.apache.thrift.server.TThreadPoolServer$ at java.util.concurrent.ThreadPoolExecutor.runWorker( at java.util.concurrent.ThreadPoolExecutor$ at Caused by: Connection refused at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow( at org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow( at org.apache.hadoop.hive.ql.exec.FetchTask.fetch( at org.apache.hadoop.hive.ql.Driver.getResults( at org.apache.hive.service.cli.operation.SQLOperation.getNextRowSet( ... 24 more Caused by: Connection refused at org.apache.hadoop.crypto.key.kms.KMSClientProvider.addDelegationTokens( at org.apache.hadoop.crypto.key.KeyProviderDelegationTokenExtension.addDelegationTokens( at org.apache.hadoop.hdfs.DistributedFileSystem.addDelegationTokens( at at at at org.apache.hadoop.mapred.FileInputFormat.listStatus( at org.apache.hadoop.mapred.FileInputFormat.getSplits( at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextSplits( at org.apache.hadoop.hive.ql.exec.FetchOperator.getRecordReader( at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow( ... 28 more Caused by: Connection refused at Method) at at at at at at at at at<init>( at at at at at at at at at at at at at org.apache.hadoop.crypto.key.kms.KMSClientProvider$ at org.apache.hadoop.crypto.key.kms.KMSClientProvider$ at Method) at at at org.apache.hadoop.crypto.key.kms.KMSClientProvider.addDelegationTokens( ... 38 more


Re: HDP 2.3, Kerberos, Ranger. HDFS works as per policies. Hive/beeline fails with java connection errors


Hello @sudhir nallagangu,

From the error stack, it looks like you have KMS configured and the KMS client is not able to connect to KMS server. Are you actually using KMS? If not, then please disable that. If yes, then please check:

1. If KMS service is up & running. And you can connect to KMS service on port 9292. 2. If these two properties are set to "kms://http@(kmshostname):9292/kms"

HDFS > Configs > Advanced core-site > HDFS > Configs > Advanced hdfs-site > dfs.encryption.key.provider.uri

3. On KMS host, the /etc/ranger/kms/conf directory should have a symlink to /etc/hadoop/conf/core-site.xml file. If not, please create this symlink and restart KMS service.

Also check for any error in KMS log file at /var/log/ranger/kms/kms.log.

Hope this helps !


Re: HDP 2.3, Kerberos, Ranger. HDFS works as per policies. Hive/beeline fails with java connection errors


Thanks Vipin

I was confused by KMS messages in log as well. I am not using KMS though. The initial install failed and I removed KMS using from the setup (used REST API to remove KMS service). So my assumption is there is no more KMS in setup unless there are some remainder pieces that are not removed using REST API. Ambari UI does not show KMS up service and REST API get on running services do not show KMS either.



Don't have an account?
Coming from Hortonworks? Activate your account here