Standalone HBase
By default HBase runs in standalone mode. In standalone mode, HBase does not use HDFS — it uses the local file system instead — and it runs all HBase daemons and a local zookeeper all up in the same JVM. Zookeeper binds to a well-known port so clients may talk to HBase. HBase requires java 6 or newer version. If this is not the case, HBase will not start.
The hbase-0.94.8 installation is done in below versions of Linux, Java and Hadoop respectively.
UBUNTU 13.4
JAVA 1.7.0_25
HADOOP 1.1.2
I have hduser as a dedicated hadoop system user. I had installed my Hadoop in /home/hduser/hadoop folder. Now I am going to install hbase in /usr/lib/hbase folder.
- Download hbase-0.94.8.tar.gz from here
- Enter into the directory where the stable version is downloaded. By default it downloads in “Downloads” directory
$ cd Downloads/
- Unzip the tar file.
$ tar -xvf hbase-0.94.8.tar.gz
- Create directory
$ sudo mkdir /usr/lib/hbase
- move hbase-0.94.8 to hbase
$ mv hbase-0.94.8 /usr/lib/hbase/hbase-0.94.8
- Configuring HBase with java
Open your hbase/conf/hbase-env.sh and set the path to the java installed in your system
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_25
- Set the HBASE_HOME path in bashrc file
To open bashrc file use this command
hduser@system_name:~$ gedit ~/.bashrc
In bashrc file append the below 2 statements
export HBASE_HOME=/usr/lib/hbase/hbase-0.94.8 export PATH=$PATH:$HBASE_HOME/bin
- At this point, you are ready to start HBase. But before starting it, you might want to edit conf/hbase-site.xml and set the directory you want HBase to write to, hbase.rootdir.
- By default, hbase.rootdir is set to /tmp/hbase-${user.name} which means you’ll lose all your data whenever your server reboots
- So replace DIRECTORY in the hbase-site.xml with a path to a directory where you want HBase to store its data.
- hbase-site.xml
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>hbase.rootdir</name> <value>file:///home/hduser/HBASE/hbase</value> </property> <property> <name>hbase.zookeeper.property.dataDir</name> <value>/home/hduser/HBASE/zookeeper</value> </property> </configuration>
- Extra steps
In /etc/hosts there are two entries:127.0.0.1 and 127.0.1.1.Change the second entry 127.0.1.1 to 127.0.0.1 otherwise it gives error: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing
- To start Hbase [ in standalone mode no need to start hadoop ]
HBASE_PATH$bin/start-hbase.sh HBASE_PATH$ bin/hbase shell
- To stop HBase
HBASE_PATH$ bin/stop-hbase.sh stopping hbase...............
- To use the web interfaces
http://localhost:60010 for master
http://localhost:60030 for region server
- Reference :
http://archive.cloudera.com/cdh/3/hbase-0.90.1-cdh3u0/quickstart.html
http://archive.cloudera.com/cdh/3/hbase-0.90.1-cdh3u0/notsoquick.html
Note:The information provided here is best of my knowledge and experience if at all any modifications are to be made please help me with ur valuable suggestion which are always welcome….
Thanks a lot…. i could install it successfully
LikeLike
Hi ,
i am new to HBASE, and while tryng to instiall the same on ubuntu system, i am facing some problem.
Below is the error log from zookeeper log file
2014-01-18 06:10:51,392 WARN org.apache.zookeeper.server.NIOServerCnxn: caught end of stream exception
EndOfStreamException: Unable to read additional data from client sessionid 0x143a5b052980000, likely client has closed socket
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:220)
at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)
at java.lang.Thread.run(Thread.java:744)
2014-01-18 06:10:51,394 INFO org.apache.zookeeper.server.NIOServerCnxn: Closed socket connection for client /127.0.0.1:56671 which had sessionid 0x143a5b052980000
Below is Error log from master log
2014-01-18 06:10:51,381 INFO org.apache.zookeeper.ZooKeeper: Session: 0x143a5b052980000 closed
2014-01-18 06:10:51,381 INFO org.apache.hadoop.hbase.master.HMaster: HMaster main thread exiting
2014-01-18 06:10:51,381 ERROR org.apache.hadoop.hbase.master.HMasterCommandLine: Failed to start master
java.lang.RuntimeException: HMaster Aborted
at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:160)
at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:104)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:76)
at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2120)
Please help me in this issue, as i tried to solve it by myself from last two days , but no luck.Please help.
LikeLike
I am facing this same issue … can you share the resolution ?
LikeLike
Very nice , install went very smooth
LikeLike
good post one shot installation was thr….
LikeLike
Hello, thank you for the useful tutorial , but i have a question , i am running hbase on Ubuntu server on Virtual box , but the problem is when i create a table and reboot my VM , every table I’ve made is gone , do you know what should i do , to keep my tables saved .
LikeLike
The only tutorial that works without problems 🙂 thx
LikeLike
Hello,
It didn’t work for me. In the output of the ‘jps’ command, Ican’t find the Hmaster running and when testing (in the Hbase Shell) this line “create ‘test’, ‘dd’ ” to create table it gives me this output:
ERROR: org.apache.hadoop.hbase.MasterNotRunningException: Retried 7 times
Here is some help for this command:
Create table; pass table name, a dictionary of specifications per
column family, and optionally a dictionary of table configuration.
Dictionaries are described below in the GENERAL NOTES section.
Examples:
hbase> create ‘t1’, {NAME => ‘f1’, VERSIONS => 5}
hbase> create ‘t1’, {NAME => ‘f1’}, {NAME => ‘f2’}, {NAME => ‘f3’}
hbase> # The above in shorthand would be the following:
hbase> create ‘t1’, ‘f1’, ‘f2’, ‘f3’
hbase> create ‘t1’, {NAME => ‘f1’, VERSIONS => 1, TTL => 2592000, BLOCKCACHE => true}
hbase> create ‘t1’, ‘f1′, {SPLITS => [’10’, ’20’, ’30’, ’40’]}
hbase> create ‘t1’, ‘f1’, {SPLITS_FILE => ‘splits.txt’}
hbase> # Optionally pre-split the table into NUMREGIONS, using
hbase> # SPLITALGO (“HexStringSplit”, “UniformSplit” or classname)
hbase> create ‘t1’, ‘f1’, {NUMREGIONS => 15, SPLITALGO => ‘HexStringSplit’}
Please, if you can see where is the problem, let me know.
Thank you.
LikeLike
Reblogged this on Dpayne Dudhe and commented:
Installing Apache HBase on Ubuntu for Standalone Mode
LikeLike
kindly help on this unable get hbase shell
this is the below which i am getting in ubuntu
Fatal Error] hbase-site.xml:2:6: The processing instruction target matching “[xX][mM][lL]” is not allowed.
15/11/16 02:21:10 FATAL conf.Configuration: error parsing conf file: org.xml.sax.SAXParseException; systemId: file:/usr/local/hbase/conf/hbase-site.xml; lineNumber: 2; columnNumber: 6; The processing instruction target matching “[xX][mM][lL]” is not allowed.
Exception in thread “main” java.lang.RuntimeException: org.xml.sax.SAXParseException; systemId: file:/usr/local/hbase/conf/hbase-site.xml; lineNumber: 2; columnNumber: 6; The processing instruction target matching “[xX][mM][lL]” is not allowed.
LikeLike
Do we need to install zookeeper ? before installing HBASE?
plz help me
LikeLike
Hi,
I am getting following errors after the installation process…plz suggest..
dev@dev-Inspiron-3542:/usr/local/hbase/bin$ ./start-hbase.sh
starting master, logging to /usr/local/hbase/bin/../logs/hbase-dev-master-dev-Inspiron-3542.out
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
LikeLike
I am newbie to big data.your blog is really helpful to learn big data.
I am not geeting hbase shell prompt and followed same steps, but i tried this on Cygwin +windows 7 environment.
Could you help me on this.
Xyz ~/hbase-0.94.8
$ bin/start-hbase.sh
cygpath: cannot create short name of D:\Public\Cygwin\home\xyz\hbase-0.94.8\logs
cygpath: cannot create short name of D:\Public\Cygwin\home\xyz\hbase-0.94.8\logs
+xyz@localhost’s password:
localhost: starting zookeeper, logging to /home/xyz/hbase-0.94.8/bin/../logs/hbase-+xyz-zookeeper-.out
starting master, logging to /home/xyz/hbase-0.94.8/bin/../logs/hbase-+xyz-master-.out
+xyz@localhost’s password:
localhost: starting regionserver, logging to /home/xyz/hbase-0.94.8/bin/../logs/hbase-+xyz-regionserver-.out
+xyz@ ~/hbase-0.94.8
$ bin/hbase shell
HBase Shell; enter ‘help’ for list of supported commands.
Type “exit” to leave the HBase Shell
Version 0.94.8, r1485407, Wed May 22 20:53:13 UTC 2013
Thanks,
Prabhu
LikeLike
I am new to big data , Your blog is very much helpful to learn the concepts of different tools.
I am trying to install habse on Cygwin + Windows 7 environment. I am not getting the hbase shell prompt after starting hbase.sh
yz ~/hbase-0.94.8
$ bin/start-hbase.sh
cygpath: cannot create short name of D:\Public\Cygwin\home\xyz\hbase-0.94.8\logs
cygpath: cannot create short name of D:\Public\Cygwin\home\xyz\hbase-0.94.8\logs
+xyz@localhost’s password:
localhost: starting zookeeper, logging to /home/xyz/hbase-0.94.8/bin/../logs/hbase-+xyz-zookeeper-.out
starting master, logging to /home/xyz/hbase-0.94.8/bin/../logs/hbase-+xyz-master-.out
+xyz@localhost’s password:
localhost: starting regionserver, logging to /home/xyz/hbase-0.94.8/bin/../logs/hbase-+xyz-regionserver-.out
+xyz@ ~/hbase-0.94.8
$ bin/hbase shell
HBase Shell; enter ‘help’ for list of supported commands.
Type “exit” to leave the HBase Shell
Version 0.94.8, r1485407, Wed May 22 20:53:13 UTC 2013
Please help on this to fix the issue , .I believe i missed something on configuration files.
Thanks,
Prabhu
LikeLike