一、Rancher 安裝 Longhorn
至於 Longhorn 的概念這里就不贅述了,主要記錄安裝 Longhorn 的時候longhorn-driver-deployer
和longhorn-manager
無法成功啟動問題。
在應用商店搜索Longhorn
其他的保持默認,點擊啟動
即可
二、報錯解決方法
查看longhorn-manager
其中一個 Pod 日志如下:
2022/02/22 02:45:53 proto: duplicate proto type registered: VersionResponse
time="2022-02-22T02:45:53Z" level=error msg="Failed environment check, please make sure you have iscsiadm/open-iscsi installed on the host"
time="2022-02-22T02:45:53Z" level=fatal msg="Error starting manager: Environment check failed: Failed to execute: nsenter [--mount=/host/proc/1/ns/mnt --net=/host/proc/1/ns/net iscsiadm --version], output , stderr, nsenter: failed to execute iscsiadm: No such file or directory\n, error exit status 127"
通過日志報錯得知缺少iscsiadm
命令,根據你的系統安裝該命令即可,查詢到的相關資料如下:
https://github.com/longhorn/longhorn/issues/1493
https://longhorn.io/docs/0.8.0/install/requirements/
我的系統是 CentOS,每個節點都需要安裝:
[root@k8s-master01 ~]# yum install iscsi-initiator-utils
安裝好之后,選擇不能成功啟動的 Pod 重新部署一下即可。