![]() |
시스템 시간 동기화 (CentOS 8)
[GCP]
작성일시 : 2021. 01. 10 (03:03)
|
chrony 설치 확인
[root@onnada-instance ~]# rpm -qa | grep chrony
chrony-3.5-1.el8.x86_64
GCP에는 이미 설치되어 있다. 없으면 설치
[root@onnada-instance ~]# dnf install chrony
chrony 서비스 확인
[root@onnada-instance ~]# systemctl status chronyd
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2021-01-09 13:57:26 UTC; 3h 11min ago
timezone list 확인
[root@onnada-instance ~]# timedatectl list-timezones
timezone 설정
[root@onnada-instance ~]# timedatectl set-timezone Asia/Seoul
설정 파일에서 구글 주석, 타임존 추가
[root@onnada-instance ~]# vi /etc/chrony.conf
# These servers were defined in the installation:
#server metadata.google.internal iburst
server time.bora.net iburst
server send.mx.cdnetworks.com iburst
server time.google.com iburst
systemd 데몬 등록 및 재시작
[root@onnada-instance ~]# systemctl enable chronyd
[root@onnada-instance ~]# systemctl restart chronyd
시간 동기화 실행
[root@onnada-instance ~]# timedatectl set-ntp true
설정 확인
[root@onnada-instance ~]# timedatectl
Local time: Sun 2021-01-10 02:51:35 KST
Universal time: Sat 2021-01-09 17:51:35 UTC
RTC time: Sat 2021-01-09 17:51:35
Time zone: Asia/Seoul (KST, +0900)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
동작 확인
[root@onnada-instance ~]# chronyc sources -v
210 Number of sources = 3
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| / '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
|| .- xxxx [ yyyy ] +/- zzzz
|| Reachability register (octal) -. | xxxx = adjusted offset,
|| Log2(Polling interval) --. | | yyyy = measured offset,
|| \ | | zzzz = estimated error.
|| | | \
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* metadata.google.internal 2 6 17 63 +7585ns[ +42us] +/- 280us
^- send.mx.cdnetworks.com 2 6 17 63 -332us[ -298us] +/- 26ms
^- time4.google.com 1 6 17 65 -58us[ -24us] +/- 24ms
