HBase官方文档
https://blog.csdn.net/yitengtongweishi/article/details/81872307
https://blog.csdn.net/yitengtongweishi/article/details/81941667
HBase Releases
单击上述链接,下载需要的版本。笔者选择的是 hbase-1.4.6-bin.tar.gz 和 hbase-1.4.6-bin.tar.gz.sha512
校验 下载的 HBase 压缩文件
blockchain@Dao:~$ ls -lt Downloads/
total 341704
-rw-rw-r-- 1 blockchain blockchain 216 8月 23 11:40 hbase-1.4.6-bin.tar.gz.sha512
-rw------- 1 blockchain blockchain 113051925 8月 21 10:40 hbase-1.4.6-bin.tar.gz
-rw------- 1 blockchain blockchain 199635269 8月 20 11:03 hadoop-2.6.5.tar.gz
-rw------- 1 blockchain blockchain 37191810 8月 19 16:57 zookeeper-3.4.13.tar.gz
blockchain@Dao:~$
blockchain@Dao:~$ sha512sum Downloads/hbase-1.4.6-bin.tar.gz
d6cdc61fc968be09c5ad1d7d74a200c3cb5dc6c169469ba8f6a9fc654681db465f31ece770cd5cbafc7cb1510b896fe5420de2b4e178a1fb30442be665db1445 Downloads/hbase-1.4.6-bin.tar.gz
blockchain@Dao:~$
blockchain@Dao:~$ cat Downloads/hbase-1.4.6-bin.tar.gz.sha512
hbase-1.4.6-bin.tar.gz: D6CDC61F C968BE09 C5AD1D7D 74A200C3 CB5DC6C1 69469BA8
F6A9FC65 4681DB46 5F31ECE7 70CD5CBA FC7CB151 0B896FE5
420DE2B4 E178A1FB 30442BE6 65DB1445
校验通过,解压 HBase 压缩文件
blockchain@Dao:~$ tar -zxvf Downloads/hbase-1.4.6-bin.tar.gz -C ~
编辑 ~/.bashrc ,在文件末尾添加
#HBase
export HBASE_HOME=$HOME/hbase-1.4.6
export PATH=$PATH:${HBASE_HOME}/bin
使配置立即生效
blockchain@Dao:~$ source ~/.bashrc
切换至 ${HBASE_HOME}/conf 目录,
blockchain@Dao:~$ cd ${HBASE_HOME}/conf ; ls -lt
total 40
-rw-r--r-- 1 blockchain blockchain 4949 7月 25 06:05 log4j.properties
-rw-r--r-- 1 blockchain blockchain 4603 7月 25 05:15 hbase-env.cmd
-rw-r--r-- 1 blockchain blockchain 7530 7月 25 05:15 hbase-env.sh
-rw-r--r-- 1 blockchain blockchain 1811 7月 21 06:49 hadoop-metrics2-hbase.properties
-rw-r--r-- 1 blockchain blockchain 2257 7月 21 06:49 hbase-policy.xml
-rw-r--r-- 1 blockchain blockchain 934 7月 21 06:49 hbase-site.xml
-rw-r--r-- 1 blockchain blockchain 10 7月 21 06:49 regionservers
修改 hbase-env.sh 中的部分内容:
# The java implementation to use. Java 1.7+ required.
# export JAVA_HOME=/usr/java/jdk1.6.0/
export JAVA_HOME=$HOME/jdk1.8.0_181
编辑 HBase 核心配置文件 hbase-site.xml,指定存储 HBase 和 ZooKeeper 数据的目录。HBase 数据,默认 会存储在 /tmp/hbase-${user.name} 目录下。很多Linux服务器在重启之后会删除 /tmp 目录,所以应该将数据存储在其它地方,配置如下:
hbase.cluster.distributed
true
hbase.rootdir
hdfs://localhost:9000/hbase
hbase.zookeeper.property.dataDir
/home/blockchain/zookeeper-3.4.13
启动 HDFS
blockchain@Dao:~$ hadoop-2.6.5/sbin/start-dfs.sh
Starting namenodes on [localhost]
localhost: starting namenode, logging to /home/blockchain/hadoop-2.6.5/logs/hadoop-blockchain-namenode-Dao.out
localhost: starting datanode, logging to /home/blockchain/hadoop-2.6.5/logs/hadoop-blockchain-datanode-Dao.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /home/blockchain/hadoop-2.6.5/logs/hadoop-blockchain-secondarynamenode-Dao.out
blockchain@Dao:~$ jps
15300 DataNode
15638 Jps
15144 NameNode
15502 SecondaryNameNode
blockchain@Dao:~$
启动 YARN
blockchain@Dao:~$ hadoop-2.6.5/sbin/start-yarn.sh
starting yarn daemons
starting resourcemanager, logging to /home/blockchain/hadoop-2.6.5/logs/yarn-blockchain-resourcemanager-Dao.out
localhost: starting nodemanager, logging to /home/blockchain/hadoop-2.6.5/logs/yarn-blockchain-nodemanager-Dao.out
blockchain@Dao:~$ jps
15985 Jps
15300 DataNode
15846 NodeManager
15702 ResourceManager
15144 NameNode
15502 SecondaryNameNode
blockchain@Dao:~$
启动 Historyserver
blockchain@Dao:~$ hadoop-2.6.5/sbin/mr-jobhistory-daemon.sh start historyserver
starting historyserver, logging to /home/blockchain/hadoop-2.6.5/logs/mapred-blockchain-historyserver-Dao.out
blockchain@Dao:~$ jps
16274 Jps
15300 DataNode
16229 JobHistoryServer
15846 NodeManager
15702 ResourceManager
15144 NameNode
15502 SecondaryNameNode
blockchain@Dao:~$
启动 HBase
blockchain@Dao:~$ hbase-1.4.6/bin/start-hbase.sh
localhost: running zookeeper, logging to /home/blockchain/hbase-1.4.6/bin/../logs/hbase-blockchain-zookeeper-Dao.out
running master, logging to /home/blockchain/hbase-1.4.6/logs/hbase-blockchain-master-Dao.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
: running regionserver, logging to /home/blockchain/hbase-1.4.6/logs/hbase-blockchain-regionserver-Dao.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
blockchain@Dao:~$ jps
17968 HQuorumPeer
18481 Jps
18179 HRegionServer
15300 DataNode
16229 JobHistoryServer
15846 NodeManager
15702 ResourceManager
15144 NameNode
15502 SecondaryNameNode
18046 HMaster
blockchain@Dao:~$
搭建完成。
登录 http://localhost:16010 ,查看 HBase 相关信息。