맛집 여행 캠핑 일상 생활

[CentOS] 8.x 서버 시간 동기화 방법 본문

IT이야기

[CentOS] 8.x 서버 시간 동기화 방법

영은파더♥ 2020. 7. 3. 13:59

CentOS 7.x 와 8.x 이 서버 시간 동기화하는게 달라졌네요~

기존 ntp 로 동기화 하던게 8.x 에서 chrony 로 바뀌었나봅니다.

설정이 제대로 되어있음에도 시간이 제대로 나오지 않는군요~

[root@localhost ~]# date
Fri Jul  3 04:19:19 KST 2020
[root@localhost ~]# ls -l /etc/localtime
lrwxrwxrwx. 1 root root 32 Jun 26 11:45 /etc/localtime -> ../usr/share/zoneinfo/Asia/Seoul

# vi /etc/chrony.conf

#pool 2.centos.pool.ntp.org iburst
server time.bora.net iburst

chrony.conf 파일을 열어서 위의 값으로 수정합니다.

[root@localhost ~]# systemctl restart chronyd
[root@localhost ~]# date
Fri Jul  3 04:21:32 KST 2020
[root@localhost ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^? time.bora.net                 0   6     0     -     +0ns[   +0ns] +/-    0ns
[root@localhost ~]# date
Fri Jul  3 04:22:14 KST 2020

[root@localhost ~]# hwclock -v
hwclock from util-linux 2.32.1
System Time: 1593717798.866139
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Last drift adjustment done at 1593717797 seconds after 1969
Last calibration done at 1593717797 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2020/07/03 04:23:19
Hw clock time : 2020/07/03 04:23:19 = 1593717799 seconds since 1969
Time since last adjustment is 2 seconds
Calculated Hardware Clock drift is 0.000000 seconds
2020-07-03 04:23:18.856293+09:00
[root@localhost ~]# date
Fri Jul  3 13:51:57 KST 2020

chronyd 재시작하고 바로 바뀌지 않고 일정 시간이 지난후에 제대로 시간이 표시가 되는군요~

참고하시기 바랍니다.

 

'IT이야기' 카테고리의 다른 글

RSYNC 폴더 생성 옵션  (0) 2020.07.06
[CentOS] 원격지 서버 컴퓨터 끄는 방법  (0) 2020.07.03
[CentOS] WOL 기능 설정  (0) 2020.07.02
[윈도우10] 복구 파티션 삭제 방법  (0) 2020.06.25
LDPlayer VT 활성화 하기  (11) 2020.06.23
Trackback : | Comments :