hadoop单机伪分布安装HBase-1.4.8详细步骤(亲测成功)

---------前提:安装hadoop、yarn、jdk

1.下载解压

1.1使用wget下载

wget http://archive.apache.org/dist/hbase/1.4.8/hbase-1.4.8-bin.tar.gz

 

1.2解压到/usr/local目录下

tar -zxvf hbase-1.4.8-bin.tar.gz

mv hbase-1.4.8 /usr/local

1.3.修改hbase文件夹权限

chown -R hadoop:hadoop /usr/local/hbase-1.4.8

2.设置hbase环境变量--为了使用命令方便(替换成自己的安装路径)

vi /etc/profile

#hbase
export HBASE_HOME=/usr/local/hbase-1.4.8
PATH=$HBASE_HOME/bin:$PATH

2.1更新配置--使之生效

source /etc/profile

3.配置 hbase-env.sh文件(在$HBASE_HOME的conf下--下面配置文件也是在此目录下)

JAVA_HOME=添加jdk的安装路径
HBASE_MANAGES_ZK=true     #此配置信息,设置由hbase自己管理zookeeper,不需要单独的zookeeper

4.配置 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://master2:9000/hbase</value>
    </property>
    <property>
        <name>hbase.cluster.distributed</name>
        <value>true</value>
    </property>
    <property>
        <name>hbase.zookeeper.quorum</name>
        <value>master2</value>
    </property>

</configuration>

---开启集群顺序

hadoop-->yarn--->hbase

5.启动hadoop与yarn:

start-all.sh

6.启动hbase
start-hbase.sh

7.查看进程:红线框中的三个进程必须都有
jps

8.进入hbase shell:

hbase shell

9.主机IP:16010:---进入hbase的web页面

10.小总结

hbase:是分布式数据库,有是非关系型数据库

hdfs是分布式文件系统

nosql:非关系型数据库

不支持SQL语句,保存在数据库中的不是二维表格

nosql存储的类型:

1.key-value------对应的数据库redis

2.面向文档(例如百度文库、道客巴巴)--对应的数据库CouchDB

3.Column-Family 列式存储--hbase

4.图(数据结构)

Redis:l类似于map,数据放在内存中--读写数据非常快(用C\C++编写而成)

访问内存比磁盘快一千倍,一般数据库保存在磁盘中。

主要用于web应用的缓存

为什么使用nosql?

关系型数据库:1.扩展性差,2.大数据处理能力低

nosql补足了这些缺点,但是不能代替传统的数据库。

hbase集群的启动与单关闭

可以用强势方式:kill -9 id(id 是jps查看前面显示所对应的编码)

启动HBase集群:

bin/start-hbase.sh

单独启动一个HMaster进程:

bin/hbase-daemon.sh start master

单独停止一个HMaster进程:

bin/hbase-daemon.sh stop master

单独启动一个HRegionServer进程:

bin/hbase-daemon.sh start regionserver

单独停止一个HRegionServer进程:

bin/hbase-daemon.sh stop regionserver

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

脸ル粉嘟嘟

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值