Setup HBase in Windows 10 | Install HBase in Standalone Mode


In this tutorial, we will learn how to Install or Setup HBase in your windows machine. Most of us would be developing a code in our local machine and setting up the HBase in your own machine will ease the process of development where it helps with doing some unit testing before deployment. Let us get started

Pre-Requisite:

We are going to make a standalone setup of HBase in our machine which requires 
  • Java JDK 1.8 - Download from this link JAVA JDK. Install and set JAVA_HOME in environment  variable. 
  • HBase - Apache HBase can be downloaded from this link 

Video Guide to Setup:



HBase Installation Steps:

Step 1:

Unzip the downloaded Hbase and place it in some common path, say C:/Document/hbase-2.2.5

Step 2:

Create a folders as shown below inside root folder for HBase data and zookeeper 

-> C:/Document/hbase-2.2.5/hbase
-> C:/Document/hbase-2.2.5/zookeeper

Step 3:

Open C:/Document/hbase-2.2.5/bin/hbase.cmd in notepad++. Search for below given lines and  remove %HEAP_SETTINGS% from that line as dictated in the video embedded with this blog

set java_arguments=%HEAP_SETTINGS% %HBASE_OPTS% -classpath "%CLASSPATH%" %CLASS% %hbase-command-arguments%

Step 4:

Open C:/Document/hbase-2.2.5/conf/hbase-env.cmd n notepad++.  Add the below lines to the file after the comment session as shown in the YT video given with this tutorial.



set JAVA_HOME=%JAVA_HOME%
set HBASE_CLASSPATH=%HBASE_HOME%\lib\client-facing-thirdparty\*
set HBASE_HEAPSIZE=8000
set HBASE_OPTS="-XX:+UseConcMarkSweepGC" "-Djava.net.preferIPv4Stack=true"
set SERVER_GC_OPTS="-verbose:gc" "-XX:+PrintGCDetails" "-XX:+PrintGCDateStamps" %HBASE_GC_OPTS%
set HBASE_USE_GC_LOGFILE=true

set HBASE_JMX_BASE="-Dcom.sun.management.jmxremote.ssl=false" "-Dcom.sun.management.jmxremote.authenticate=false"

set HBASE_MASTER_OPTS=%HBASE_JMX_BASE% "-Dcom.sun.management.jmxremote.port=10101"
set HBASE_REGIONSERVER_OPTS=%HBASE_JMX_BASE% "-Dcom.sun.management.jmxremote.port=10102"
set HBASE_THRIFT_OPTS=%HBASE_JMX_BASE% "-Dcom.sun.management.jmxremote.port=10103"
set HBASE_ZOOKEEPER_OPTS=%HBASE_JMX_BASE% -Dcom.sun.management.jmxremote.port=10104"
set HBASE_REGIONSERVERS=%HBASE_HOME%\conf\regionservers
set HBASE_LOG_DIR=%HBASE_HOME%\logs
set HBASE_IDENT_STRING=%USERNAME%
set HBASE_MANAGES_ZK=true

Step 5:

Open C:/Document/hbase-2.2.5/conf/hbase-site.xml notepad++. Add the below lines inside <configuration> tag. Refer YT video given in this tutorial.

<property>
    <name>hbase.rootdir</name>
    <value>file:///C:/Documents/hbase-2.2.5/hbase</value>
 </property>
 <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/C:/Documents/hbase-2.2.5/zookeeper</value>
 </property>
 <property>
     <name> hbase.zookeeper.quorum</name>
    <value>localhost</value>
 </property>

Step 6:

Setup the Environment variable for HBASE_HOME and add bin to the path variable as shown in the below image.

We are done with the Setup for HBase on Windows 10 and to verify the setup follow the video and also try creating a table inside hbase shell. Hope you made a complete standalone setup of HBase in windows machine successfully. If in case of any issue, please let me know through the below comment box.

Happy Learning !!!

Post a Comment

44 Comments

  1. Hi, i have this error
    C:\hbase-2.3.0\bin>start-hbase.cmd
    Error: JAVA_HOME is incorrectly set or could not find java at the location C:\Java\jdk1.8.0_261 \bin\
    The filename, directory name, or volume label syntax is incorrect.
    ERROR: Could not determine the startup mode.
    How to solve this?

    ReplyDelete
    Replies
    1. Please check your JAVA HOME
      Environ variable:

      JAVA_HOME = c:\Program Files\Java\jdk_ ​

      PATH variable:

      c:\Program Files\Java\jdk1.8.0_201\bin

      Delete
    2. HI Brother, if you facing same error after setup JAVA_HOME and Path in environment successfully, you may face this error again

      That time just look step4:
      where,
      set JAVA_HOME=%JAVA_HOME% => here after ("%JAVA_HOME%") after final percentage if you move cursor you will get one space (JAVA_HOME=%JAVA_HOME%" ") ->exactly after percentage just clear that space and save file then Run . it will run ,


      Mr.Azarutheen thanks it works for me and also if possible please modify above blog please
      Thank you

      Delete
    3. Thanks a lot Manikandan, I fixed the space in Javahome path.

      Delete
    4. I tried both ones but still im getting the error. Is there any others changes i have to made??

      Delete
  2. i am also getting the same error as above, kindly resolve it

    ReplyDelete
    Replies
    1. Chk the JAVA HOME and correct it.
      Environ variable:

      JAVA_HOME = c:\Program Files\Java\jdk_ ​

      PATH variable:

      c:\Program Files\Java\jdk1.8.0_201\bin

      Delete
  3. Azarudeen, Thanks for this posting. Great one..

    I've done all the steps as you've said. I get the error as below..

    Error: JAVA_HOME is incorrectly set or could not find java at the location c:\Program Files\Java\jdk1.8.0_202 \bin\
    The filename, directory name, or volume label syntax is incorrect.
    ERROR: Could not determine the startup mode.
    I've set the JAVA_HOME & path variable right as a system variable and prescribed. If you can see there exist a space between "c:\Program Files\Java\jdk1.8.0_202 \bin\" 202 & \ taken while executing. I believe that could be the problem. Can you please help to resolve it? Thanks in advance..

    ReplyDelete
  4. I tried the same as above and got the same error. I directly used the JAVA_HOME on hbase-env.cmd file. Meaning gave the value for JAVA_HOME and it's working. When I tried JPS command, I can see only JPS & HMaster. But after 5 mins with I couldn't see HMaster. Is it stopping after a while or do I need to set up some configuration or anything. Please let me know. Thanks..

    ReplyDelete
  5. C:/Document/hbase-2.2.5/conf/hbase-env.cmd
    a.THere is space just aside of % so remove the space run the command
    set JAVA_HOME=%JAVA_HOME%
    b.if point a is not working place one more % like below . and execute the command
    set JAVA_HOME=%JAVA_HOME%%

    ReplyDelete
  6. I had follow all this but getting this
    E:\hbase\hbase-2.2.6\bin>start-hbase.cmd
    Error: Could not find or load main class org.apache.hadoop.hbase.util.HBaseConfTool
    ERROR: Could not determine the startup mode.

    ReplyDelete
    Replies
    1. for solve this issue you need execute the start-hbase commad using the cmd console in admin mode.

      Delete
  7. I followed the same steps and I am ending up with this error

    \SSH was unexpected at this time.
    ERROR: Could not determine the startup mode.

    Am I missing something?

    Request your help..

    ReplyDelete
  8. Hi AZARUDEEN SHAHUL,
    Thank you , it helps a lot.
    But I'm facing below error can you help me to fix

    While giving 'start-hbase.cmd', I' m getting below error

    The syntax of the command is incorrect.
    ERROR: Could not determine the startup mode.

    Can you help me to fix this error

    ReplyDelete
  9. i am unable to download java 1.8 because in higher versions hbase is not in support please help.. oracle website for 1.8 is not working

    ReplyDelete
  10. When I execute "start-hbase.cmd" I get this error :

    2020-12-02 16:44:56,331 WARN [main] util.Shell: Did not find winutils.exe: {}
    java.io.FileNotFoundException: java.io.FileNotFoundException: HADOOP_HOME and hadoop.home.dir are unset. -see https://wiki.apache.org/hadoop/WindowsProblems
    at org.apache.hadoop.util.Shell.fileNotFoundException(Shell.java:528)
    at org.apache.hadoop.util.Shell.getHadoopHomeDir(Shell.java:549)
    at org.apache.hadoop.util.Shell.getQualifiedBin(Shell.java:572)
    at org.apache.hadoop.util.Shell.(Shell.java:669)
    at org.apache.hadoop.util.StringUtils.(StringUtils.java:79)
    at org.apache.hadoop.conf.Configuration.getBoolean(Configuration.java:1555)
    at org.apache.hadoop.hbase.HBaseConfiguration.checkDefaultsVersion(HBaseConfiguration.java:70)
    at org.apache.hadoop.hbase.HBaseConfiguration.addHbaseResources(HBaseConfiguration.java:84)
    at org.apache.hadoop.hbase.HBaseConfiguration.create(HBaseConfiguration.java:98)
    at org.apache.hadoop.hbase.util.HBaseConfTool.main(HBaseConfTool.java:39)
    Caused by: java.io.FileNotFoundException: HADOOP_HOME and hadoop.home.dir are unset.
    at org.apache.hadoop.util.Shell.checkHadoopHomeInner(Shell.java:448)
    at org.apache.hadoop.util.Shell.checkHadoopHome(Shell.java:419)
    at org.apache.hadoop.util.Shell.(Shell.java:496)
    ... 6 more


    Any idea idea on how should I fix it ?

    ReplyDelete
    Replies
    1. I get the same error as you MED, did you find a solution to this error?

      Delete
    2. not yet, plz if you were luckier don't forget to post the solution for us.

      Delete
    3. todavía no, por favor, si tuvo más suerte, no olvide publicar la solución para nosotros x2

      Delete
    4. Try to download winutils.exe from this link http://public-repo-1.hortonworks.com/hdp-win-alpha/winutils.exe and place it inside folder "c:/user/hadoop/bin" . Now setup
      HADOOP_HOME =c:/user/hadoop

      and update path in environment variable. Hope this solves ur issue.

      Delete
  11. help me with this problem

    Exception in thread "main" java.lang.RuntimeException: com.ctc.wstx.exc.WstxParsingException: Illegal to have multiple roots (start tag in epilog?).
    at [row,col,system-id]: [56,3,"file:/C:/Users/x/Documents/hbase-2.3.4/conf/hbase-site.xml"]
    at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2963)
    at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2730)
    at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2605)
    at org.apache.hadoop.conf.Configuration.get(Configuration.java:1103)
    at org.apache.hadoop.conf.Configuration.getTrimmed(Configuration.java:1157)
    at org.apache.hadoop.conf.Configuration.getBoolean(Configuration.java:1562)
    at org.apache.hadoop.hbase.HBaseConfiguration.checkDefaultsVersion(HBaseConfiguration.java:70)
    at org.apache.hadoop.hbase.HBaseConfiguration.addHbaseResources(HBaseConfiguration.java:84)
    at org.apache.hadoop.hbase.HBaseConfiguration.create(HBaseConfiguration.java:98)
    at org.apache.hadoop.hbase.util.HBaseConfTool.main(HBaseConfTool.java:39)
    Caused by: com.ctc.wstx.exc.WstxParsingException: Illegal to have multiple roots (start tag in epilog?).
    at [row,col,system-id]: [56,3,"file:/C:/Users/Krzysiek/Documents/hbase-2.3.4/conf/hbase-site.xml"]
    at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:621)
    at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:491)
    at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:475)
    at com.ctc.wstx.sr.BasicStreamReader.handleExtraRoot(BasicStreamReader.java:2242)
    at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2156)
    at com.ctc.wstx.sr.BasicStreamReader.closeContentTree(BasicStreamReader.java:2991)
    at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2734)
    at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1123)
    at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2796)
    ... 9 more
    ERROR: Could not determine the startup mode.

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  13. Hi Couldn't make it work. By the way, maybe everyone knows it - Is Hadoop a prerequisite for HBase to work?

    ReplyDelete
  14. Unrecognized VM option 'UseConcMarkSweepGC'
    Error: Could not create the Java Virtual Machine.
    Error: A fatal exception has occurred. Program will exit.
    ERROR: Could not determine the startup mode.

    any one help me to solve this error

    ReplyDelete
    Replies
    1. I also had this problem you need to check your java's version

      Delete
    2. can you pls elaborate on this im facing the same iss
      ue

      Delete
  15. Hey thank you for this amazing tutorial. Everything works fine. But when I want to start the Hbase it give me the following error. Could you please look at it. Thank in advance:

    Error: Could not find or load main class org.apache.hadoop.hbase.util.HBaseConfTool
    ERROR: Could not determine the startup mode.

    ReplyDelete
  16. ERROR: KeeperErrorCode = ConnectionLoss for /hbase/master
    Getting this error when I give list command .... Can you help me on the same

    ReplyDelete
  17. All are works correctly. But i can only put several rows only. When i insert more raws there is syntax error, unexpected tINTEGER
    What can i do for it?

    ReplyDelete
  18. the hbase comand window doesn't open

    ReplyDelete
  19. When I try to run hbase.cmd the following appears and nothing else happens:

    This file has been superceded by packaging our ruby files into a jar
    and using jruby's bootstrapping to invoke them. If you need to
    source this file fo some reason it is now named 'jar-bootstrap.rb' and is
    located in the root of the file hbase-shell.jar and in the source tree at
    'hbase-shell/src/main/ruby'.

    I googled it but didn't find any solution.

    ReplyDelete
  20. I followed all the steps and installed hbase on my system. but when i run hbase shell command on cmd it will give the message below like

    C:\hbase-2.4.5\bin>hbase shell
    This file has been superceded by packaging our ruby files into a jar
    and using jruby's bootstrapping to invoke them. If you need to
    source this file fo some reason it is now named 'jar-bootstrap.rb' and is
    located in the root of the file hbase-shell.jar and in the source tree at
    'hbase-shell/src/main/ruby'.

    what can i do to solve this. please help me out.

    ReplyDelete
    Replies
    1. I too getting same issue, any resolution ???

      Delete
  21. 2021-10-04T15:00:17.275+0530: [CMS-concurrent-sweep-start]
    2021-10-04T15:00:17.277+0530: [CMS-concurrent-sweep: 0.002/0.002 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    2021-10-04T15:00:17.278+0530: [CMS-concurrent-reset-start]
    2021-10-04T15:00:17.279+0530: [CMS-concurrent-reset: 0.001/0.001 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    2021-10-04 15:00:18,412 INFO [main-SendThread(localhost:2181)] zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
    2021-10-04 15:00:20,452 INFO [main-SendThread(localhost:2181)] zookeeper.ClientCnxn: Socket error occurred: localhost/127.0.0.1:2181: Connection refused: no further information
    2021-10-04 15:00:22,487 INFO [main-SendThread(localhost:2181)] zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
    2021-10-04 15:00:24,517 INFO [main-SendThread(localhost:2181)] zookeeper.ClientCnxn: Socket error occurred: localhost/127.0.0.1:2181: Connection refused: no further information
    2021-10-04 15:03:19,881 INFO [main-SendThread(localhost:2181)] zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
    2021-10-04 15:03:21,925 INFO [main-SendThread(localhost:2181)] zookeeper.ClientCnxn: Socket error occurred: localhost/127.0.0.1:2181: Connection refused: no further information
    2021-10-04 15:03:23,750 INFO [main-SendThread(localhost:2181)] zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
    2021-10-04 15:03:25,777 INFO [main-SendThread(localhost:2181)] zookeeper.ClientCnxn: Socket error occurred: localhost/127.0.0.1:2181: Connection refused: no further information
    2021-10-04 15:03:27,612 INFO [main-SendThread(localhost:2181)] zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
    2021-10-04 15:03:29,641 INFO [main-SendThread(localhost:2181)] zookeeper.ClientCnxn: Socket error occurred: localhost/127.0.0.1:2181: Connection refused: no further information
    2021-10-04 15:03:30,806 INFO [main-SendThread(localhost:2181)] zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)

    I am getting this error multiple times
    First I got java home error which I resolved now this another one.

    When I run jps command, only
    20624 HMaster
    28220 Jps

    this 2 are running other two are not running.
    Please help me resolve this error...

    ReplyDelete
    Replies
    1. i too getting same issue, did you find out the solution

      Delete
  22. Really? It didn't work in Windows past ten years, and now it works?

    ReplyDelete
  23. Hello, I've gone through your tutorial videos and I still get this from my command terminal, how do I solve this. Please immediate response is much appreciated.
    \Java\jre6\bin\ was unexpected at this time.

    ReplyDelete
  24. While installing hbase it shows an error saying that
    'start-hbase.cmd' is not recognised as an internal or external command, operable program or batch file

    Please help me to find an answer to this as I have to submit an assignment on this,I tried so many ways to solve this problem but I couldn't

    ReplyDelete
    Replies
    1. Same error i am also facing.
      log4j:ERROR Could not find value for key log4j.appender.DRFAS
      log4j:ERROR Could not instantiate appender named "DRFAS".
      2022-01-10 17:31:27,927 INFO [main] master.HMaster: STARTING service HMaster
      2022-01-10 17:31:27,930 INFO [main] util.VersionInfo: HBase 2.2.5
      2022-01-10 17:31:27,930 INFO [main] util.VersionInfo: Source code repository git://hao-OptiPlex-7050/home/hao/open_source/hbase revision=f76a601273e834267b55c0cda12474590283fd4c
      2022-01-10 17:31:27,930 INFO [main] util.VersionInfo: Compiled by hao on 2020? 05? 21? ??? 18:34:40 CST
      2022-01-10 17:31:27,930 INFO [main] util.VersionInfo: From source with checksum 8a2499e85fc7533b163ab04e494bdd16
      Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/htrace/core/HTraceConfiguration
      at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:153)
      at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:140)
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
      at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:149)
      at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2945)
      Caused by: java.lang.ClassNotFoundException: org.apache.htrace.core.HTraceConfiguration
      at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
      ... 5 more

      Delete
  25. hello after running commanding jps no output is given

    ReplyDelete
  26. Hello sir, when I entered command in cmd I got that error:
    C:\Users\Best buy\Favorites\Downloads\hbase-2.4.12\bin>start-hbase.cmd
    'C:\Users\Best' is not recognized as an internal or external command,
    operable program or batch file.
    'C:\Users\Best' is not recognized as an internal or external command,
    operable program or batch file.
    ERROR: Could not determine the startup mode.

    Please help me

    ReplyDelete