Created on 10-18-2018 08:29 PM - edited 08-17-2019 08:37 PM
When querying Hive table from Zeppelin notebook using spark2 interpreter, I can show tables in Hive without error using the following commands:
%spark2
val sqlContext = new org.apache.saprk.sql.hive.HiveContext(sc)
val tables = sqlContext.sql("show tables")
tables.show(2)
But I cannot query Hive table, when I tried to run the following statement, got error:
sqlContext.sql("select * from t1 LIMIT 10").collect().foreach(println)
java.lang.IllegalArgumentException:java.net.UnknownHostException: dev (see attached image for more info)
My cluster name is Dev. Is that due to case-sensitive?
Created 10-19-2018 08:58 AM
Is 'dev' your nameservice name of HDFS ? If yes, please make sure HADOOP_CONF_DIR is set in zeppelin-env or just copy core-site.xml and hdfs-site.xml to Zeppelin conf directory.
Hope this helps.
Created 10-19-2018 12:09 PM
In addition to Sandeep's comment,
Can you also check the following:
Possible Cause:
1. If your "/etc/hosts" file contains correct FQDN (fully qualified domain name) and IP addresse information.
2. It can also happen due to DNS setup issues. So please check if the namenode host is resolved to correct domain.
In some cases it can happen when the "hadoop.security.token.service.use_ip" property is set to "false"
Can for testing can you try setting it to "true" once as following to see if it helps:
hadoop.security.token.service.use_ip=true
hadoop.security.token.service.use_ip (default=true) is needed if your network is setup such that you need to use hostnames in delegation tokens instead of ip addresses.
When (hadoop.security.token.service.use_ip = true) there is a lookup done on the IP address of the sender, which is compared to the SPN in the token.
You can add this property inside your "core-site.xml"
For more information on this please refer to:
Reference:
[1] https://github.com/apache/hadoop/blob/release-2.9.0-RC0/hadoop-common-project/hadoop-common/src/main...
[2] https://community.hortonworks.com/content/supportkb/49544/hdfs-client-fails-with-unknownhostexceptio...
Created 11-08-2018 08:41 AM
Are you able to resolve this issue?