Hive客户端出现HiveHook错误
一、错误内容
hive.exec.post.hooks Class not found: org.apache.atlas.hive.hook.HiveHook FAILED: Hive Internal Error: java.lang.ClassNotFoundException(org.apache.atlas.hive.hook.HiveHook) java.lang.ClassNotFoundException: org.apache.atlas.hive.hook.HiveHook at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at org.apache.hadoop.hive.ql.hooks.HooksLoader.getHooks(HooksLoader.java:103) at org.apache.hadoop.hive.ql.hooks.HooksLoader.getHooks(HooksLoader.java:64) at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:2006) at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1613) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1332) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1321) at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:239) at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:187) at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:409) at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:838) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:774) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:701) 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:313) at org.apache.hadoop.util.RunJar.main(RunJar.java:227)
二、解决
首先将/opt/module/atlas/hook/hive目录下的所有Jar包复制到/opt/cloudera/parcels/CDH/lib/hive/lib。
然后重启HiveServer2即可。
参考博客:https://blog.csdn.net/fairynini/article/details/112017684