kubekey
kubekey copied to clipboard
Ubuntu2004和2204版本配置 chrony 时间同步错误
What is version of KubeKey has the issue?
v.2.2.2
What is your os environment?
ubuntu20.04 与 Ubuntu22.04
KubeKey config file
No response
A clear and concise description of what happend.
配置时间同步报错,配置文件路径错误
使用 sudo apt install chrony
安装完成后,配置文件应该在 /etc/chrony/chrony.conf
但是 kubekey
修改时间同步的命令是 sudo -E /bin/bash -c "grep -q '^server ntp.aliyun.com iburst' /etc/chrony.conf||sed '1a server ntp.aliyun.com iburst' -i /etc/chrony.conf"
导致文件路径不对,无法完成安装
ll /etc |grep chrony
drwxr-xr-x 2 root root 4096 Jul 30 23:14 chrony/
ll /etc/chrony/
total 16
drwxr-xr-x 2 root root 4096 Jul 30 23:14 ./
drwxr-xr-x 102 root root 4096 Jul 30 23:28 ../
-rw-r--r-- 1 root root 1768 May 20 2020 chrony.conf
-rw-r----- 1 root root 481 Aug 25 2020 chrony.keys
Relevant log output
安装错误日志:
23:28:31 CST failed: [kubesphere01]
error: Pipeline[CreateClusterPipeline] execute failed: Module[ConfigureOSModule] exec failed:
failed: [kubesphere03] [ConfigureNtpServer] exec failed after 3 retires: set ntpserver: ntp.aliyun.com failed, please check file /etc/chrony.conf: Failed to exec command: sudo -E /bin/bash -c "grep -q '^server ntp.aliyun.com iburst' /etc/chrony.conf||sed '1a server ntp.aliyun.com iburst' -i /etc/chrony.conf"
grep: /etc/chrony.conf: No such file or directory
sed: can't read /etc/chrony.conf: No such file or directory: Process exited with status 2
failed: [kubesphere02] [ConfigureNtpServer] exec failed after 3 retires: set ntpserver: ntp.aliyun.com failed, please check file /etc/chrony.conf: Failed to exec command: sudo -E /bin/bash -c "grep -q '^server ntp.aliyun.com iburst' /etc/chrony.conf||sed '1a server ntp.aliyun.com iburst' -i /etc/chrony.conf"
grep: /etc/chrony.conf: No such file or directory
sed: can't read /etc/chrony.conf: No such file or directory: Process exited with status 2
failed: [kubesphere01] [ConfigureNtpServer] exec failed after 3 retires: set ntpserver: ntp.aliyun.com failed, please check file /etc/chrony.conf: Failed to exec command: sudo -E /bin/bash -c "grep -q '^server ntp.aliyun.com iburst' /etc/chrony.conf||sed '1a server ntp.aliyun.com iburst' -i /etc/chrony.conf"
grep: /etc/chrony.conf: No such file or directory
sed: can't read /etc/chrony.conf: No such file or directory: Process exited with status 2
Additional information
No response
手动移动配置文件后,还有错误
23:44:27 CST message: [kubesphere01]
restart chronyd failed: Failed to exec command: sudo -E /bin/bash -c "systemctl enable chronyd.service && systemctl restart chronyd.service"
Failed to enable unit: Refusing to operate on alias name or linked unit file: chronyd.service: Process exited with status 1
在 ubuntu
上 不能使用 systemctl enable chronyd.service
Thanks for this feedback, In the next release we will fix this issue.
+1 ,ubuntu 1804
I think this can be a good-first-issue for new contributors. If anyone is interested in this, please leave some comments. /good-first-issue
@24sama: This request has been marked as suitable for new contributors.
Please ensure the request meets the requirements listed here.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue
command.
In response to this:
I think this can be a good-first-issue for new contributors. If anyone is interested in this, please leave some comments. /good-first-issue
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
这个bug已经修复,可以关闭此issue