728x90
Chronyd
개요
- Linux chrony로 시간 동기화(time synchronizing)
- CentOS 8이상 버전부터는 rdate를 이용하여 시간동기화가 되지않는다.
설치 방법
01. 현재 설정 정보를 확인
timedatectl
# Local time: 목 2024-04-18 12:38:47 KST
# Universal time: 목 2024-04-18 03:38:47 UTC
# RTC time: 수 2024-04-17 07:50:47
# Time zone: Asia/Seoul (KST, +0900)
# NTP enabled: yes
#NTP synchronized: no
# RTC in local TZ: no
# DST active: n/a
02. 만일 Time Zone이 잘못 설정되어 있는경우 Time Zone 설정
timedatectl set-timezone Asia/Seoul
03. chrony 설치
- chrony 설치
dnf install chrony
- 우분투일 경우
sudo apt install chrony
03. chrony configure
vim /etc/chrony.con
# pool 2.centos.pool.ntp.org iburst
server time.bora.net iburst
04. 부팅 시 자동 구동 설정
systemctl enable chronyd
systemctl start chronyd
05. chronyd 구동 확인 (시작 X)
chronyc sources -v
# .-- Source mode '^' = server, '=' = peer, '#' = local clock.
# / .- Source state '*' = current best, '+' = combined, '-' = not combined,
# | / 'x' = may be in error, '~' = too variable, '?' = unusable.
# || .- 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
# ===============================================================================
# ^? time.bora.net 0 6 0 - +0ns[ +0ns] +/- 0ns
# ^? 설정 동기화 시작 X
# ^* 설정 동기화 구동
06. timedate ntp on
timedatectl set-ntp true
systemctl restart chronyd
07. chronyd 구동 확인 (시작 O)
chronyc sources -v
# .-- Source mode '^' = server, '=' = peer, '#' = local clock.
# / .- Source state '*' = current best, '+' = combined, '-' = not combined,
# | / 'x' = may be in error, '~' = too variable, '?' = unusable.
# || .- 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
# ===============================================================================
# ^* time.bora.net 2 6 17 3 +2539us[+2960us] +/- 84ms
# ^? 설정 동기화 시작 X
# ^* 설정 동기화 구동
timedatectl status
# Local time: 수 2024-04-17 17:03:23 KST
# Universal time: 수 2024-04-17 08:03:23 UTC
# RTC time: 수 2024-04-17 08:03:23
# Time zone: Asia/Seoul (KST, +0900)
#System clock synchronized: yes <-- 동기화 하고 있음
# NTP service: active
# RTC in local TZ: no
참고
https://musclebear.tistory.com/186
반응형
'Operating System > Linux' 카테고리의 다른 글
[Linux] Virtual BOX 명령어 (머신 시작, 종료) (0) | 2024.12.20 |
---|---|
[Rocky] GRPC-GO (protobuf) compiler 설치 (0) | 2024.09.04 |
[Rocky] chronyc settime 설정오류 (0) | 2024.03.26 |
[ubuntu20] postgresql client 13이상 설치방법 (0) | 2022.07.18 |
[CentOS] yum install 시 "Could not retrieve mirrorlist http://mirrorlist.centos.org" 해결방법 (0) | 2022.05.04 |