Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tiup cluster check also support Chrony as NTP implementation #1696

Closed
yahonda opened this issue Dec 24, 2021 · 7 comments · Fixed by #1714
Closed

tiup cluster check also support Chrony as NTP implementation #1696

yahonda opened this issue Dec 24, 2021 · 7 comments · Fixed by #1714
Assignees
Labels
type/feature-request Categorizes issue as related to a new feature.
Milestone

Comments

@yahonda
Copy link
Member

yahonda commented Dec 24, 2021

Feature Request

"tiup cluster check" command to support Chrony as NTP implementation in addition to ntpd

Why the featue is needed:
Starting from Red Hat Enterprise 7 and Ubuntu 18.04, both Linux distributions added support Chrony as NTP as well as ntpd.

In some cases Chronyd is better than ntpd as described in these documentations.

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-configuring_ntp_using_the_chrony_suite

chronyd can usually synchronize the clock faster and with better accuracy.

https://ubuntu.com/blog/ubuntu-bionic-using-chrony-to-configure-ntp

Starting with Ubuntu Bionic, the choice for fast and accurate time synchronization is chrony.

Describe alternatives you've considered:
Use current ntpd.

Teachability, Documentation, Adoption, Migration Strategy:
It looks like checkNTP depends on ntpd implementation, does not look like supporting chrony.

func checkNTP(ntpInfo *insight.TimeStat) *CheckResult {
result := &CheckResult{
Name: CheckNameNTP,
}
if ntpInfo.Status == "none" {
zap.L().Info("The NTPd daemon may be not installed, skip.")
return result
}
// check if time offset greater than +- 500ms
if math.Abs(ntpInfo.Offset) >= 500 {
result.Err = fmt.Errorf("time offet %fms too high", ntpInfo.Offset)
}
return result
}

@yahonda yahonda added the type/feature-request Categorizes issue as related to a new feature. label Dec 24, 2021
@yahonda
Copy link
Member Author

yahonda commented Dec 24, 2021

cc @makocchi-git

@qqqdan qqqdan added this to the v1.9.0 milestone Dec 29, 2021
@dveeden
Copy link
Contributor

dveeden commented Jan 4, 2022

Some history on this: pingcap/docs#5283

Isn't RHEL using Chrony starting with RHEL8 and not RHEL7?

@yahonda
Copy link
Member Author

yahonda commented Jan 5, 2022

I have created a new EC2 instance using "Red Hat Enterprise Linux 7 with High Availability" at AWS Marketplace AMI. It installs and starts up chrony by default.

[ec2-user@ip-172-31-43-69 ~]$ more /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
[ec2-user@ip-172-31-43-69 ~]$ rpm -qa |grep ntp
fontpackages-filesystem-1.44-8.el7.noarch
[ec2-user@ip-172-31-43-69 ~]$ rpm -qa |grep chro
chrony-3.4-1.el7.x86_64
[ec2-user@ip-172-31-43-69 ~]$ sudo systemctl status chrony
Unit chrony.service could not be found.
[ec2-user@ip-172-31-43-69 ~]$ sudo systemctl status chronyd
● chronyd.service - NTP client/server
   Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2022-01-05 01:21:38 UTC; 2min 19s ago
     Docs: man:chronyd(8)
           man:chrony.conf(5)
 Main PID: 624 (chronyd)
   CGroup: /system.slice/chronyd.service
           └─624 /usr/sbin/chronyd

Jan 05 01:21:37 localhost.localdomain systemd[1]: Starting NTP client/server...
Jan 05 01:21:38 localhost.localdomain chronyd[624]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVD...EBUG)
Jan 05 01:21:38 localhost.localdomain systemd[1]: Started NTP client/server.
Jan 05 01:21:45 ip-172-31-43-69.us-east-2.compute.internal chronyd[624]: Selected source 169.254.169.123
Hint: Some lines were ellipsized, use -l to show in full.
[ec2-user@ip-172-31-43-69 ~]$

@makocchi-git
Copy link
Contributor

tiup uses tidb-insight inside. So we need to implement tidb-insight for checking chrony just like ntp.
Fortunately, it's already done by the latest commit 👍

@dveeden
Copy link
Contributor

dveeden commented Jan 5, 2022

@yahonda from https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-configuring_ntp_using_the_chrony_suite :

"The chrony suite is installed by default on some versions of Red Hat Enterprise Linux 7"

This means our tools and documentation should include details about and support for Chrony. https://docs.pingcap.com/tidb/stable/check-before-deployment#check-and-install-the-ntp-service already included details about Chrony, no follow up needed for the docs.

@AstroProfundis
Copy link
Contributor

Indeed, we have added support for tidb-insight recently, and we'll do some tests and adjust how tiup-cluster handles the output of tidb-insight collector in the check subcommand before we can make that a new release.

@yahonda
Copy link
Member Author

yahonda commented Jan 5, 2022

Thanks for the update. I'm looking for the future version of tiup supporting Chrony implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature-request Categorizes issue as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants