HBase:簡單的安裝和啓動(Quick Start)

1.聲明

當前內容主要用於本人學習和複習,當前內容主要是安裝啓動HBase

當前內容主要來源:HBase官方文檔

2.HBase是什麼?

這裏主要參考官方介紹:HBase官方介紹
Apache HBase™ is the Hadoop database, a distributed, scalable, big data store.

Apache HBase 是Hadoop的數據庫,一個分佈式的、可擴展的大數據存儲

Use Apache HBase™ when you need random, realtime read/write access to your Big Data. This project’s goal is the hosting of very large tables – billions of rows X millions of columns – atop clusters of commodity hardware. Apache HBase is an open-source, distributed, versioned, non-relational database modeled after Google’s Bigtable: A Distributed Storage System for Structured Data by Chang et al. Just as Bigtable leverages the distributed data storage provided by the Google File System, Apache HBase provides Bigtable-like capabilities on top of Hadoop and HDFS.

在你需要將大數據隨機實時的寫入和讀取的時候可以使用Apche HBase。該項目的目標是在商品硬件羣集上託管超大型表-數十億行X數百萬列Apache HBase是一個開源的,分佈式的。版本控制的,非關係型數據庫,主要參考Chang等人寫的谷歌的Bigtable(分佈式的結構化數據存儲系統)。就像Bigtable一樣利用Google文件系統提供的分佈式數據存儲。Apache HBase在Hadoop和HDFS之上提供了類似Bigtable的功能

分析以上就是,當前的HBase是利用Hadoop和HDFS來提供類似Bigtable的功能,一個分佈式的大數據存儲的非關係型的數據庫(一個數據庫)

3.Quick Start - Standalone HBase(快速啓動單機版的HBase)

This section describes the setup of a single-node standalone HBase. A standalone instance has all HBase daemons — the Master, RegionServers, and ZooKeeper — running in a single JVM persisting to the local filesystem. It is our most basic deploy profile. We will show you how to create a table in HBase using the hbase shell CLI, insert rows into the table, perform put and scan operations against the table, enable or disable the table, and start and stop HBase.

這部分描述瞭如何啓動單節點單例的HBase。一個單例版的HBase守護線程的實例包含有–Master,RegionServers,和Zookeeper—運行在單個JVM去維護本地文件系統。這是一個最基本的部署文件。我們將告訴你怎樣使用HBase Shell命令來實現創建表,向表中插入行,添加和掃描這個表的操作,啓用或者禁用表,和啓動和停駛HBase

分析發現當前的HBase啓動時需要JVM,也就是需要JAVA.

這裏是下載解壓操作。。。

配置JAVA_HOME

You must set the JAVA_HOME environment variable before starting HBase. To make this easier, HBase lets you set it within the conf/hbase-env.sh file. You must locate where Java is installed on your machine, and one way to find this is by using the whereis java command. Once you have the location, edit the conf/hbase-env.sh file and uncomment the line starting with #export JAVA_HOME=, and then set it to your Java installation path.

你必須啓動HBase之前設置JAVA_HOME環境變量。你必須在HBase中的conf/hbase-env.sh文件配置JAVA_HOME。你必須安裝在你的機器中安裝java,並且使用java命令查看是否安裝了如果你在conf/hbase-env.sh文件中一旦找到了以#export JAVA_HOME=開頭的位置,那麼你就在這裏設置你的java安裝路徑

開始實現解壓和配置JAVA_HOME操作
本人下載的路徑:HBase2.2.5官方下載

tar xvif hbase-2.2.5-bin.tar.gz

查看是否安裝了java

java

在當前的conf/hbase-env.sh中配置JAVA_HOME

vi conf/hbase-env.sh

在這裏插入圖片描述
當前的Java版本必須是1.8及以上版本

The bin/start-hbase.sh script is provided as a convenient way to start HBase. Issue the command, and if all goes well, a message is logged to standard output showing that HBase started successfully. You can use the jps command to verify that you have one running process called HMaster. In standalone mode HBase runs all daemons within this single JVM, i.e. the HMaster, a single HRegionServer, and the ZooKeeper daemon. Go to http://localhost:16010 to view the HBase Web UI.

這個bin/start-hbase.sh 腳本就是一種啓動HBase的方式。調用這個命令,並且如果一切都是好的,並打印輸出了日誌消息就表示HBase啓動成功。你可以使用jps命令去查看名稱爲HMaster的進程。在單機模式中HBase運行所有的後臺使用單個JVM。HMAster,一個單例的HRegionServer,和這個Zookeeper後臺。可以通過http://localhost:16010查看HBase的webui界面

啓動HBase和開放webui界面讓外界訪問

開放端口:16010

firewall-cmd --zone=public --add-port=16010/tcp --permanent
systemctl restart firewalld.service
firewall-cmd --reload

啓動HBase

./bin/start-hbase.sh

在這裏插入圖片描述
啓動成功,訪問webui界面
在這裏插入圖片描述

4.總結

1.HBase需要依賴jvm環境,需要java 1.8及以上版本才能啓動

2.通過配置conf/hbase-env.sh文件中的JAVA_HOME爲HBase配置java運行環境

3.通過conf/start-hbase.sh來啓動當前的HBase,並可以通過16010端口訪問webui界面

以上純屬個人見解,如有問題請聯本人!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章