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

版权声明:本文为IT晓白博主原创文章,转载请附上博文链接! https://blog.csdn.net/qq_38617531/article/details/83315115

---------前提:安装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

猜你喜欢

转载自blog.csdn.net/qq_38617531/article/details/83315115