安装启动Hive过程中遇到的问题以及解决方法:

问题一:
启动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

你可能感兴趣的:(hive,hadoop,大数据)