============================================================

INSTALL APACHE HBASE ON LAPTOP OR DESKTOP

Date: Thu Jan 15 10:30:29 EST 2026

Platform: Rocky Linux 9.6
HBase Version: 2.6.2
============================================================


# Basic LHM install procedure follows.
# The following may need some additional configuration for you environment.

  wget --no-check-certificate -P /tmp https://archive.apache.org/dist/hbase/2.6.2/hbase-2.6.2-bin.tar.gz

  tar xvzf /tmp/hbase-2.6.2-bin.tar.gz -C /opt

# Once HBase is extracted into /opt, copy the original configuration files 
# to HBase configurations (original files are in files directory)
# The new configuration sets HBase in to distributed mode

  /bin/mv /opt/hbase-2.6.2/conf/hbase-site.xml /opt/hbase-2.6.2/conf/hbase-site.xml.orig
  /bin/mv /opt/hbase-2.6.2/conf/hbase-env.sh /opt/hbase-2.6.2/conf/hbase-env.sh.orig
  /bin/cp files/hbase-site.xml /opt/hbase-2.6.2/conf/hbase-site.xml
  /bin/cp files/hbase-env.sh /opt/hbase-2.6.2/conf/hbase-env.sh

# HBase requires zookeeper. On the LHM Zookeeper is started as part of
# Kakfa. The Hbase start and stop scripts have been changed to
# keep HBase from starting and stopping Zookeeper, 
# (originals are in scripts directory)

  /bin/mv /opt/hbase-2.6.2/bin/start-hbase.sh /opt/hbase-2.6.2/bin/start-hbase.sh.orig 
  /bin/mv /opt/hbase-2.6.2/bin/stop-hbase.sh /opt/hbase-2.6.2/bin/stop-hbase.sh.orig 
  /bin/cp scripts/start-hbase.sh /opt/hbase-2.6.2/bin/start-hbase.sh
  /bin/cp scripts/stop-hbase.sh /opt/hbase-2.6.2/bin/stop-hbase.sh

# Set HBase profile and path

  echo 'export PATH=$PATH:/opt/hbase-2.6.2/bin; export HBASE_HOME=/opt/hbase-2.6.2' >/etc/profile.d/hbase.sh

# Create an HBase user and change ownership (do as root)

  useradd -g hadoop hbase
  chown -R hbase:hadoop /opt/hbase-2.6.2

# make the log directory
  mkdir /var/log/hbase
  chown hbase:hadoop /var/log/hbase

# Create HDFS /hbase working directory (as root become user hdfs)

  su - hdfs
  hdfs dfs -mkdir /hbase
  hdfs dfs -chown hbase:hadoop /hbase
  exit

# fix redundant log4j jar file issue

  mv  /opt/hbase-2.6.2/lib/client-facing-thirdparty/log4j-slf4j-impl-2.17.2.jar /opt/hbase-2.6.2/lib/client-facing-thirdparty/log4j-slf4j-impl-2.17.2.jar.extra

# Copy Systemd HBase start and stop scripts to /opt/services
# Note: Systemd HBase scripts have upper case "HB" so not
# to get confused with the hbase bin scripts

  cp scripts/*-HBase.sh /opt/services/
  chown hbase:hadoop /opt/services/*-HBase.sh
  chmod 744 /opt/services/*-HBase.sh

# Copy the systemd service script

  cp files/hbase.service /etc/systemd/system

# Run the following if you want HBase to start when the system
# boots. If you do not plan on using HBase, it is RECOMMENDED
# that you DO NOT enable HBase to automatically start (preserves      
# resources)

  systemctl enable hbase.service

# To disable Hbase from starting automatically (after using the
# command above) run the following:

  systemctl disable hbase.service

# When you need HBase, use Systemd to start, stop, restart HBase

  systemctl enable hbase.service


# Without auto-start, use Systemd to start, stop HBase

  systemctl start hbase
  systemctl stop hbase

# The start and stop scripts used by Systemd are located in
# /opt/services. You should not have to use these scripts

  /opt/services/start-HBase.sh
  /opt/services/stop-HBase.sh

Testing
-------

  su - hands-on

  $ hbase shell
  HBase Shell
  Use "help" to get list of supported commands.
  Use "exit" to quit this interactive shell.
  For Reference, please visit: http://hbase.apache.org/2.0/book.html#shell
  Version 2.6.2, r6b3b36b429cf9a9d74110de79eb3b327b29ebf17, Fri Feb 14 14:39:16 UTC 2025
  Took 0.0007 seconds  
  hbase:001:0> status
  1 active master, 0 backup masters, 1 servers, 0 dead, 2.0000 average load
  Took 0.3555 seconds         
  hbase:002:0> version
  2.6.2, r6b3b36b429cf9a9d74110de79eb3b327b29ebf17, Fri Feb 14 14:39:16 UTC 2025
  Took 0.0002 seconds  
  hbase:003:0> 
  exit


