未能在cygwin(windows 10)上的apache hive 3.0.0中初始化hiveserver2的架构

pgky5nke  于 2021-06-01  发布在  Hadoop
关注(0)|答案(1)|浏览(490)

我已经有了一个hadoop3.0.0集群,它由2台机器组成:1个namenode+rm和1个datanode。我试图通过以下文档安装ApacheHive3.0.0。
当我跑的时候 schematool -dbType derby -initSchema --verbose 在cygwin上,引发了一个异常:

$ schematool -dbType derby -initSchema --verbose
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/BigSol/apache-hive-3.0.0-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/BigSol/hadoop-3.0.0/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]
Metastore connection URL:        jdbc:derby:;databaseName=metastore_db;create=true
Metastore Connection Driver :    org.apache.derby.jdbc.EmbeddedDriver
Metastore connection User:       APP
Starting metastore schema initialization to 3.0.0
org.apache.hadoop.hive.metastore.HiveMetaException: Unknown version specified for initialization: 3.0.0
org.apache.hadoop.hive.metastore.HiveMetaException: Unknown version specified for initialization: 3.0.0
        at org.apache.hadoop.hive.metastore.MetaStoreSchemaInfo.generateInitFileName(MetaStoreSchemaInfo.java:137)
        at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:580)
        at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:562)
        at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:1445)
        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:239)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:153)

***schemaTool failed***

在查看引发异常的代码行时,我发现配置单元试图找到位于 %HIVE_HOME%\scripts\metastore\upgrade\derby\hive-schema-3.0.0.derby.sql .
我怀疑cygwin弄乱了路径,所以Hive没有找到那个模式。
我的问题:
如何更正路径(或解决问题)?
是否有等同于的批处理文件 *.sh 中的文件 %HIVE_HOME%\bin 配置单元2.1.1所拥有的目录?

ippsafx7

ippsafx71#

我找到了解决办法。运行后 schematool 在linux机器上复制 metastore_db 目录到windows机器,我设法启动hiveserver2,但是 beeline cli说jar在 C:\cygdrive\c\BigSol\apache-hive-3.0.0-bin\lib\hive-beeline-3.1.0.jar 找不到。
结果发现cygwin中的java解析了错误的路径。我从 C:\cygdrive\cC:\ 而且成功了。

相关问题