1,前言:
hbase 是hadoop database的缩写,是一个高可靠性、高性能、面向列、可伸缩的分布式存储系统,利用HBase技术可在廉价PC Server上搭建起大规模结构化存储集群。
2,安装
2.1,hbase官网下载安装包,根据官方建议,使用stable版本
2.2,新建hbase安装目录,解压安装包到当前目录
mkdir -p /opt/hbase chown hadoop:hadoopGroup /opt/hbase tar -zxvf hbase-1.2.6-bin.tar.gz
2.3,配置hbase配置文件
hbase配置文件目录:/opt/hbase/hbase-1.2.6/conf
2.3.1,修改hbase-env.sh,
配置JAVA_HOME,HBASE_CLASSPATH,
这里使用hbase自带的zookeeper服务管理集群,故设置HBASE_MANAGES_ZK为true.
# The java implementation to use. Java 1.7+ required. export JAVA_HOME=/usr/local/java/jdk1.8.0_161 # Extra Java CLASSPATH elements. Optional. export HBASE_CLASSPATH=/opt/hbase/conf ... # Tell HBase whether it should manage it's own instance of Zookeeper or not. export HBASE_MANAGES_ZK=true
2.3.2,修改hbase-site.xml:
<configuration> <property> <name>hbase.rootdir</name> <!-- hbase存放数据目录 --> <value>hdfs://master:9000/hbase/hbase_db</value> <!-- 端口要和Hadoop的fs.defaultFS端口一致--> </property> <property> <name>hbase.cluster.distributed</name> <!-- 是否分布式部署 --> <value>true</value> </property> <property> <name>hbase.master</name> <value>master:60000</value> </property> <property> <name>hbase.zookeeper.quorum</name> <!-- list of zookooper --> <value>master,base0186,base0185,base0184,base0183</value> </property> <property> <!--zookooper配置、日志等的存储位置 --> <name>hbase.zookeeper.property.dataDir</name> <value>/opt/hbase/zookeeper</value> </property> </configuration>
2.4,修改regionservers,跟hadoop配置文件相似,增加节点hostname
[hadoop@master conf]$ cat regionservers base0183 base0184 base0185 base0186
2.5,修改环境变量vi .bash_profile
export HBASE_HOME=/opt/hbase/hbase-1.2.6 export PATH=$JAVA_HOME/bin:$PATH:$HADOOP_HOME/bin:$HIVE_HOME/bin:$HBASE_HOME/bin
source .bash_profile
2.6,同步hbase安装文件,环境变量.bash_profile文件到各个slave节点
scp -r /opt/hbase/hbase-1.2.6 hadoop@base0186:/opt/hbase/ scp -r /opt/hbase/hbase-1.2.6 hadoop@base0185:/opt/hbase/ scp -r /opt/hbase/hbase-1.2.6 hadoop@base0184:/opt/hbase/ scp -r /opt/hbase/hbase-1.2.6 hadoop@base0183:/opt/hbase/
2.7,启动hbase
start-hbase.sh
[hadoop@master conf]$ start-hbase.sh master: starting zookeeper, logging to /opt/hbase/hbase-1.2.6/bin/../logs/hbase-hadoop-zookeeper-master.out base0183: starting zookeeper, logging to /opt/hbase/hbase-1.2.6/bin/../logs/hbase-hadoop-zookeeper-base0183.out base0186: starting zookeeper, logging to /opt/hbase/hbase-1.2.6/bin/../logs/hbase-hadoop-zookeeper-base0186.out base0185: starting zookeeper, logging to /opt/hbase/hbase-1.2.6/bin/../logs/hbase-hadoop-zookeeper-base0185.out base0184: starting zookeeper, logging to /opt/hbase/hbase-1.2.6/bin/../logs/hbase-hadoop-zookeeper-base0184.out starting master, logging to /opt/hbase/hbase-1.2.6/logs/hbase-hadoop-master-master.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 base0184: starting regionserver, logging to /opt/hbase/hbase-1.2.6/bin/../logs/hbase-hadoop-regionserver-base0184.out base0186: starting regionserver, logging to /opt/hbase/hbase-1.2.6/bin/../logs/hbase-hadoop-regionserver-base0186.out base0183: starting regionserver, logging to /opt/hbase/hbase-1.2.6/bin/../logs/hbase-hadoop-regionserver-base0183.out base0185: starting regionserver, logging to /opt/hbase/hbase-1.2.6/bin/../logs/hbase-hadoop-regionserver-base0185.out base0184: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0 base0184: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0 base0186: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0 base0186: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0 base0183: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0 base0183: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0 base0185: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0 base0185: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0 [hadoop@master conf]$ jps 3249 SecondaryNameNode 29221 HQuorumPeer 2441 NameNode 29338 HMaster 3514 ResourceManager 29677 Jps [hadoop@master conf]$
2.8,通过web访问http://10.1.88.187:16010/master-status
ε≡٩(๑>₃<)۶ 日月同心