1 環境介紹
表1-1 環境版本
序號 |
資源項 |
資源名稱 |
1 |
云端Master |
2288H V5 X86 |
2 |
邊緣端 |
A500 3000 |
3 |
云端操作系統 |
Ubuntu 18.04.5 |
4 |
邊緣端操作系統 |
Euler2.8 |
5 |
邊緣端CANN軟件版本 |
20.1 |
6 |
kubernetes |
1.17.3 |
7 |
KubeEdge版本 |
1.7.2 |
2 云端環境部署
2.1 在master節點安裝Docker和k8S (ubuntu)
2.1.1 安裝前準備
1.安裝需要的包
sudo apt install apt-transport-https ca-certificates software-properties-common curl
2.添加 谷歌GPG 密鑰
本地使用安全PC的谷歌瀏覽器(proxyhk.huawei.com:8080 代理),直接訪問下面的網址,下載apt-key.gpg文件,https://packages.cloud.google.com/apt/doc/apt-key.gpg,并將apt-key.gpg文件上傳到master節點的任意文件夾,執行apt-key add apt-key.gpg
注:若無法下載,也可以從(https://github.com/liaohang122/test)獲取。
3.配置Source list,可以使用阿里的源
cat /etc/apt/sources.list deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
#deb http://repo.huaweicloud.com/ubuntu/ bionic main multiverse restricted universe #deb http://repo.huaweicloud.com/ubuntu/ bionic-backports main multiverse restricted universe #deb http://repo.huaweicloud.com/ubuntu/ bionic-proposed main multiverse restricted universe #deb http://repo.huaweicloud.com/ubuntu/ bionic-security main multiverse restricted universe #deb http://repo.huaweicloud.com/ubuntu/ bionic-updates main multiverse restricted universe #deb-src http://repo.huaweicloud.com/ubuntu/ bionic main multiverse restricted universe #deb-src http://repo.huaweicloud.com/ubuntu/ bionic-backports main multiverse restricted universe #deb-src http://repo.huaweicloud.com/ubuntu/ bionic-proposed main multiverse restricted universe #deb-src http://repo.huaweicloud.com/ubuntu/ bionic-security main multiverse restricted universe #deb-src http://repo.huaweicloud.com/ubuntu/ bionic-updates main multiverse restricted universe |
kubeEdge安裝使用中科大的鏡像源
echo "deb http://mirrors.ustc.edu.cn/kubernetes/apt kubernetes-xenial main" \
> /etc/apt/sources.list.d/kubernetes.list
4.配置外網代理
export http_proxy=http://username:passwd@proxyhk.huawei.com:8080
export https_proxy=http:// username:passwd @proxyhk.huawei.com:8080
export ftp_proxy=http:// username:passwd@proxyhk.huawei.com:8080
export no_proxy="10.71.xx.xx,127.0.0.1,.huawei.com,localhost,local,.local"
注意:本地節點的IP地址要配置到no_proxy中,否則后面kubeadm init的時候會出現錯誤。
2.1.2 安裝docker 和kubeadm
apt-get update
apt-get install -y docker.io
apt-get install -y kubelet=1.21.3-00 kubeadm=1.21.3-00 kubectl=1.21.3-00 --allow-downgrades
在上述安裝 kubeadm 的過程中,docker 和kubeadm、 kubelet、kubectl 這幾個二進制文件都會被自動安裝好,安裝kubeadm的時候,最好指定版本安裝,本次是以1.17.3為例。安裝前可以使用下面的命令查看可以安裝的版本好:
apt-cache madison kubectl| grep 1.17
安裝好之后,可以通過kubeadm version 查看版本號。
設置開機自啟動并啟動 Docker(安裝成功后默認已設置并啟動,可忽略)
systemctl enable docker
systemctl start docker
2.1.3 配置daemon.json
注意:要把紅色部分加入進去,否則下載鏡像的時候,證書校驗一般校驗都無法通過。
vim /etc/docker/daemon.json
{
"registry-mirrors": [
"https://dockerhub.azk8s.cn",
"https://docker.mirrors.ustc.edu.cn",
"http://hub-mirror.c.163.com" ,
"https://k8s.gcr.io",
"https://github-releases.githubusercontent.com"
],
"insecure-registries": [
"rnd-dockerhub.huawei.com",
"docker-hub.tools.huawei.com",
"registry.me:5000",
"http://docker.mirrors.ustc.edu.cn",
"https://k8s.gcr.io",
"https://github-releases.githubusercontent.com"
],
"exec-opts": [
"native.cgroupdriver=systemd"
]
}
2.1.4 給docker配置代理
mkdir -p /etc/systemd/system/docker.service.d
vim /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://username:passwd@proxyhk.huawei.com:8080"
Environment="HTTPS_PROXY=http:// username:passwd@proxyhk.huawei.com:8080"
systemctl daemon-reload
systemctl restart docker
查看docker代理
systemctl show --property=Environment docker
查看docker配置
docker info
2.1.5 其他配置
步驟1 關閉虛擬內存和防火墻。
l 關閉虛擬內存
內存關閉
swapoff -a
修改配置:
關閉fstab swap配置,修改/etc/fstab,注釋swap文件系統掛載配置。
swapoff -a
重啟操作系統使配置生效
l 關閉防火墻
編輯文件/etc/sysconfig/selinux和/etc/selinux/config
修改參數SELINUX的值為disabled(SELINUX=disabled)
systemctl stop firewalld.service
systemctl disable firewalld.service
firewall-cmd –state
Ubuntu關閉防火墻命令為:
ufw disable
允許包轉發
vi /etc/sysctl.d/k8s.conf 添加如下行
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
執行modprobe br_netfilter
步驟2修改主機名,防止與集群中其他機器同名。
hostnamectl set-hostname train0 train0為主機名
同時在/etc/hosts添加如下行
Source /etc/hosts
安裝過程中遇到的一些問題請參考5 FAQ
2.1 Master節點配置
2.1.1 初始化master節點
執行kubeadm init ,可以指定版本 kubeadm init
kubeadm init --kubernetes-version=v1.17.3 --pod-network-cidr=192.168.0.0/16 --apiserver-advertise-address=$masterIP
masterIP:用本機IP替換。
參數中192.168.0.0/16跟后續的Pod network add-on相關,這里我們選擇的是Calico,詳細信息可以參見官方文檔:https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/
關于kubeadm init時的參數說明同樣可參考上述鏈接。
----結束
2.1.2 配置k8s網絡
步驟 1 配置k8s apiserver訪問公鑰。
mkdir -p $HOME/.kube
cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
chown $(id -u):$(id -g) $HOME/.kube/config
步驟 2 安裝網絡插件,查看node信息。
kubectl get node
輸出STATUS為NotReady,原因是沒有安裝網絡插件。
步驟 3 部署calico插件。
l X86架構
docker load -i cni.tar.gz
docker load -i kube-controllers.tar.gz
docker load -i node.tar.gz
docker load -i pod2daemon-flexvol.tar.gz
kubectl apply -f https://docs.projectcalico.org/v3.20/manifests/(手動下好再裝) 此步必須
注意一下這里calico的版本號與k8s有關聯關系,K8S1.22.0的版本號要配套3.20的calico.yaml
l ARM架構
待補充
kubectl apply -f https://docs.projectcalico.org/v3.20/manifests/calico.yaml(手動下好再裝)
當發現所有Pod都docker已經變為Running狀態,表示master節點已經安裝成功。
kubectl get pods -n kube-system
這里calico.yaml需要從鏡像倉下載,可能由于下載速度慢,導致查看pod時遇到ImagePullBackOff的問題,可以嘗試手動拉取鏡像。
docker pull calico/cni:v3.20.0
docker pull calico/node:v3.20.0
docker pull calico/kube-controllers:v3.20.0
docker pull calico/pod2daemon-flexvol:v3.20.0
如果calico還是跑不起來,可以kubectl describe 查看一下狀態。
這里是因為使用kubeadm初始化的集群,出于安全考慮Pod不會被調度到Master Node上,也就是說Master Node不參與工作負載,需要解除master節點的隔離。
另外,需要檢查一下calico.yaml的版本是否正確,K8S 1.17.3版本,最好配套比較新的版本,可以從
----結束
2.1.3 解除master隔離
默認情況下,集群中創建的所有資源(如Pods)并不會被部署到master節點上,但是在我們的開發或者測試環境中,經常只有一個master節點或者并不想浪費master節點的可用空間,這時可以使用如下命令解除master隔離的限制。
kubectl taint nodes --all node-role.kubernetes.io/master-
驗證是否成功:
kubectl get pods -n kube-system
所有pod都應該能跑起來了,查看master節點
kubectl get node
2.2 KubeEdge安裝
Kubeedge安裝方法有兩種,一種是下載最新的代碼編譯出cloudcore和edgecore,另外一種是直接下載社區上的發布版本。
2.3 方法一:采用編譯方式
1)下載golang
[root@ke-cloud ~]# wget https://golang.google.cn/dl/go1.14.4.linux-arm64.tar.gz
[root@ke-cloud ~]# tar -zxvf go1.14.4.linux-arm64.tar.gz -C /usr/local
2)配置golang環境
vim /etc/profile
文件末尾添加:
# golang env
export GOROOT=/usr/local/go
export GOPATH=/data/gopath
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
source /etc/profile
mkdir -p /data/gopath && cd /data/gopath
mkdir -p src pkg bin
3)下載KubeEdge源碼,并編譯cloudcore、edgecore
git clone https://github.com/kubeedge/kubeedge $GOPATH/src/github.com/kubeedge/kubeedge
cd $GOPATH/src/github.com/kubeedge/kubeedge
make all WHAT=keadm
說明:編譯后的二進制文件在./_output/local/bin下,單獨編譯cloudcore與edgecore的方式:make all WHAT=cloudcore && make all WHAT=edgecore
注意:這里編譯出來的kubeadm和edgecore版本,都是x86版本,傳到A500上是不能使用的,因此可以考慮在arm服務器上編譯,或者直接到庫上獲取發布版本。
cp cloudcore /usr/local/bin
# 將edgecore拷貝至邊緣端
scp edgecore root@edgeip:/usr/local/bin/
4)添加設備
kubectl apply -f $GOPATH/src/github.com/kubeedge/kubeedge/build/crds/devices/devices_v1alpha2_device.yaml
kubectl apply -f $GOPATH/src/github.com/kubeedge/kubeedge/build/crds/devices/devices_v1alpha2_devicemodel.yaml
kubectl apply -f $GOPATH/src/github.com/kubeedge/kubeedge/build/crds/reliablesyncs/cluster_objectsync_v1alpha1.yaml
kubectl apply -f $GOPATH/src/github.com/kubeedge/kubeedge/build/crds/reliablesyncs/objectsync_v1alpha1.yaml
5)創建證書文件
# 清除已有的密鑰
kubectl delete secret casecret –nkubeedge
kubectl delete secret cloudcoresecret -nkubeedge [y1]
生成證書文,存放在/etc/kubeedge/目錄下ca、certs,將其傳到edge端相同目錄(提前創建好)
mkdir -p /etc/kubeedge/config
$GOPATH/src/github.com/kubeedge/kubeedge/build/tools/certgen.sh genCertAndKey server
6)部署cloudcore服務
cd /etc/kubeedge/config (yaml必須放在此目錄,否則服務起不來)
cloudcore --minconfig >cloudcore.yaml 創建配置文件
進入 cloudcore.service目錄
cd $GOPATH/src/github.com/kubeedge/kubeedge/build/tools
vim cloudcore.service
# 將cloudcore的路徑修改為真實路徑
cp cloudcore.service /lib/systemd/system/
systemctl enable cloudcore
systemctl start cloudcore
systemctl status cloudcore
如果服務啟動失敗,單獨執行cloudcore --config cloudcore.yaml查看具體日志
# 將edgecore.service傳至邊緣端
scp edgecore.service root@192.168.2.3:/lib/systemd/system/
2.4 方法二:從庫上下載的方式
可以直接到發布庫上獲取對應架構版本的keadm,cloudcore,edgecore版本,
https://github.com/kubeedge/kubeedge/releases/tag/v1.7.2
除了不用編譯,其他操作跟方法一是一致的。
3 邊緣端環境部署
3.1 安裝yum
參考如下鏈接操作即可:
Atlas500 的EulerOS安裝yum (http://xxx.com/km/blogs/details/11490285)
安裝完成后,需要部署epel的鏡像倉位置,用你我司的鏡像倉就可以了。參見附件:
修改如下兩個文件,如果沒有就新建文件
/etc/yum.repos.d/EulerOS.repo
cat EulerOS.repo [base] name=EulerOS-2.0SP8 base baseurl=http://repo.huaweicloud.com/euler/2.8/os/aarch64/ enabled=1 gpgcheck=1 gpgkey=http://repo.huaweicloud.com/euler/2.8/os/RPM-GPG-KEY-EulerOS |
epel.repo
[epel] name=Extra Packages for Enterprise Linux 7 - $basearch baseurl=http://mirrors.tools.huawei.com/epel/7/$basearch #metalink=https://mirrors.fedoraproject.org/#metalink?repo=epel-7&arch=$basearch&infra=$infra&content=$contentdir failovermethod=priority enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
[epel-debuginfo] name=Extra Packages for Enterprise Linux 7 - $basearch - Debug baseurl=https://mirrors.tools.huawei.com/epel/7/$basearch/debug #metalink=https://mirrors.fedoraproject.org/#metalink?repo=epel-debug-7&arch=$basearch&infra=$infra&content=$contentdir failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=1
[epel-source] name=Extra Packages for Enterprise Linux 7 - $basearch - Source baseurl=https://mirrors.tools.huawei.com/epel/7/SRPMS #metalink=https://mirrors.fedoraproject.org/#metalink?repo=epel-source-7&arch=$basearch&infra=$infra&content=$contentdir failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=1 |
3.2 安裝Docker
Atlas500自帶docker安裝,無需安裝
3.3 部署edgecore
1)修改主機名
主機名必須為小寫字母,從arm環境獲取hostnamectl工具(which hostnamectl)
hostnamectl set-hostname euler27
如果沒有這個工具也可以直接修改,網上有很多介紹
1、 修改/etc/sysconfig/network中的hostname 2、 修改/etc/hosts文件(IP與主機名對應,DNS解析的時候有用) 3、 修改/etc/hostname |
2)部署kubeEdge鏡像
把前面下載的keadm和edgecore分別解壓,并把對應的執行文件放到如下目錄
cp keadm /usr/bin
cp keadm /usr/local/bin
3)部署edgecore服務
mkdir -p /etc/kubeedge/config && cd /etc/kubeedge/config
edgecore --minconfig > edgecore.yaml
在cloud端執行keadm gettoken獲取token
然后在邊緣端使用keadm來初始,命令如下:
keadm join --cloudcore-ipport= EDGE_IP:10000 --kubeedge-version=1.7.2 --token=480cba67b95454aacface05d4f612d2c5a9748d2772356f170fcc906e7948ff0.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzEzMjEwMzh9.ff5uFhhG6stg-2hqlbzW1SyCaFRJLD5xguAHKGrG-6Y
EDGE_IP就是cloud端的IP地址。
邊緣節點加入后,能夠在master上看到節點情況,如果狀態為ready,說明加入正常
一般來說,在過程中都會出現一些問題,需要注意以下問題:
1、 需要配置proxy,proxy配置方法參考2.1.1,這樣可以直接拉取鏡像。
2、 缺少一些基礎庫,這種情況可以直接通過yum來安裝,比如epel
3、 經常出現的一些問題如FAQ 5.6~8,主要還是代理和證書校驗的問題,這些問題解決后,一般可以拉取成功。
3.4 安裝和部署deviceplugin
Deviceplugin是昇騰提供的插件,主要用于向K8S master上報NPU相關的信息,如果沒有這插件,邊緣設備的NPU就無法被調度到。
3.4.1 安裝deviceplugin
1、下載相關應用并制作容器鏡像
邊緣部署的時候需要安裝plugin,步驟是先下載plugin的應用程序,制作成容器鏡像,并使用K8S進行部署。由于A500是arm架構,因此要下載arm版本的程序,并在a500上制作鏡像。然后通過master節點部署。
外部用戶參考這個地方進行下載,需要進行權限申請,相對比較麻煩。https://www.hiascend.com/software/mindx-dl/download
將Ascend-mindxdl-device-plugin_2.0.2_linux-aarch64.zip解壓A500的目錄中,使用下面的命令制作容器
docker build -t ascend-k8sdeviceplugin:v2.0.2 .[y2]
制作容器的時候,容器鏡像的名稱,需要跟device-plugin-310-v2.0.2.yaml中保持一致,否則部署的時候會出問題
制作鏡像過程如下:
docker build -t ascend-k8sdeviceplugin:v2.0.2 . (注意后面有個點點)
注意這個build操作,要在A500或者ARM環境上操作,X86的服務器上build出來,架構不一致無法使用。
>/etc/profile"echo'source/etc/profile'>>一/.bashr. 一>Runninginias4b737edlb Removingintermediatecontainerla84b737edlb -一》93ce78c43b07 Successfullybuilt93ce78c43b07 Successfullytaggedascend一kssdeviceplugin:vZ.0.2" style="width:432.75pt;height:189pt;visibility:visible;mso-wrap-style:square">
docker images
如果是本節點使用,這個鏡像就可以使用了,如果是還有其他節點需要使用,可以使用dokcer save命令,將鏡像保存出來,可以在其他環境使用
docker save -o Ascend-device-plugin_2.0.2_linux-aarch64.tar.gz ascend-k8sdeviceplugin:v2.0.2
3.4.2 部署deviceplugin
部署推理任務參考
https://support.huawei.com/enterprise/zh/doc/EDOC1100207064/3a1c6839
推理任務部署的yaml定義
由于A500的edgecore中有關于npu的上報開關,因此需要打開一下。
vi /etc/kubeedge/config/edgecore.yaml,把devicePluginEnabled這個地方改成true
systemctl restart edgecore
systemctl status edgecore
如果edgecore服務啟動失敗,可以執行edgecore --config edgecore.yaml查看啟動日志
在cloud側,對邊緣節點打標簽
參考鏈接中的方法,對master和edge節點打標簽,https://support.huawei.com/enterprise/zh/doc/EDOC1100207064/ccf79def
標簽序號 |
命令 |
說明 |
1 |
kubectl label nodes主機名稱 node-role.kubernetes.io/worker=worker |
該命令為識別K8s的計算節點,其中“主機名稱”為所有計算節點名。 |
3 |
kubectl label nodes 主機名稱 accelerator=huawei-Ascend310 |
該命令為識別昇騰310 AI處理器節點,其中“主機名稱”為所有推理節點名。 |
5 |
kubectl label nodes 主機名稱 masterselector=dls-master-node |
該命令為識別MindX DL的管理節點,其中“主機名稱”為管理節點名。 |
6 |
kubectl label nodes主機名稱 workerselector=dls-worker-node |
該命令為識別MindX DL的計算節點,其中“主機名稱”為所有計算節點名。 |
7 |
kubectl label nodes 主機名稱 host-arch=huawei-x86 |
該命令為識別x86架構的節點,其中“主機名稱”為所有x86架構的計算節點名。 |
8 |
kubectl label nodes 主機名稱 host-arch=huawei-arm |
該命令為識別ARM架構的節點,其中“主機名稱”為所有ARM架構的計算節點名。 |
對于A500,需要修改device-plugin-310-v2.0.2.yaml中如下紅色的部分,把hiai-driver的路徑修改正確,并上傳到cloud側的任何目錄
volumes: - name: device-plugin hostPath: path: /var/lib/kubelet/device-plugins - name: hiai-driver hostPath: path: /home/data/miniD/driver - name: log-path hostPath: path: /var/log/mindx-dl/devicePlugin type: Directory - name: localtime |
在cloud側執行命令,部署deviceplugin
kubectl apply -f device-plugin-310-v2.0.2.yaml
然后再檢查邊緣側npu資源能否獲取到,在Cloud端執行
kubectl get node
kubectl describe node euler27
4 推理任務下發
4.1 環境準備
安裝驅動、固件
按照CANN用戶指南手動制作docker鏡像,如果有現成的,可以直接導入鏡像。
完成后使用docker images查看是否存在
4.2 使用yaml跑通推理任務
編寫yaml
apiVersion: batch/v1
kind: Job
metadata:
name: ke-infer
#namespace: kube-system
spec:
template:
spec:
nodeSelector:
accelerator: huawei-Ascend310
containers:
- image: ubuntu-a500:v1
imagePullPolicy: IfNotPresent
name: ubuntu-a500
command:
- "/bin/bash"
- "-c"
- "cd /home/test; cd out; ./main"
#args: [ "while true; do sleep 30000; done;" ]
resources:
resources:
requests:
huawei.com/Ascend310: 1
limits:
huawei.com/Ascend310: 1
volumeMounts:
- name: ascend-dirver
mountPath: /home/data/miniD/driver
- name: slog
mountPath: /var/log/npu/conf/slog/
- name: test
mountPath: /home/test
- name: npu-smi
mountPath: /usr/local/bin/npu-smi
- name: timezone
mountPath: /etc/timezone
- name: localtime
mountPath: /etc/localtime
volumes:
- name: ascend-dirver
hostPath:
path: /home/data/miniD/driver
- name: slog
hostPath:
path: /var/log/npu/conf/slog/
- name: test
hostPath:
path: /etc/kubeedge/acl_resnet50_sample/
- name: npu-smi
hostPath:
path: /usr/local/bin/npu-smi
- name: timezone
hostPath:
path: /etc/timezone
- name: localtime
hostPath:
path: /etc/localtime
restartPolicy: OnFailure
啟動任務,cloud端執行
kubectl apply -f infer.yaml
查看pod
4.3 結果觀察
邊緣端查看container id,使用docker ps -a
觀察推理輸出:docker logs -f d44c4be8a32d
4.4 刪除推理任務
kubectl delete -f infer.yaml
5 FAQ
5.1 kubeadm init拉取鏡像失敗,提示證書校驗失敗
現象:
解決辦法:
在配置的時候要把https://k8s.gcr.io加入到免認證的網站列表,否則就需要去配置證書,我們下載的時候可以配置誠免校驗。參考: http://xxx.com/km/blogs/details/6314139
cat daemon.json
{
"registry-mirrors": [
"
"
"
"
"
], "insecure-registries": [ "rnd-dockerhub.huawei.com", "docker-hub.tools.huawei.com", "registry.me:5000", "
"
"
5.2 kubeadm init拉取鏡像失敗,提示超時 kubeadm init --kubernetes-version=1.17.3 --apiserver-advertise-address=10.71.233.24 --pod-network-cidr=192.168.0.0/16 的時候提示超時 解決辦法: export no_proxy="10.71.xx.xx,127.0.0.1,.huawei.com,localhost,local,.local" 注意:本地節點的IP地址要配置到no_proxy中,否則后面kubeadm init的時候會出現錯誤。 5.3 calico一直有兩個是pending狀態 解決辦法: calico.yaml的版本不對,要更新到320版本以上 5.4 編譯keadm的時候,提示go語言版本不對,但是實際已經安裝了最新版本的go 解決辦法:主要原因是usr/bin目錄下的文件鏈接沒修改過來,還一直鏈接到舊版本。 root@ubuntu:/usr/bin# ls -ll |grep go -rwxr-xr-x 1 root root 5730672 Feb 12 2021 aarch64-linux-gnu-ld.gold lrwxrwxrwx 1 root root 21 Feb 28 2018 go -> ../lib/go-1.10/bin/go -rwxr-xr-x 2 root root 3454104 Aug 5 05:18 gofmt lrwxrwxrwx 1 root root 24 Feb 28 2018 gofmt~ -> ../lib/go-1.10/bin/gofmt lrwxrwxrwx 1 root root 21 Feb 12 2021 gold -> x86_64-linux-gnu-gold lrwxrwxrwx 1 root root 24 Feb 12 2021 ld.gold -> x86_64-linux-gnu-ld.gold lrwxrwxrwx 1 root root 24 Feb 12 2021 x86_64-linux-gnu-gold -> x86_64-linux-gnu-ld.gold -rwxr-xr-x 1 root root 3111952 Feb 12 2021 x86_64-linux-gnu-ld.gold 把之前的鏈接刪掉,然后重新用下面的命令就好了。 ln -s /usr/local/go/bin/* /usr/bin/ 5.5 keadm join的時候提示Failed to synchronize cache for repo 'base' keadm join --cloudcore-ipport=<ip:port address> --edgenode-name=<unique string as edge identifier> - For this command --cloudcore-ipport flag is a required option - This command will download and install the default version of pre-requisites and KubeEdge keadm join --cloudcore-ipport=10.20.30.40:10000 --edgenode-name=testing123 --kubeedge-version=1.5.0 Flags: --certPath string The certPath used by edgecore, the default value is /etc/kubeedge/certs (default "/etc/kubeedge/certs") -s, --certport string The port where to apply for the edge certificate --cgroupdriver string CGroupDriver that uses to manipulate cgroups on the host (cgroupfs or systemd), the default value is cgroupfs -e, --cloudcore-ipport string IP:Port address of KubeEdge CloudCore -i, --edgenode-name string KubeEdge Node unique identification string, If flag not used then the command will generate a unique id on its own -h, --help help for join --kubeedge-version string Use this key to download and use the required KubeEdge version -p, --remote-runtime-endpoint string KubeEdge Edge Node RemoteRuntimeEndpoint string, If flag not set, it will use unix:///var/run/dockershim.sock -r, --runtimetype string Container runtime type --tarballpath string Use this key to set the temp directory path for KubeEdge tarball, if not exist, download it -t, --token string Used for edge to apply for the certificate F0910 11:57:18.129816 31335 keadm.go:27] failed to exec 'bash -c yum -y install mosquitto', err: Failed to synchronize cache for repo 'base', ignoring this repo. Failed to synchronize cache for repo 'epel', ignoring this repo. Error: Unable to find a match DNS 配置一下下面兩個路由: cat /etc/hosts 127.0.0.1 euler27 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 euler27 localhost localhost.localdomain localhost6 localhost6.localdomain6 172.18.100.92 proxyhk.huawei.com 7.223.219.40 mirrors.tools.huawei.com 5.6 安裝mosquitto提示校驗失敗 yum -y install mosquitto Extra Packages for Enterprise Linux 7 - aarch64 … EulerOS-2.0SP8 base 7.8 kB/s | 1.7 kB 00:00 The downloaded packages were saved in cache until the next successful transaction. You can remove cached packages by executing 'dnf clean packages'. Traceback (most recent call last): File "/usr/bin/yum", line 58, in <module> main.user_main(sys.argv[1:], exit_code=True) File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 179, in user_main errcode = main(args) File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 64, in main return _main(base, args, cli_class, option_parser_class) File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 99, in _main return cli_run(cli, base) File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 123, in cli_run ret = resolving(cli, base) File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 154, in resolving base.do_transaction(display=displays) File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 227, in do_transaction self.gpgsigcheck(install_pkgs) File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 279, in gpgsigcheck self._get_key_for_package(po, fn) File "/usr/lib/python3.7/site-packages/dnf/base.py", line 2265, in _get_key_for_package keys = dnf.crypto.retrieve(keyurl, repo) File "/usr/lib/python3.7/site-packages/dnf/crypto.py", line 177, in retrieve keyinfos = rawkey2infos(handle) File "/usr/lib/python3.7/site-packages/dnf/crypto.py", line 158, in rawkey2infos with pubring_dir(pb_dir), Context() as ctx: File "/usr/lib64/python3.7/site-packages/gpg/core.py", line 206, in __init__ self.protocol = protocol File "/usr/lib64/python3.7/site-packages/gpg/core.py", line 161, in __setattr__ super(GpgmeWrapper, self).__setattr__(key, value) File "/usr/lib64/python3.7/site-packages/gpg/core.py", line 885, in protocol errorcheck(gpgme.gpgme_engine_check_version(value)) File "/usr/lib64/python3.7/site-packages/gpg/errors.py", line 120, in errorcheck raise GPGMEError(retval, extradata) gpg.errors.GPGMEError: GPGME: Invalid crypto engine File "/usr/lib64/python3.7/site-packages/gpg/errors.py", line 120, in errorcheck raise GPGMEError(retval, extradata) gpg.errors.GPGMEError: GPGME: Invalid crypto engine 解決辦法: 在安裝的時候加上--nogpgcheck euler27:/var/lib/docker/zyh/rpm2 # yum -y install mosquitto --nogpgcheck 5.7 獲取kubeedge的時候,提示網址不可信 --2021-09-10 12:50:23-- https://github.com/kubeedge/kubeedge/releases/download/v1.7.2/checksum_kubeedge-v1.7.2-linux-arm64.tar.gz.txt Resolving proxyhk.huawei.com (proxyhk.huawei.com)... 172.18.100.92 Connecting to proxyhk.huawei.com (proxyhk.huawei.com)|172.18.100.92|:8080... connected. ERROR: The certificate of ‘github.com’ is not trusted. ERROR: The certificate of ‘github.com’ hasn't got a known issuer. 解決辦法:加上--no-check-certificate選項 wget https://github.com/kubeedge/kubeedge/releases/download/v1.7.2/checksum_kubeedge-v1.7.2-linux-arm64.tar.gz.txt --no-check-certificate 6 附錄 6.1 參考鏈接 https://docs.kubeedge.io/en/v1.5.0/setup/local.html https://github.com/kubeedge/kubeedge/tree/master https://blog.csdn.net/qq_24489251/article/details/108775479 http://xxx.com/km/blogs/details/8578357