kubekey icon indicating copy to clipboard operation
kubekey copied to clipboard

Ubuntu2004和2204版本配置 chrony 时间同步错误

Open shuqingzai opened this issue 2 years ago • 5 comments

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

shuqingzai avatar Jul 30 '22 15:07 shuqingzai

手动移动配置文件后,还有错误

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

shuqingzai avatar Jul 30 '22 15:07 shuqingzai

Thanks for this feedback, In the next release we will fix this issue.

24sama avatar Aug 02 '22 02:08 24sama

+1 ,ubuntu 1804

pennpeng avatar Aug 09 '22 08:08 pennpeng

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 avatar Aug 11 '22 06:08 24sama

@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.

ks-ci-bot avatar Aug 11 '22 06:08 ks-ci-bot

这个bug已经修复,可以关闭此issue

xiaods avatar Nov 06 '22 23:11 xiaods