rancher安装kubernetes的过程中报错[etcd] Failed to bring up Etcd Plane: [etcd] Etcd Cluster is not healthy,
根据网上搜到的结论,很大可能是由于服务器之间的时间没有同步,于是需要安装时间同步程序,并进行配置。在集群上的所有服务器执行如下命令:
yum install ntp ntpdate -y
之后,选择一台服务作为 ntp 时间服务器,修改/etc/ntp.conf文件,删除:
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
改为
server ntp3.aliyun.com iburst
另外,原始文件中有一行为如下内容:
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
去掉#打开注释,并将其ip修改服务器所在网段,比如服务器的ip地址为192.168.210.101,则该项改为:
restrict 192.168.210.0 mask 255.255.255.0 nomodify notrap
在集群中的其他服务器上,也要修改此文件,删除掉:
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
加入:
server 192.168.210.101 prefer
保存后退出,在集群中的所有服务器上执行如下命令:
service ntpd restart
systemctl disable chronyd.service
chkconfig --level 345 ntpd on
之后,在集群中192.168.210.101以外的服务器上执行:
ntpq -p
出现以下结果:
remote refid st t when poll reach delay offset jitter
==============================================================================
192.168.210.101 .INIT. 16 u 59 64 0 0.000 0.000 0.000
说明时间已经同步
之后,重新安装k8s集群成功。
————————————————
版权声明:本文为CSDN博主「vah101」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/vah101/article/details/91868147