报错内容
Logging initialized using configuration in file:/usr/bigtop/3.2.0/etc/hive/conf.dist/hive-log4j2.properties Async: true
Exception in thread "main" java.lang.RuntimeException: java.io.IOException: Previous writer likely failed to write hdfs://hadoop0001:8020/tmp/hive/hive/_tez_session_dir/620ac4b7-02a8-4e4f-a057-e1a409ba4ad4-resources/hcatalog-core.jar. Failing because I am unlikely to write too.
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:683)
at org.apache.hadoop.hive.ql.session.SessionState.beginStart(SessionState.java:591)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:747)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:683)
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:323)
at org.apache.hadoop.util.RunJar.main(RunJar.java:236)
Caused by: java.io.IOException: Previous writer likely failed to write hdfs://hadoop0001:8020/tmp/hive/hive/_tez_session_dir/620ac4b7-02a8-4e4f-a057-e1a409ba4ad4-resources/hcatalog-core.jar. Failing because I am unlikely to write too.
at org.apache.hadoop.hive.ql.exec.tez.DagUtils.localizeResource(DagUtils.java:1191)
at org.apache.hadoop.hive.ql.exec.tez.DagUtils.addTempResources(DagUtils.java:1042)
at org.apache.hadoop.hive.ql.exec.tez.DagUtils.localizeTempFilesFromConf(DagUtils.java:931)
at org.apache.hadoop.hive.ql.exec.tez.TezSessionState.ensureLocalResources(TezSessionState.java:610)
at org.apache.hadoop.hive.ql.exec.tez.TezSessionState.openInternal(TezSessionState.java:287)
at org.apache.hadoop.hive.ql.exec.tez.TezSessionState.beginOpen(TezSessionState.java:256)
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:680)
... 9 more
文件目录权限已经设置过的
hdfs dfs -chmod -R 777 /tmp/hive
查询了好多解决方案,主要来自 ambari-9821, 15年的问题了,距离现在8年了, 现在的代码早已更新
而且最新的代码已经更新脚本 HIVE_AUX_JARS_PATH
[AMBARI-9821] Need to update HIVE_AUX_JARS_PATH in hive-env.sh - ASF JIRA
然后看到 16398这条问题
[HIVE-16398] [Hive on Tez] Jar Localization issues - ASF JIRA
1) If a jar is already present in the classpath and is added again via aux.jars or using add jar command by the user.
2) If the jar is missing- Ideally it should ignore or either throw a error/warning stating jar not found.
3) When a "*" is present in some of the classpath entries, it will try to replicate the same * path on hdfs and fails.
通过第3条*号这个提醒, 检查了一下文件是否存在
export HIVE_AUX_JARS_PATH=${HIVE_AUX_JARS_PATH}
export HIVE_AUX_JARS_PATH=/usr/bigtop/current/hive-webhcat/share/hcatalog/hive-hcatalog-core-*.jar
export HIVE_AUX_JARS_PATH=/usr/bigtop/current/hive-webhcat/share/hcatalog/hcatalog-core.jar
发现ls: cannot access /usr/bigtop/current/hive-webhcat/: No such file or directory
说明这个目录不存在, 从其它服务器copy这个目录到当前执行的客户机, 解决了问题.