Install HBase on windows: Get zookeeper KeeperException
-
21-12-2019 - |
Question
I try to install HBase on windows. I follow all the steps of this website: http://ics.upjs.sk/~novotnyr/blog/334/setting-up-hbase-on-windows
When I try to start HBase I got the following error and I can't find the solution:
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)
localhost: ssh_exchange_identification: read: Connection reset by peer
Can you help me to understand? Thanks
Solution
It seems that with recent versions, there's an issue in the way the classpath list of jars is built, so you need to include a dummy file that comes after "zookeeper" alphabetically otherwise the last file in the directory gets skipped. Touch "zzz.jar" (creating a 0 byte file) in the hbase/lib directory, then try starting it again.
I originally also added the hbase/lib directory in the HBASE_CLASSPATH in the hbase_env.sh file, but I suspect the trick above would have sufficed.
See shapkin's answer here: https://stackoverflow.com/a/19981264