HBase 0.92 Standalone for Windows with Cygwin

Does anyone know how HBase can run on Windows under Cygwin?

I managed to configure everything, for example, keys for automatic login with SSH, but Im stuck with the following error message:

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: +======================================================================+ 

...

 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) 

I already set .bash_profile to point to:

 export JAVA_HOME='/usr/lib/jre1.6.1' 

which is a symbolic link to a real jre

 /usr/lib/jre1.6.1 -> /cygdrive/c/Java/jre7/ 
+8
java hbase cygwin
source share
5 answers

I had the same problem and found the following: Cygwin uses ":" as a path separator. But the script creating CLASS_PATH does not work correctly. The final CLASS_PATH looks like "...: zookeeper.jar:" with ":" at the end. Before running java script, convert CLASS_PATH to Windows style. But with ":" at the end!

So my solution: just create an empty file "zzz.jar" in the hbase / lib section . zzz.jar will be the last in CLASS_PATH, and zookeeper.jar will be correctly added to CLASS_PATH.

I know it is better to fix the script, but I who cares :) I only need HBase for 2 days, so it works, and I'm happy :)

+5
source share

For the JAVA_HOME error, you can fix it by setting JAVA_HOME in hbase\conf\hbase-env.sh .

To exclude a class not found, try adding hbase\lib to HBASE_CLASSPATH under the same file.

Personally, I use the following two lines in my hbase-env.sh in the Windows 7 Environment + Cygwin:

 export JAVA_HOME=/cygdrive/c/Program\ Files/Java/jdk1.7.0/ export HBASE_CLASSPATH=/cygdrive/c/programs/hbase-0.92.1/lib/ 
+4
source share

Use a virtual machine to run hadoop in a Linux environment. With Java, you may experience problems typical of Windows by adding Cygwin to mix, adding another set, for example:

For training purposes, I highly recommend the cloudera demo virtual machine and tutorial : https://ccp.cloudera.com/display/SUPPORT/Cloudera%27s+Hadoop+Demo+VM

https://ccp.cloudera.com/display/SUPPORT/Hadoop+Tutorial#HadoopTutorial-Purpose

+1
source share

EDIT:

The first error looks like this: Java was not found, but the second error clearly comes from Java, so the combination of these two errors is somewhat confusing. Are you sure that both of them are created simultaneously by the same script?

The second error is caused by the absence of the jar zookeeper file in the classpath. Try changing the script or copy the jar to the hadoop lib directory.

0
source share

hbase_classpath not required, just change zookeeper.jar to azookeeper.jar

0
source share

All Articles