最近因为需要,所以需要重新安装Gluster。我按照之前写的博客,居然出错了,报错如下:
大概的意思就是该脚本无法识别节点上的 glusterd服务运行,所以无法继续安装。查了相关资料,得出地结论就是Ubuntu上本来就没有glusterd服务,只有glusterfs-server服务。按照网上的一些方法,更改了服务的名称glusterfs-server=>glusterd,然而并没有卵用。因此考虑采用CentOS系统,安装完成之后自带glusterd服务,无需自行安装。
在安装过程中还需要一些问题,在此介绍一下:
1. 部署K8S是,DNS pod为CrashLoopBackOff 。 参考文章1,文章2
解决方法就是:
sudo rm -f /etc/resolv.conf # Delete the symbolic link
sudo nano /etc/resolv.conf # Create static file
# Content of static resolv.conf
nameserver 8.8.4.4
nameserver 8.8.8.8
之后再重新安装。
2. 由于多次安装K8S,我一直以为只需要 kubeadm reset一下就行,可是在部署服务时提示:
"Failed to setup network for pod \ using network plugins \"cni\": no IP addresses available in network: podnet; Skipping pod"
解决方法:文章1
kubeadm reset
systemctl stop kubelet
systemctl stop docker
rm -rf /var/lib/cni/
rm -rf /var/lib/kubelet/*
rm -rf /etc/cni/
ifconfig cni0 down
ifconfig flannel.1 down
ifconfig docker0 down
3. 执行 ./gk-deploy -g my-topology.json 到最后报错:
unknown flag: --show-all
Failed to communicate with heketi service.
解决方法:文献2
diff --git a/deploy/gk-deploy b/deploy/gk-deploy
index 8cf5b40..29f84e7 100755
--- a/deploy/gk-deploy
+++ b/deploy/gk-deploy
@@ -916,7 +916,7 @@ while [[ "x${heketi_service}" == "x" ]] || [[ "${heketi_service}" == "<none>" ]]
heketi_service=$(${CLI} describe svc/heketi | grep "Endpoints:" | awk '{print $2}')
done
-heketi_pod=$(${CLI} get pod --no-headers --show-all --selector="heketi" | awk '{print $1}')
+heketi_pod=$(${CLI} get pod --no-headers --selector="heketi" | awk '{print $1}')
if [[ "${CLI}" == *oc\ * ]]; then
heketi_service=$(${CLI} describe routes/heketi | grep "Requested Host:" | awk '{print $3}')
#去除 --show-all 即可
4. 每次执行/gk-deploy -g my-topology.json失败,都需要清除一下环境
#清除所有pod
kubectl delete -f kubectl delete -f kube-templates/
#清除一下svc,endpoints,secrets
kubectl delete svc/*** ep/*** secret/**
#到每个gluster节点执行
dmsetup ls
#然后删除相关的vg
dmsetup remove vg*****
#最后清除一下
wipefs -af /dev/sda