ntp가 설치되어 있다면 이를 먼저 제거한다.
[root@oracle ~]# systemctl status ntpd [root@oracle ~]# systemctl stop ntpd [root@oracle ~]# systemctl disable ntpd [root@oracle ~]# yum remove ntp
[root@oracle ~]# yum install chrony
그냥 기본 설정 서버 사용해도 상관 없다.
또는 인트라넷 내부의 NTP서버를 설정하도록 한다.
[root@oracle ~]# vi /etc/chrony.conf # 기존 서버 목록은 주석 처리 #server 0.rhel.pool.ntp.org iburst #server 1.rhel.pool.ntp.org iburst #server 2.rhel.pool.ntp.org iburst #server 3.rhel.pool.ntp.org iburst # 한국 공용 타임서버 목록 설정 server 0.kr.pool.ntp.org iburst server 3.asia.pool.ntp.org iburst server 1.asia.pool.ntp.org iburst # 내부 네트워크에서 이 서버를 타임서버로 참조하기 위한 설정 allow 192.168.110.0/24 # 클라이언트 서버들은 이 서버의 IP를 타임서버로 추가해서 사용 # 예: server 192.168.110.141
[root@oracle ~]# firewall-cmd --add-service=ntp --permanent [root@oracle ~]# firewall-cmd --reload
[root@oracle ~]# systemctl start chronyd [root@oracle ~]# systemctl enable chronyd
[root@oracle ~]# chronyc tracking Reference ID : 114.207.245.166 (114.207.245.166) Stratum : 3 Ref time (UTC) : Thu Oct 20 04:34:47 2016 System time : 0.000196030 seconds slow of NTP time Last offset : -0.000104899 seconds RMS offset : 0.000373706 seconds Frequency : 2485.827 ppm slow Residual freq : -0.025 ppm Skew : 0.807 ppm Root delay : 0.016909 seconds Root dispersion : 0.012794 seconds Update interval : 128.7 seconds Leap status : Normal
[root@oracle ~]# chronyc sources 210 Number of sources = 3 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^* 114.207.245.166 2 8 377 396 +192us[ +87us] +/- 26ms ^+ 168.63.242.24 2 8 377 137 -2096us[-2096us] +/- 76ms ^- y.ns.gin.ntt.net 2 8 221 134 -1266us[-1266us] +/- 130ms
[root@oracle ~]# chronyc tracking Reference ID : 192.168.110.141 (192.168.110.141) Stratum : 4 Ref time (UTC) : Thu Oct 20 04:53:31 2016 System time : 0.000115289 seconds fast of NTP time Last offset : +0.000169455 seconds RMS offset : 0.000108872 seconds Frequency : 2486.154 ppm slow Residual freq : +0.155 ppm Skew : 1.359 ppm Root delay : 0.017371 seconds Root dispersion : 0.013022 seconds Update interval : 64.7 seconds Leap status : Normal
[root@oracle ~]# chronyc sources 210 Number of sources = 1 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^* 192.168.110.141 3 6 377 31 -6455ns[ +163us] +/- 22ms
설정파일(/etc/chrony.conf)에 타임서버만 설정한 상태(server 192.168.110.141)
[root@oracle ~]# chronyc -a makestep 200 OK 200 OK