环境
操作系统及内核版本
cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
uname -a
Linux master01 3.10.0-1127.18.2.el7.x86_64 #1 SMP Sun Jul 26 15:27:06 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
k8s软件相关版本
kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:56:40Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:48:36Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
kubelet --version
Kubernetes v1.18.2
docker -v
Docker version 19.03.12, build 48a66213fe
helm版本
kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:54:15Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
helm version
Client: &version.Version{SemVer:"v2.16.6", GitCommit:"dd2e5695da88625b190e6b22e9542550ab503a47", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.16.6", GitCommit:"dd2e5695da88625b190e6b22e9542550ab503a47", GitTreeState:"clean"}
安装hadoop,首先查看可用的软件
helm search hadoop
NAME CHART VERSION APP VERSION DESCRIPTION
stable/hadoop 1.0.4 2.7.3 The Apache Hadoop software library is a framework that al...
stable/luigi 2.7.2 Luigi is a Python module that helps you build complex pip...
报错
helm install stable/hadoop
Error: validation failed: unable to recognize "": no matches for kind "StatefulSet" in version "apps/v1beta1"
解决
在/root/.helm/cache/archive目录下有hadoop相关的压缩文件,如图
解压
cd /root/.helm/cache/archive/
tar zxvf hadoop-1.0.4.tgz
查看k8s支持的api版本
修改api版本
cd hadoop/templates/
sed -i 's#apiVersion: apps/v1beta1#apiVersion: apps/v1#g' hdfs-dn-statefulset.yaml
sed -i 's#apiVersion: apps/v1beta1#apiVersion: apps/v1#g' hdfs-nn-statefulset.yaml
sed -i 's#apiVersion: apps/v1beta1#apiVersion: apps/v1#g' yarn-nm-statefulset.yaml
sed -i 's#apiVersion: apps/v1beta1#apiVersion: apps/v1#g' yarn-rm-statefulset.yaml
从本地安装hadoop
helm install /root/.helm/cache/archive/hadoop
Error: release linting-hound failed: StatefulSet.apps "linting-hound-hadoop-yarn-nm" is invalid: [spec.selector: Required value, spec.template.metadata.labels: Invalid value: map[string]string{"app":"hadoop", "component":"yarn-nm", "release":"linting-hound"}: `selector` does not match template `labels`]
cd /root/.helm/cache/archive/hadoop/templates/
vim hdfs-dn-statefulset.yaml
红框内是新加的
cd /root/.helm/cache/archive/hadoop/templates/
vim hdfs-nn-statefulset.yaml
cd /root/.helm/cache/archive/hadoop/templates/
vim yarn-nm-statefulset.yaml
cd /root/.helm/cache/archive/hadoop/templates/
vim yarn-rm-statefulset.yaml