zoukankan      html  css  js  c++  java
  • HBase1.2.4基于hadoop2.4搭建

    1、安装JDK1.7, Hadoop2.4

    2、下载 hbase 安装包

    下载地址:http://apache.fayea.com/hbase/1.2.4/hbase-1.2.4-bin.tar.gz

    3、解压

    mv hbase-1.2.4-bin.tar.gz /usr/local

    tar zxvf hbase-1.2.4-bin.tar.gz hbase

    4、编辑 hbase/conf/hbase-site.xml 

    gedit /usr/local/hbase/conf/hbase-site.xml 

    加入以下配置

     1 <configuration>
     2 <property>
     3         <!-- 存放hbase数据的hdfs文件夹地址-->
     4     <name>hbase.rootdir</name>
     5     <value>hdfs://master:9000/hbase</value>
     6 </property>
     7 <property>
     8     <name>hbase.cluster.distributed</name>
     9     <value>true</value>
    10 </property>
    11 <property>
    12         <!-- hbase提供的服务地址-->
    13     <name>hbase.master</name>
    14     <value>hdfs://master:60000</value>
    15 </property>
    16 <property>
    17         <!-- 设置zookeeper连接超时时间-->
    18      <name>zookeeper.session.timeout</name>
    19      <value>120000</value>
    20 </property>
    21 <property>  
    22         <!-- 设置zookeeper节点的地址-->
    23     <name>hbase.zookeeper.quorum</name>  
    24     <value>master,slave1,slave2,slave3</value>  
    25 </property>
    26 <property>
    27         <!-- 设置zookeeper的端口-->
    28     <name>hbase.zookeeper.property.clientPort</name>
    29     <value>2181</value>
    30 </property>    
    31 </configuration>

    5、编辑hbase-env.sh

    gedit /usr/local/hbase/conf/hbase-env.sh

    加入以下配置(#hbase自带zookeeper服务,但是性能很差,我这里只为搭建测试环境,所以不需要单独安装zookeeper,所以设置为true,在实际生产环境中应为false,系统默认为false)

    export JAVA_HOME=/usr/local/jdk7 
    export HBASE_MANAGES_ZK=true 

    6、编辑regionservers

    gedit /usr/local/hbase/conf/regionservers

    加入集群的名称

    master
    slave1
    slave2
    slave3

    7、复制配置好hbase目录到其余的子节点slave1,slave2,slave3的对应的路径里面

    8、

    同步各节点时间,如果时间不一样,无法启动集群,时间差在1秒以内才能稳定

    (1)通过网络来同步

    apt-get install ntpdate

    ntpdate cn.pool.ntp.org

    (2)把master作为时间服务器,来让其他服务器同步

    apt-get install install ntp

    gedit /etc/ntp.conf

    在后面加上

    server 127.127.1.0

    Fudge 127.127.1.0 stratum 10

    重新启动服务:

    service ntp stop

    service ntp start

    这样master的时间服务器就启动了,就在子节点输入以下命令

    master的ip为192.168.1.134

    ntpdate -u 192.168.1.134

    9、启动hbase

    启动之前需要启动hadoop,然后再启动hbase,

    cd /usr/local/hbase/bin

    start-hbase.sh

    10、通过jps查看进程

    主节点和子节点都有一下两个进程,启动以后等几分钟再查看,看挂掉没有

    HRegionServer
    HMaster

    11、启动 Hbase的rest服务

    cd /usr/local/hbase

    bin/hbase rest start -p 6000

    启动后,jps可以看到这个进程
    RESTServer

    12、启动Hbase Shell

    cd /usr/local/hbase

    bin/hbase shell

    详细命令,参考:http://www.cnblogs.com/nexiyi/p/hbase_shell.html

  • 相关阅读:
    收藏转载:一些视频流地址
    转载收藏:Android 输入法表情上传服务器
    Android N 的开机启动流程概述
    列举至少3种Support包中提供的布局或工具
    代码混淆定义
    应用内存优化主要思路
    锁屏的一些动画
    毛玻璃效果
    关于宏定义
    openresty性能测试报告分析
  • 原文地址:https://www.cnblogs.com/zhang-ke/p/6280174.html
Copyright © 2011-2022 走看看