k8s hue+hdfs+hive实验环境部署

预先安装好了vagrant+virtualbox+docker+minikube(minik8s),并修改了本地hostk8s为vagrant配置的虚拟机的ip

开启minikube

先去阿里弄一下镜像加速地址链接,获取类似https://xxx.mirror.aliyuncs.com的加速地址

#minikube start --registry-mirror=https://xxx.mirror.aliyuncs.com #开启minikube
minikube start --registry-mirror=http://hub-mirror.c.163.com --cpus=4 --memory=4096mb -p test #启动一个4G内存使用163docker加速的test minikube容器
minikube profile test#切换管理test容器
nohup minikube dashboard 1>>dashboard.log 2>>dashboard.err & #后台运行仪表盘
nohup kubectl proxy --port=80 --address='0.0.0.0' --accept-hosts='^.*' > /dev/null 2>&1 & #后台运行代理映射到外网

访问 http://k8s/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/#/overview?namespace=default 注意k8s域名改成你自己的ip或者域名
在这里插入图片描述

安装helm

下载最新版目前是3.4.1github|csdn,可以wget,因为我本地有我直接放在vagrant共享目录里,然后一套连招

mv /vagrant/helm-v3.4.1-linux-amd64.tar.gz ./ &&  tar -zxvf helm-v3.4.1-linux-amd64.tar.gz && sudo mv linux-amd64/helm /usr/local/bin/helm && chmod +x /usr/local/bin/helm && sudo ln -s /usr/local/bin/helm /usr/bin/helm && rm -rf helm-v3.4.1-linux-amd64.tar.gz linux-amd64/

helm

helm doc

分别启动方式

安装hue

helm repo add gethue https://helm.gethue.com
helm repo update
helm install gethue/hue --generate-name
kubectl port-forward svc/hue 8888:8888 --address 0.0.0.0 & #开放访问

等待部署完成,部署情况可以进minikube仪表盘的pods项查看
访问http://k8s:8888/
在这里插入图片描述

HDFS

helm repo add gradiant https://gradiant.github.io/charts/
helm install hdfs --set dataNode.replicas=1 gradiant/hdfs #单数据节点
kubectl port-forward -n default hdfs-namenode-0 50070:50070 --address 0.0.0.0

hue直连hdfs需要增加配置(property是在configuration项包裹里)
[core-site.xml] hdfs namenode允许启动httpfs的linux用户访问

<property><name>hadoop.proxyuser.hdfs.hosts</name><value>*</value></property>
<property><name>hadoop.proxyuser.hdfs.groups</name><value>*</value></property>

[hdfs-site.xml]关闭文件权限控制,天下大同

<property><name>dfs.permissions.enabled</name><value>false</value></property>

[httpfs-site.xml]允许httpfs使用hue用户访问(hue默认使用hue用户并doas admin使用admin用户的马甲,并且需要注意与core-site.xml不同的是属性的开头是httpfs不是Hadoop)

<property><name>httpfs.proxyuser.hue.hosts</name><value>*</value></property>
<property><name>httpfs.proxyuser.hue.groups</name><value>*</value></property>

HIVE

helm repo add gradiant https://gradiant.github.io/charts/
helm inspect values gradiant/hive #查看可配置值
helm install hive --set metastore.enabled=false --set hdfs.dataNode.replicas=1 gradiant/hive #不使用元数据和hdfs数据节点只用一个节点
kubectl port-forward -n default svc/hive-server 10000:10000 --address 0.0.0.0

在这里插入图片描述

自制chart

#创建图表
helm create hivedev
#进入项目
cd hivedev
#追加依赖
cat << EOF >> Chart.yaml
dependencies:
  - name: hue
    version: 1.0.0
    repository: https://helm.gethue.com/
  - name: hive
    version: 0.1.5
    repository: https://gradiant.github.io/charts
EOF
#更新依赖
helm dependency update
#设置默认值
cat << EOF > values.yaml
hive:
  #根据机器情况调整配置
  hdfs:
    dataNode:
      replicas: 1
      resources:
        limits:
          memory: 512Mi
          cpu: 250m
    nameNode:
      resources:
        limits:
          memory: 512Mi
          cpu: 250m
    conf:
      coreSite:
        hadoop.proxyuser.hdfs.hosts: "*"
        hadoop.proxyuser.hdfs.groups: "*"
      httpfsSite:
        httpfs.proxyuser.hue.hosts: "*"
        httpfs.proxyuser.hue.groups: "*"
      hdfsSite:
        dfs.replication: 1
        dfs.permissions.enabled: false
hue:
  hue:
    ini: |
      [desktop]
        app_blacklist=search,hbase,security,jobbrowser,oozie
      [beeswax]
        hive_server_host=hive-server
        hive_server_port=10000
      [hadoop]
      [[hdfs_clusters]]
      [[[default]]]
        fs_defaultfs=hdfs://hive-hdfs:8020
        webhdfs_url=http://hive-hdfs-httpfs:14000/webhdfs/v1
    interpreters: |
      [[[postgresql]]]
        name = postgresql
        interface=sqlalchemy
        options='{"url": "postgresql://hue:hue@hue-postgres:5432/hue"}'
      [[[hive]]]
        name=Hive
        interface=hiveserver2
EOF
#修改hive-server的live in为60s
kubectl port-forward svc/hue 8888:8888 --address 0.0.0.0
  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值