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

HIVE error- Unable to open a session

Solved Go to solution
Highlighted

HIVE error- Unable to open a session

New Contributor

When ever I tried to start a HIVE session I get the following error. I restarted hiveserver and ambari but no luck. Could any one please help me?

Thanks in advance

Ravi

Logging initialized using configuration in file:/etc/hive/2.5.0.0-1245/0/hive-log4j.properties Exception in thread "main" java.lang.RuntimeException: java.lang.IllegalArgumentException: java.net.UnknownHostException: sandbox at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:523) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:680) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:624) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.hadoop.util.RunJar.run(RunJar.java:233) at org.apache.hadoop.util.RunJar.main(RunJar.java:148) Caused by: java.lang.IllegalArgumentException: java.net.UnknownHostException: sandbox at org.apache.hadoop.security.SecurityUtil.buildTokenService(SecurityUtil.java:411) at org.apache.hadoop.hdfs.NameNodeProxies.createNonHAProxy(NameNodeProxies.java:311) at org.apache.hadoop.hdfs.NameNodeProxies.createProxy(NameNodeProxies.java:176) at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:688) at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:629) at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:159) at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2761) at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:99) at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2795) at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2777) at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:386) at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:179) at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:506) ... 8 more Caused by: java.net.UnknownHostException: sandbox ... 21 more

1 ACCEPTED SOLUTION

Accepted Solutions

Re: HIVE error- Unable to open a session

Super Collaborator
@Rav Reddy

UnknownHostException for hostname sandbox. Please verify that /etc/hosts or dns has the hostname entry "sandbox" on the host you are trying to use hive command. Like

#vi /etc/hosts

<IPAddre> sandbox.<FQDN> sandbox

4 REPLIES 4

Re: HIVE error- Unable to open a session

Super Collaborator
@Rav Reddy

UnknownHostException for hostname sandbox. Please verify that /etc/hosts or dns has the hostname entry "sandbox" on the host you are trying to use hive command. Like

#vi /etc/hosts

<IPAddre> sandbox.<FQDN> sandbox

Re: HIVE error- Unable to open a session

New Contributor

Thanks for your reply @rguruvannagari

/etc/hosts does have the sandbox entry. Please see the below code

[root@sandbox Lab7.2]# cat /etc/hosts
127.0.0.1       localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.2      sandbox.hortonworks.com

Re: HIVE error- Unable to open a session

Super Collaborator

Please set it as below and try

[root@sandbox Lab7.2]# cat /etc/hosts
127.0.0.1       localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.2      sandbox.hortonworks.com sandbox    #####added sandbox

Re: HIVE error- Unable to open a session

New Contributor

It worked Thanks @rguruvannagari

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