初始化hive元数据仓库失败

目录

报错内容

报错原因

解决方案


报错内容

which: no hbase in (/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/root/bin:/opt/jdk/bin:/opt/jdk/bin:/opt/zookeeper/bin:/opt/jdk/bin:/opt/zookeeper/bin:/opt/hadoop/bin:/opt/hadoop/sbin:/opt/jdk/bin:/opt/zookeeper/bin:/opt/hadoop/bin:/opt/hadoop/sbin:/opt/hive/bin)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/hive/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.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]
Metastore connection URL:	 jdbc:mysql://shi1:3306/hive?createDatabaseIfNotExist=true
Metastore Connection Driver :	 com.mysql.jdbc.Driver
Metastore connection User:	 root
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
Underlying cause: java.sql.SQLException : Access denied for user 'root'@'shi1' (using password: YES)
SQL Error code: 1045
Use --verbose for detailed stacktrace.
*** schemaTool failed ***

报错原因

     在浏览器中输入虚拟机主机ip:50070出现以下内容,说明是由于Hadoop进入安全模式而导致hive初始化失败。

解决方案

    退出Hadoop安全模式:使用stop-dfs.sh命令关闭Hadoop服务然后用start-dfs.sh命令重启(只重启第一台机器就可以),再次在浏览器中输入虚拟机主机ip:50070进行服务验证,括号内由standby变为active即为成功。

    如果重启Hadoop服务没有退出安全模式可以在hdfs-site.xml配置文件中加入以下代码退出

<property>
    <name>dfs.ha.automatic-failover.enabled.ns</name>
    <value>true</value>
</property>

猜你喜欢

转载自blog.csdn.net/qq_38774450/article/details/109228523