日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
【云原生】HBaseonK8s編排部署講解與實戰(zhàn)操作

【云原生】HBase on K8s 編排部署講解與實戰(zhàn)操作

作者:liugp 2023-03-01 07:42:12

云計算

云原生 HBase 良好的分布式架構(gòu)設(shè)計為海量數(shù)據(jù)的快速存儲、隨機(jī)訪問提供了可能,基于數(shù)據(jù)副本機(jī)制和分區(qū)機(jī)制可以輕松實現(xiàn)在線擴(kuò)容、縮容和數(shù)據(jù)容災(zāi),是大數(shù)據(jù)領(lǐng)域中 Key-Value 數(shù)據(jù)結(jié)構(gòu)存儲最常用的數(shù)據(jù)庫方案。

我們提供的服務(wù)有:網(wǎng)站建設(shè)、成都網(wǎng)站制作、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、沁源ssl等。為上1000+企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的沁源網(wǎng)站制作公司

一、概述

HBase 是一個面向列式存儲的分布式數(shù)據(jù)庫,其設(shè)計思想來源于 Google 的 BigTable 論文。HBase 底層存儲基于 HDFS 實現(xiàn),集群的管理基于 ZooKeeper 實現(xiàn)。HBase 良好的分布式架構(gòu)設(shè)計為海量數(shù)據(jù)的快速存儲、隨機(jī)訪問提供了可能,基于數(shù)據(jù)副本機(jī)制和分區(qū)機(jī)制可以輕松實現(xiàn)在線擴(kuò)容、縮容和數(shù)據(jù)容災(zāi),是大數(shù)據(jù)領(lǐng)域中 Key-Value 數(shù)據(jù)結(jié)構(gòu)存儲最常用的數(shù)據(jù)庫方案。

  • 官方文檔:https://hbase.apache.org/book.html
  • GitHub地址:https://github.com/apache/hbase
  • 關(guān)于更多hbase的介紹,也可以參考我這篇文章:列式存儲的分布式數(shù)據(jù)庫——HBase(環(huán)境部署),
  • 因為hbase依賴于HDFS存儲,關(guān)于HDFS容器化部署可以參考我以下文章:【云原生】Hadoop on k8s 環(huán)境部署
  • 但是生產(chǎn)環(huán)境一般使用高可用的Hadoop的,關(guān)于高可用部署可參考我這篇文章:【云原生】Hadoop HA on k8s 環(huán)境部署
  • hbase依賴于Zookeeper,zookeeper容器化部署可以參考:【云原生】zookeeper + kafka on k8s 環(huán)境部署

二、開始編排部署(非高可用HDFS)

地址:https://artifacthub.io/packages/helm/hbase/hbase

1)下載chart 包

helm repo add hbase https://itboy87.github.io/bigdata-charts/

# hbase version 2.4.13
helm pull hbase/hbase --version 0.1.7

2)構(gòu)建鏡像

在下面連接hadoop高可用會重新構(gòu)建鏡像,這里就不重新構(gòu)建鏡像了,只是把遠(yuǎn)程的包推送到本地harbor倉庫

docker pull ghcr.io/fleeksoft/hbase/hbase-base:2.4.13.2

# tag
docker tag ghcr.io/fleeksoft/hbase/hbase-base:2.4.13.2 myharbor.com/bigdata/hbase-base:2.4.13.2

# push
docker push myharbor.com/bigdata/hbase-base:2.4.13.2

3)修改yaml編排(非高可用HDFS)

  • hbase/values.yaml
image:
repository: myharbor.com/bigdata/hbase-base
tag: 2.4.13.2
pullPolicy: IfNotPresent

...

conf:
hadoopUserName: admin
hbaseSite:
hbase.rootdir: "hdfs://hadoop-hadoop-hdfs-nn.hadoop:9000/hbase"
hbase.zookeeper.quorum: "zookeeper.zookeeper:2181"

...

hbase:
master:
replicas: 2

regionServer:
replicas: 2

# 禁用內(nèi)部的hadoop
hadoop:
enabled: false

# 禁用內(nèi)部的zookeeper
zookeeper:
enabled: false
  • hbase/templates/hbase-configmap.yaml
if [ ` `.`Values`.`hadoop`.`enabled ` = true ];then
NAMENODE_URL={{- printf "http://%s-hadoop-hdfs-nn:9870/index.html" .Release.Name }}
else
hadoop_url={{ index .Values.conf.hbaseSite "hbase.rootdir" }}
hadoop_url=`echo $hadoop_url|awk -F '/' '{print $3}'|awk -F':' '{print $1}'`
NAMENODE_URL=http://${hadoop_url}:9870/index.html
fi

4)開始部署

# 先檢查語法
helm lint ./hbase

# 開始安裝
helm install hbase ./hbase -n hbase --create-namespace

NOTES

NAME: hbase
LAST DEPLOYED: Sat Nov 5 15:44:14 2022
NAMESPACE: hbase
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. You can get an HBASE Shell by running this command:
kubectl exec -n hbase -it hbase-hbase-master-0 -- hbase shell

2. Inspect hbase master service ports with:
kubectl exec -n hbase describe service hbase-hbase-master

3. Create a port-forward to the hbase manager UI:
kubectl port-forward -n hbase svc/hbase-hbase-master 16010:16010

Then open the ui in your browser:

open http://localhost:16010

4. Create a port-forward to the hbase thrift manager UI:
kubectl port-forward -n hbase svc/hbase-hbase-master 9095:9095

Then open the ui in your browser:

open http://localhost:9095

HDFS

查看

kubectl get pods,svc -n hbase -owide

5)測試驗證

測試主備切換,重啟當(dāng)前active master pod

kubectl delete pod hbase-hbase-master-0 -n hbase

主備能正常切換

6)卸載

helm uninstall hbase -n hbase
# delete ns
kubectl delete ns hbase --force

三、開始編排部署(高可用 HDFS)

1)下載chart 包

helm repo add hbase https://itboy87.github.io/bigdata-charts/

# hbase version 2.4.13
helm pull hbase/hbase --version 0.1.7

2)構(gòu)建鏡像

這里是基于上面的鏡像進(jìn)行構(gòu)建,只是把hadoop打包到鏡像中,主要用的hadoop配置文件是core-site.yaml,hdfs-site.yaml

Dockerfile

FROM myharbor.com/bigdata/hbase-base:2.4.13.2

RUN mkdir -p /opt/apache

ENV HADOOP_VERSION=3.3.2

ADD hadoop-${HADOOP_VERSION}.tar.gz /opt/apache

ENV HADOOP_HOME=/opt/apache/hadoop

RUN ln -s /opt/apache/hadoop-${HADOOP_VERSION} $HADOOP_HOME

ENV HADOOP_CONF_DIR=${HADOOP_HOME}/et/hadoop

ENV PATH=${HADOOP_HOME}/bin:$PATH

開始構(gòu)建

docker build -t myharbor.com/bigdata/hbase-hdfs-ha:2.4.13.2 . --no-cache

### 參數(shù)解釋
# -t:指定鏡像名稱
# . :當(dāng)前目錄Dockerfile
# -f:指定Dockerfile路徑
# --no-cache:不緩存

# 推送到harbor
docker push myharbor.com/bigdata/hbase-hdfs-ha:2.4.13.2

3)修改配置

  • hbase-hdfs-ha/values.yaml
image:
repository: myharbor.com/bigdata/hbase-hdfs-ha
tag: 2.4.13.2
pullPolicy: IfNotPresent

...

conf:
hadoopUserName: admin
hbaseSite:
hbase.rootdir: "hdfs://myhdfs/hbase"
hbase.zookeeper.quorum: "zookeeper.zookeeper:2181"
  • hbase-hdfs-ha/templates/hbase-configmap.yaml
if [ {{ .Values.hadoop.enabled }} = true ];then
NAMENODE_URL={{- printf "http://%s-hadoop-hdfs-nn:9870/index.html" .Release.Name }}
else
NAMENODE_URL=http://hadoop-ha-hadoop-hdfs-nn-1.hadoop-ha:9870:9870/index.html
fi
# 先檢查語法
helm lint ./hbase-hdfs-ha

# 開始安裝
helm install hbase-hdfs-ha ./hbase-hdfs-ha -n hbase-hdfs-ha --create-namespace

NOTES

NAME: hbase-hdfs-ha
LAST DEPLOYED: Sat Nov 5 17:23:20 2022
NAMESPACE: hbase-hdfs-ha
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
1. You can get an HBASE Shell by running this command:
kubectl exec -n hbase-hdfs-ha -it hbase-hdfs-ha-hbase-master-0 -- hbase shell

2. Inspect hbase master service ports with:
kubectl exec -n hbase-hdfs-ha describe service hbase-hdfs-ha-hbase-master

3. Create a port-forward to the hbase manager UI:
kubectl port-forward -n hbase-hdfs-ha svc/hbase-hdfs-ha-hbase-master 16010:16010

Then open the ui in your browser:

open http://localhost:16010

4. Create a port-forward to the hbase thrift manager UI:
kubectl port-forward -n hbase-hdfs-ha svc/hbase-hdfs-ha-hbase-master 9095:9095

Then open the ui in your browser:

open http://localhost:9095

HDFS

查看

kubectl get pods,svc -n hbase-hdfs-ha

5)測試驗證

測試主備切換,重啟當(dāng)前active master pod

kubectl delete pod hbase-hbase-master-0 -n hbase

主備能正常切換

6)卸載

helm uninstall hbase-hdfs-ha -n hbase-hdfs-ha
# delete ns
kubectl delete ns hbase-hdfs-ha --force

git 地址:https://gitee.com/hadoop-bigdata/hbase-on-k8s


分享名稱:【云原生】HBaseonK8s編排部署講解與實戰(zhàn)操作
地址分享:http://www.5511xx.com/article/cceeeih.html