问题一:
启动hive报错:SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Exception in thread “main” java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
解决方法:斜体部分冲突,删除其中一个
hadoop@zy-virtual-machine:/usr/local/hive$ cd /usr/local/hive/lib
hadoop@zy-virtual-machine:/usr/local/hive/lib$ rm log4j-slf4j-impl-2.10.0.jar
问题二:
启动hive依然报错:Exception in thread “main” java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
at org.apache.hadoop.conf.Configuration.set(Configuration.java:1357)
…
解决方法:hadoop和hive的两个guava.jar版本不一致,将低版本删除,高版本拷贝过去
hadoop@zy-virtual-machine:~$ cd /usr/local/hive/lib
hadoop@zy-virtual-machine:/usr/local/hive/lib$ rm guava-19.0.jar # 删除
hadoop@zy-virtual-machine:/usr/local/hadoop/share/hadoop/common/lib$ cp -a guava-27.0-jre.jar /usr/local/hive/lib/ # 拷贝
guava版本号.jar 事先查询一下自己目录下的,两个路径分别是:
/usr/local/hive/lib/
/usr/local/hadoop/share/hadoop/common/lib/
问题三:
运行建表或其他命令报错:FAILED: HiveException java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.me
解决方法:退出hive,执行下一行代码,初始化数据库
hive>exit; # 退出hive
hadoop@zy-virtual-machine:/usr/local/hive$ schematool -dbType mysql -initSchema
你是否还在寻找稳定的海外服务器提供商?创新互联www.cdcxhl.cn海外机房具备T级流量清洗系统配攻击溯源,准确流量调度确保服务器高可用性,企业级服务器适合批量采购,新人活动首月15元起,快前往官网查看详情吧