HBase 0.92在Windows上使用Cygwin独立

Jac*_*son 8 java cygwin hbase

有没有人知道在Cygwin下如何在Windows上运行HBase的教程?

我设法设置所有内容,例如使用SSH自动登录的密钥,但我坚持以下错误消息:

localhost: +======================================================================+
localhost: |      Error: JAVA_HOME is not set and Java could not be found         |
localhost: +----------------------------------------------------------------------+
localhost: | Please download the latest Sun JDK from the Sun Java web site        |
localhost: |       > http://java.sun.com/javase/downloads/ <                      |
localhost: |                                                                      |
localhost: | HBase requires Java 1.6 or later.                                    |
localhost: | NOTE: This script will find Sun Java whether you install using the   |
localhost: |       binary or the RPM based installer.                             |
localhost: +======================================================================+
Run Code Online (Sandbox Code Playgroud)

...

java.lang.NoClassDefFoundError: org/apache/zookeeper/KeeperException
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.getMethod0(Unknown Source)
        at java.lang.Class.getMethod(Unknown Source)
        at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.zookeeper.KeeperException
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
Run Code Online (Sandbox Code Playgroud)

我已经设置.bash_profile指向:

export JAVA_HOME='/usr/lib/jre1.6.1'
Run Code Online (Sandbox Code Playgroud)

这是真正的jre的象征性链接

/usr/lib/jre1.6.1 -> /cygdrive/c/Java/jre7/
Run Code Online (Sandbox Code Playgroud)

sha*_*kin 5

我有同样的问题,我发现以下内容:Cygwin使用":"作为路径分隔符.但是创建CLASS_PATH的脚本工作不正常.最终的CLASS_PATH看起来像"...:zookeeper.jar:",最后带有":".在运行java脚本之前将CLASS_PATH转换为Windows样式.但最后用":"!!

所以我的解决方案是:只需在hbase/lib下创建一个空文件"zzz.jar".zzz.jar将在CLASS_PATH中排在最后,zookeeper.jar将正确添加到CLASS_PATH中.

我知道修复脚本更好,但是我关心:)我只需要HBase 2天,所以它很有效,我很高兴:)


Chr*_*ain 0

编辑:

第一个错误看起来像是没有找到 Java,但第二个错误显然来自 Java,因此这两个错误的组合有些令人困惑。你确定它们是同一个剧本同时制作的吗?

第二个错误是由于类路径上没有 Zookeeper jar 文件引起的。尝试修改脚本或将 jar 复制到 hadoop lib 目录中。