Linux巩固记录 Hbase安装

Posted 肖哥哥  changw.xiao@qq.

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux巩固记录 Hbase安装相关的知识,希望对你有一定的参考价值。

zookeeper安装好,并启动成功后,接下来开始安装hbase

#下载hbase
wget http://mirror.bit.edu.cn/apache/hbase/1.3.1/hbase-1.3.1-bin.tar.gz
[[email protected] home]# ll
total 103248
drwxr-xr-x.  8 root         root               191 Sep  5 22:31 eclipse
drwxr-xr-x. 13        20415          101       195 Sep  5 21:29 hadoop-2.7.4
-rw-r--r--.  1 root         root         105718722 Jun 20 18:41 hbase-1.3.1-bin.tar.gz
drwxr-xr-x.  8           10          143       255 Jul 22 13:11 jdk1.8.0
drwx------.  3 xiaochangwei xiaochangwei        78 Sep  5 01:01 xiaochangwei
drwxr-xr-x. 10         1001         1001      4096 Sep  7 22:05 zookeeper-3.4.10
[[email protected] home]# 
#解压到当前的home目录
tar -zxvf hbase-1.3.1-bin.tar.gz
#添加环境变量
vi /etc/profile

#内容如下红色部分,其他为之前配置的
export JAVA_HOME=/home/jdk1.8.0
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin 
export JAVA_HOME
export PATH
export CLASSPATH


export HADOOP_HOME=/home/hadoop-2.7.4
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export YARN_CONF_DIR=$HADOOP_HOME/etc/hadoop


export HBASE=/home/hbase-1.3.1
export PATH=$HBASE/bin:$PATH
#使配置立即生效并验证
[[email protected] hbase-1.3.1]# source /etc/profile
[[email protected] hbase-1.3.1]# hbase
Usage: hbase [<options>] <command> [<args>]
Options:
  --config DIR     Configuration direction to use. Default: ./conf
  --hosts HOSTS    Override the list in ‘regionservers‘ file
  --auth-as-server Authenticate to ZooKeeper using servers configuration

Commands:
Some commands take arguments. Pass no args or -h for usage.
  shell           Run the HBase shell
  hbck            Run the hbase ‘fsck‘ tool
  snapshot        Tool for managing snapshots
  snapshotinfo    Tool for dumping snapshot information
  wal             Write-ahead-log analyzer
  hfile           Store file analyzer
  zkcli           Run the ZooKeeper shell
  upgrade         Upgrade hbase
  master          Run an HBase HMaster node
  regionserver    Run an HBase HRegionServer node
  zookeeper       Run a Zookeeper server
  rest            Run an HBase REST server
  thrift          Run the HBase Thrift server
  thrift2         Run the HBase Thrift2 server
  clean           Run the HBase clean up script
  classpath       Dump hbase CLASSPATH
  mapredcp        Dump CLASSPATH entries required by mapreduce
  pe              Run PerformanceEvaluation
  ltt             Run LoadTestTool
  canary          Run the Canary tool
  version         Print the version
  CLASSNAME       Run the class named CLASSNAME
[[email protected] hbase-1.3.1]# 
#修改hbase的环境变量和jdk环境变量
vi /home/hbase-1.3.1/conf/hbase-env.sh

export JAVA_HOME=/home/jdk1.8.0/
export HBASE_CLASSPATH=/home/hbase-1.3.1/conf
#配置
vi /home/hbase-1.3.1/conf/hbase-site.xml

#修改为
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
/**
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-->
<configuration>
    <property>
        <name>hbase.rootdir</name>
        <value>hdfs://master:9000/hbase</value>
    </property>
    <property>
        <name>hbase.cluster.distributed</name>
        <value>true</value>
    </property>
    <property>
        <name>hbase.zookeeper.quorum</name>
        <value>master,slave1,slave2</value>
    </property>
    <property>
        <name>hbase.tmp.dir</name>
        <value>/tmp/hbase</value>
    </property>
    <property>
        <name>hbase.master</name>
        <value>hdfs://master:60000</value>
    </property>
    <property>
        <name>hbase.zookeeper.property.dataDir</name>
        <value>/tmp/zookeeper</value>
    </property>
</configuration>
#配置从节点
vi /home/hbase-1.3.1/conf/regionservers

#去掉里面的localhost,修改为
slave1
slave2


#分别拷贝到slave节点 scp -r /home/hbase-1.3.1/ slave1:/home/ scp -r /home/hbase-1.3.1/ slave2:/home/

 

接下来依次启动hadoop-》zookeeper(每个几点要分别启动)-》hbase

 









以上是关于Linux巩固记录 Hbase安装的主要内容,如果未能解决你的问题,请参考以下文章

Linux巩固记录 hadoop 2.7.4下自己编译代码并运行MapReduce程序

hadoop学习记录HBase基本概念

Linux巩固记录 hadoop 2.7.4 环境搭建

Linux巩固记录 java项目的编译和执行

Linux巩固记录 J2EE开发环境搭建及网络配置

Linux下一次数据仓库进行迁移记录