티스토리 뷰

정보가 좋아요/IT

CentOS 8 시간 동기화 방법

늘지금처럼 2022. 11. 18. 09:28
반응형

Centos 7이하 버전에서 rdate로 시간동기화를 하였으나 Centos 8버전에서는 아래와 같은 방법으로 동기화를 하여야합니다.

1. 시간대가 다른 지역으로 적용되어 있으면 Asia/Seoul로 변경해주세요

[root@localhost ~]# timedatectl set-timezone Asia/Seoul

2. chronyde 데몬으로 시간동기화를 합니다

 - 우선 config 파일을 열어주세요

[root@localhost ~]# vi /etc/chrony.conf

3. pool 2.centos.pool.ntp.org iburst 를 주석처리하고

  server time.bora.net iburst
  server send.mx.cdnetworks.com iburst

   동기화 서버를 추가해줍니다

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#pool 2.centos.pool.ntp.org iburst

server time.bora.net iburst
server send.mx.cdnetworks.com iburst

# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift

# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3

# Enable kernel synchronization of the real-time clock (RTC).
rtcsync

# Enable hardware timestamping on all interfaces that support it.
#hwtimestamp *

# Increase the minimum number of selectable sources required to adjust
# the system clock.
#minsources 2

# Allow NTP client access from local network.
#allow 192.168.0.0/16

# Serve time even if not synchronized to a time source.
#local stratum 10

# Specify file containing keys for NTP authentication.
keyfile /etc/chrony.keys

# Get TAI-UTC offset and leap seconds from the system tz database.
leapsectz right/UTC

# Specify directory for log files.
logdir /var/log/chrony

# Select which information is logged.
#log measurements statistics tracking

4. chronyd의 서비스를 재시작합니다

[root@localhost ~]# systemctl restart chronyd.service

5. 메인보드 시간 동기화를 합니다

[root@localhost ~]# hwclock -w
[root@localhost ~]# hwclock -v

6. 시간을 확인합니다

[root@localhost ~]# date
2022. 11. 18. (금) 09:27:00 KST
반응형
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함