《自己动手写云盘》 – 搭建Hbase环境

 人个主页链接:http://www.tongtongxue.com/archives/4669.html

 

  软件准备

1、zookeeper-3.4.9.tar.gz

2、hbase-1.1.7-bin.tar.gz

  安装Zookeeper

由于Hbase的需要zookpeeper的协同管理,所以先把Zookeeper安装好。

1、首先从Apache网站将zookeeper下载下来;

2、将zookeeper安装包通过xshell工具上传到linux服务器上,然后输入解压命令:

 

tar -zxvf zookeeper-3.4.9.tar.gz

 3、进入conf文件夹,新建zoo.cfg配置文件,配置如下:

 

 

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/opt/zookeeper/data
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1

 4、配置环境变量

 

打开配置环境变量文件

 

vi /etc/profile

 配置如下信息

 

 

export ZOOKEEPER_HOME=/opt/zookeeper
export PATH=$JAVA_HOME/bin:$HADOOP_HOME/bin:$ZOOKEEPER_HOME/bin:$PATH

 5、启动Zookeeper

 

在启动zookeeper之前,可以先将hadoop的hdfs环境启动直起来,即

 

sbin/start-dfs.sh

 然后启动zookeeper

 

 

zkServer.sh start 

 

  安装Hbase

1、在Apache网站中下载hbase;

2、将文件上传到linux服务器,解压文件

 

tar -zxvf hbase-1.1.7-bin.tar.gz

 3、配置环境变量

 

 

export HBASE_HOME=/opt/hbase
export PATH=$JAVA_HOME/bin:$HADOOP_HOME/bin:$ZOOKEEPER_HOME/bin:$HBASE_HOME/bin:$PATH

 4、编辑hbase-env.sh

 

在conf文件夹中,找到hbase-env.sh,修改如下:

 

# The java implementation to use.  Java 1.7+ required.
export JAVA_HOME=/opt/jdk1.7.0_67

# Extra Java CLASSPATH elements.  Optional.
export HBASE_CLASSPATH=/opt/hadoop/etc/hadoop

# Tell HBase whether it should manage it's own instance of Zookeeper or not.
export HBASE_MANAGES_ZK=true

 5、编辑hbase-site.xml

 

在conf文件夹中,找到hbase-site.xml文件,配置成:

 

<configuration>
        <property>
                <name>hbase.rootdir</name>
                <value>hdfs://yunpan:9000/hbase</value>
        </property>

        <property>
                <name>hbase.zookeeper.quorum</name>
                <value>yunpan</value>
        </property>

        <property>
                <name>hbase.cluster.distributed</name>
                <value>true</value>
        </property>
</configuration>

 6、启动Hbase

 

 

start-hbase.sh 

 

   关注微信公众号



 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值