0

我已经有一个由 2 台机器组成的 Hadoop 3.0.0 集群:1 个名称节点 + RM 和 1 个数据节点。我尝试按照此文档安装 Apache Hive 3.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 试图找到位于%HIVE_HOME%\scripts\metastore\upgrade\derby\hive-schema-3.0.0.derby.sql.

我怀疑 Cygwin 搞砸了路径,以至于 Hive 没有找到那个模式。

我的问题:

  1. 如何更正路径(或解决问题)?
  2. 是否有与 Hive 2.1.1 目录中的*.sh文件等效的批处理文件?%HIVE_HOME%\bin
4

1 回答 1

0

我找到了解决方案。在 Linux 机器上运行schematool并将目录复制metastore_db到 Windows 机器后,我设法启动了 HiveServer2,但beelineCLI 说C:\cygdrive\c\BigSol\apache-hive-3.0.0-bin\lib\hive-beeline-3.1.0.jar找不到 jar。

原来Cygwin中的java解析错误的路径。C:\cygdrive\c我从to建立了一个符号链接C:\,它起作用了。

于 2018-10-10T03:33:48.960 回答