Linux系統HBASE集群搭建手冊

2021-10-10 11:49:52 字數 3119 閱讀 1542

hbase安裝

說明:

hbase需要zookeeper來管理集群,所以安裝hbase前需要先安裝zookeeper。

安裝zookeeper請參考:

一、上傳壓縮檔案並解壓

hbase-1.2.0-bin.tar.gz

[root@centos10 tools]# rz             //上傳命令
解壓:

[root@centos10 tools]# tar –zxvf hbase-1.2.0-bin.tar.gz
二、配置環境變數並生效

[root@centos10 ~]# vi /etc/profile

export hbase_home=/usr/tools/hbase-1.2.6

export path=$path:$hbase_home/bin

使環境變數生效

[root@centos10 ~]# source /etc/profile

三、修改配置檔案

進入hbase的conf目錄,修改三個檔案:hbase-env.shhbase-site.xmlregionservers

1、hbase-env.sh

修改:export hbase_manages_zk = false

[root@centos10 conf]# vi hbase-env.sh

# tell hbase whether it should manage it's own instance of zookeeper or not.

export hbase_manages_zk=false(這是hbase內嵌的zookeeper,針對單機版,我們的集群,所用不用他的,置為false)

2、hbase-site.xml

hbase.zookeeper.quorum

vrm201,vrm202,vrm203--三個節點的名稱

the directory shared by regionservers.

hbase.zookeeper.property.datadir

/usr/tools/hbase-1.2.0/zookeeperdata--定義zookeeper目錄

property from zookeeper config zoo.cfg.the directory where the snapshot is stored.

hbase.tmp.dir

/usr/tools/hbase-1.2.0/tmpdata--注意版本號

hbase.rootdir

hdfs://vrm201:9000/hbase--這是namenode(vrm201)的名字

the directory shared by regionservers.

hbase.cluster.distributed

true--是否是分布式(如果是就設定成true)

the mode the cluster will be in. possible values are false: standalone and pseudo-distributed setups with managed zookeeper true: fully-distributed with unmanaged zookeeper quorum (see hbase-env.sh)

3、regionservers(檔案中新增各個從屬伺服器的ip或者hostname)

注:如果此檔案中含有localhost,則把localhost刪除!!!      

[root@centos11 conf]# vi regionservers

centos11

centos12

centos13

四、拷貝檔案到其它節點

儲存後分別把hbase的整個資料夾拷貝到其它伺服器:

[root@centos11 ~]# scp -r /usr/tools/hbase-1.2.6 root@centos12:/usr/tools/

[root@centos11 ~]# scp -r /usr/tools/hbase-1.2.6 root@centos13:/usr/tools/

五、啟動/停止hbase

hbase的啟動依賴zookeeper和hdfs,所以hbase啟動前需要先啟動zookeeper和hadoop(hbase資料儲存在hdfs)

hbase在hadoop的namenode(主節點)節點上啟動命令:      

[root@centos11 ~]# start-hbase.sh
hbase停止命令(同樣在主節點進行):

[root@centos11 ~]# stop-hbase.sh
啟動後主節點程序:jps(如果子節點無相應程序,則檢視一下時間是否同步)

hregionserver

hmaster

子節點程序:

hregionserver

六、hbase配置高可用

配置高可用(當hmaster掛掉後,有乙個新的hmaster接替掛掉hmaster繼續工作)

配置高可用:

1、首先停掉hbase,命令:stop-hbase.sh。

2、進入hbase的安裝目錄conf下,新建檔案backup-masters(這個名字是固定的,不可改變),檔案內容寫上下乙個用來接替hmaster工作的主機名字,然後把此檔案拷貝到各個節點的相同位置上(當hmaster掛掉後,新的備用hmaster自動接替)。

zookeeper在linux上的集群搭建

1.用stfp等檔案傳輸軟體將linux版本的zookeeper傳輸到linux中 2.在檔案中進行解壓命令為 tar zxvf 檔名 路徑 檔名 c 解壓路徑 3.可以將解壓後的一些無用檔案刪除 doc src 1.進入conf這個檔案中,複製zoo sample.cfg並改名為zoo.cfg 2...

zookeeper windows偽集群搭建

解壓後,目錄重新命名為zookeeper1,進入 conf目錄,把zoo sample.cfg 複製乙份,重新命名為zoo.cfg 編輯zoo cfg 配置資料目錄和日誌目錄 先在zookeeper1目錄下,新建目錄 data logs 日誌目錄 datadir tmp zookeeper data...

redis集群redis cluster搭建

這是來自redis官網的一段介紹,大概意思就是 redis是乙個開源 bsd許可 的記憶體資料結構儲存,用作資料庫 快取和訊息 它支援諸如字串 雜湊 列表 集 帶範圍查詢的排序集 位圖 hyperloglogs 帶半徑查詢和流的地理空間索引等資料結構。redis具有內建的複製 lua指令碼 lru清...