hbase单节点安装部署
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了hbase单节点安装部署相关的知识,希望对你有一定的参考价值。
本次配置延续上次的hadoop伪分布式安装部署
资源下载
http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-3.4.12/zookeeper-3.4.12.tar.gz
http://mirror.bit.edu.cn/apache/hbase/stable/hbase-1.2.6-bin.tar.gz
1、为hadoop管理用户配置suduers权限并做主机名解析
[[email protected] hadoop]# vi /etc/sudoers
添加
hadoop ALL=(ALL) NOPASSWD: ALL
[[email protected] hadoop]# su hadoop
主机名解析
[[email protected] ~]$ sudo vi /etc/hosts
添加
192.168.120.131 master1
2、zookeeper环境配置
[[email protected] src]$ pwd
/home/hadoop/src
[[email protected] src]$ tar -xf zookeeper-3.4.12.tar -C /home/hadoop
[[email protected] src]$ cd ..
[[email protected] ~]$ mv zookeeper-3.4.12 zookeeper
修改环境变量
[[email protected] ~]$ vi ~/.bashrc
添加
export ZOOKEEPER_HOME=/home/hadoop/zookeeper
修改
export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin:$ZOOKEEPER_HOME/bin
使文件生效
[[email protected] ~]$ source ~/.bashrc
修改zookeeper配置文件
[[email protected] ~]$ cd zookeeper/conf
[[email protected] conf]$ cp zoo_sample.cfg zoo.cfg
修改
dataDir=/home/hadoop/zookeeper/data
添加
dataLogDir=/home/hadoop/zookeeper/datalog
[[email protected] conf]$ mkdir /home/hadoop/zookeeper/data
[[email protected] conf]$ mkdir /home/hadoop/zookeeper/datalog
启动ZK服务
[[email protected] conf]$ zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /home/hadoop/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
3、Hbase环境配置
[[email protected] src]$ pwd
/home/hadoop/src
[[email protected] src]$ tar zxf hbase-1.2.6-bin.tar -C ../
[[email protected] ~]$ mv hbase-1.2.6 hbase
修改环境变量
[[email protected] ~]$ vi ~/.bashrc
添加
export HBASE_HOME=/home/hadoop/hbase
修改
export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin:$ZOOKEEPER_HOME/bin:$HBASE_HOME/bin
使文件生效
[[email protected] ~]$ source ~/.bashrc
拷贝hadoop配置文件到hbase
[[email protected] ~]$ cp hadoop/etc/hadoop/core-site.xml hbase/conf/
[[email protected] ~]$ cp hadoop/etc/hadoop/hdfs-site.xml hbase/conf/
编辑hbase配置文件
[[email protected] ~]$ cd hbase/conf
[[email protected] conf]$ vi hbase-env.sh
添加
export JAVA_HOME=/home/hadoop/dk
export HBASE_MANAGES_ZK=false
[[email protected] conf]$ vi hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://master1:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>false</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>master1:2181</value>
</property>
<property>
<name>hbase.master.info.port</name>
<value>60010</value>
</property>
</configuration>
说明:
hbase.master.info.port参数配置的是hbase的web界面,不配置的话默认是不开启的。
启动Hbase服务
[[email protected] conf]$ start-hbase.sh
starting master, logging to /home/hadoop/hbase/logs/hbase-hadoop-master-master1.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
对于出现的警告信息做以下处理
[[email protected] conf]$ vi hbase-env.sh
注释
#export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m"
#export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m"
查看服务
[[email protected] conf]$ jps
1632 SecondaryNameNode
1793 ResourceManager
1362 NameNode
1491 DataNode
1913 NodeManager
5374 QuorumPeerMain
5966 HMaster
6255 Jps
可以通过http://192.168.120.131:60010打开hbase的web界面了。
以上是关于hbase单节点安装部署的主要内容,如果未能解决你的问题,请参考以下文章
HBase探索篇 _ 单节点多RegionServer部署与性能测试
Kubernetes 集群 之 二进制安装部署(单Master节点)