cancel
Showing results for 
Search instead for 
Did you mean: 
huyvl3-fptcloud
Flight Engineer
Flight Engineer
  • 324 Views

Chrony not working when specificing server

Jump to solution

Hi, I added public NTP server to chrony but it didn't sync because my timezon GMT+7 (Vietnam). I checked firewall even stopped it with selinux but chrony still not work.

[root@huyvl-linux-training etc]# grep ^[^#] /etc/chrony.conf 
server 0.asia.pool.ntp.org iburst
sourcedir /run/chrony-dhcp
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
keyfile /etc/chrony.keys
ntsdumpdir /var/lib/chrony
leapsectz right/UTC
logdir /var/log/chrony
[root@huyvl-linux-training etc]# firewall-cmd --add-service ntp --permanen
Warning: ALREADY_ENABLED: ntp
success
[root@huyvl-linux-training etc]# cat /etc/firewalld/zones/public.xml
<?xml version="1.0" encoding="utf-8"?>
<zone>
  <short>Public</short>
  <description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
  <service name="ssh"/>
  <service name="dhcpv6-client"/>
  <service name="cockpit"/>
  <service name="http"/>
  <service name="ntp"/>
  <port port="82" protocol="tcp"/>
  <forward/>
</zone>
[root@huyvl-linux-training etc]# firewall-cmd --reload
success
[root@huyvl-linux-training etc]# systemctl restart chronyd
[root@huyvl-linux-training etc]# date
Sat Feb 10 15:31:38 EST 2024
[root@huyvl-linux-training etc]# timedatectl 
               Local time: Sat 2024-02-10 15:31:43 EST
           Universal time: Sat 2024-02-10 20:31:43 UTC
                 RTC time: Sat 2024-02-10 20:31:43
                Time zone: America/New_York (EST, -0500)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
[root@huyvl-linux-training etc]# chronyc sources
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* 061239100017.ctinets.com      1   6    17     2  +2820us[+3390us] +/-   29ms
[root@huyvl-linux-training etc]# chronyc tracking
Reference ID    : 3DEF6411 (061239100017.ctinets.com)
Stratum         : 2
Ref time (UTC)  : Sat Feb 10 20:36:37 2024
System time     : 0.000000438 seconds slow of NTP time
Last offset     : +0.000570057 seconds
RMS offset      : 0.000570057 seconds
Frequency       : 17.584 ppm slow
Residual freq   : -19.146 ppm
Skew            : 0.031 ppm
Root delay      : 0.058728918 seconds
Root dispersion : 0.001657983 seconds
Update interval : 2.1 seconds
Leap status     : Normal
[root@huyvl-linux-training etc]# 

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
shura
Flight Engineer
Flight Engineer
  • 271 Views

Hello, @huyvl3-fptcloud 

I do not see any problem in chrony config and in time syncronization. To set timezone to "Vietnam", please, use:

timedatectl set-timezone "Asia/Bangkok"

Good luck

View solution in original post

0 Kudos
5 Replies
shura
Flight Engineer
Flight Engineer
  • 272 Views

Hello, @huyvl3-fptcloud 

I do not see any problem in chrony config and in time syncronization. To set timezone to "Vietnam", please, use:

timedatectl set-timezone "Asia/Bangkok"

Good luck

0 Kudos
huyvl3-fptcloud
Flight Engineer
Flight Engineer
  • 269 Views

Hi @shura ,what do you mean by chrony that helps reinforce accuracy based on the regional time zone the system is setting in?

0 Kudos
shura
Flight Engineer
Flight Engineer
  • 261 Views

Hi @huyvl3-fptcloud 

I do not see any problem in time accuracy, it is good enough according your chronyc tracking report. I does not see only your regional time zone setting.

0 Kudos
huyvl3-fptcloud
Flight Engineer
Flight Engineer
  • 259 Views

@shura , What I mean is that I don't know if my understanding of chrony is correct or not. Chrony simply increases and maintains accuracy BASED on the current time zone being set, chrony does not participate in time zone adjustment at all. Is it right?

0 Kudos
shura
Flight Engineer
Flight Engineer
  • 253 Views

Yes, you correct.

Join the discussion
You must log in to join this conversation.