码迷,mamicode.com
首页 > 其他好文 > 详细

hbase单节点安装部署

时间:2018-06-14 20:46:04      阅读:300      评论:0      收藏:0      [点我收藏+]

标签:table   伪分布式   sbin   targe   option   java_home   说明   .com   rem   

本次配置延续上次的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权限并做主机名解析

[root@master1 hadoop]# vi /etc/sudoers

添加

hadoop  ALL=(ALL)       NOPASSWD:       ALL


[root@master1 hadoop]# su hadoop

主机名解析

[hadoop@master1 ~]$ sudo vi /etc/hosts

添加

192.168.120.131 master1


2、zookeeper环境配置

[hadoop@master1 src]$ pwd

/home/hadoop/src

[hadoop@master1 src]$ tar -xf zookeeper-3.4.12.tar -C /home/hadoop

[hadoop@master1 src]$ cd ..

[hadoop@master1 ~]$ mv zookeeper-3.4.12 zookeeper


修改环境变量

[hadoop@master1 ~]$ vi ~/.bashrc

添加

export ZOOKEEPER_HOME=/home/hadoop/zookeeper

修改

export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin:$ZOOKEEPER_HOME/bin


使文件生效

[hadoop@master1 ~]$ source ~/.bashrc


修改zookeeper配置文件

[hadoop@master1 ~]$ cd zookeeper/conf

[hadoop@master1 conf]$ cp zoo_sample.cfg zoo.cfg

修改

dataDir=/home/hadoop/zookeeper/data

添加

dataLogDir=/home/hadoop/zookeeper/datalog


[hadoop@master1 conf]$ mkdir /home/hadoop/zookeeper/data

[hadoop@master1 conf]$ mkdir /home/hadoop/zookeeper/datalog


启动ZK服务

[hadoop@master1 conf]$ zkServer.sh start

ZooKeeper JMX enabled by default

Using config: /home/hadoop/zookeeper/bin/../conf/zoo.cfg

Starting zookeeper ... STARTED


3、Hbase环境配置

[hadoop@master1 src]$ pwd

/home/hadoop/src

[hadoop@master1 src]$ tar zxf hbase-1.2.6-bin.tar -C ../

[hadoop@master1 ~]$ mv hbase-1.2.6 hbase


修改环境变量

[hadoop@master1 ~]$ vi ~/.bashrc

添加

export HBASE_HOME=/home/hadoop/hbase

修改

export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin:$ZOOKEEPER_HOME/bin:$HBASE_HOME/bin


使文件生效

[hadoop@master1 ~]$ source ~/.bashrc


拷贝hadoop配置文件到hbase

[hadoop@master1 ~]$ cp hadoop/etc/hadoop/core-site.xml hbase/conf/

[hadoop@master1 ~]$ cp hadoop/etc/hadoop/hdfs-site.xml hbase/conf/


编辑hbase配置文件

[hadoop@master1 ~]$ cd hbase/conf

[hadoop@master1 conf]$ vi hbase-env.sh

添加

export JAVA_HOME=/home/hadoop/dk

export HBASE_MANAGES_ZK=false


[hadoop@master1 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服务

[hadoop@master1 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


对于出现的警告信息做以下处理

[hadoop@master1 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"


查看服务

[hadoop@master1 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单节点安装部署

标签:table   伪分布式   sbin   targe   option   java_home   说明   .com   rem   

原文地址:http://blog.51cto.com/xiaoxiaozhou/2129499

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!