공유할 서비스 선택

TECH


TECH

OS [Linux] RHEL7 ntp서버 시간 동기화

페이지 정보

작성자 partner_test 아이디로 검색 전체게시물 댓글 0건 조회 18,016회 좋아요 1회 작성일 19-05-29 07:32

본문

 

timedatectl’명령은 시스템의 현재 시간, 시간대 및 NTP 동기화 설정을 포함하여 현재 시간과 관련된 시스템 설정의 개요를 표시
 

[root@localhost ~]# timedatectlLocal time: Thu 2017-09-21 00:12:58 KSTUniversal time: Wed 2017-09-20 15:12:58 UTC
RTC time: Wed 2017-09-20 15:12:58

Time zone: Asia/Seoul (KST, +0900)

NTP enabled: yes

NTP synchronized: no

RTC in local TZ: no

DST active: n/a

 

list-timezones 옵션을 사용하면 설정가능한 시간대 목록을 출력.

[root@localhost ~]# timedatectl list-timezonesAfrica/AbidjanAfrica/Accra
Africa/Addis_Ababa

Africa/Algiers

Africa/Asmara

Africa/Bamako

Africa/Bangui

Africa/Banjul

Africa/Bissau

Africa/Blantyre

 

시간대를 서울로 변경

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

Local time: Thu 2017-09-21 00:12:58 KST

Universal time: Wed 2017-09-20 15:12:58 UTC

RTC time: Wed 2017-09-20 15:12:58

Time zone: Asia/Seoul (KST, +0900)

NTP enabled: yes

NTP synchronized: no

RTC in local TZ: no

DST active: n/a

 

 

set-ntp 옵션은 자동 시간 조정을 위한 NTP 동기화를 활성화 또는 비활성화합니다.

timedatectl set-ntp true / false

 

chronyd 서비스 : 일반적으로 부정확한 로컬 하드웨어 클록(RTC)을 구성된 NTP 서버에 동기화하면서 계속 추적합니다. 네트워크 연결이 불가능한 경우에는 /etc/chrony.conf 구성 파일에 지정된 driftfile에 기록되는 계산된 RTC 클록 드리프트에 동기화합니다.

 

/etc/chrony.conf 파일

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

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

 

# Ignore stratum in source selection.

stratumweight 0

 

# Record the rate at which the system clock gains/losses time.

driftfile /var/lib/chrony/drift

 

# Enable kernel RTC synchronization.

rtcsync

 

# In first three updates step the system clock instead of slew

# if the adjustment is larger than 10 seconds.

makestep 10 3

 

# Allow NTP client access from local network.

#allow 192.168/16

 

# Listen for commands only on localhost.

bindcmdaddress 127.0.0.1

bindcmdaddress ::1

 

# Serve time even if not synchronized to any NTP server.

#local stratum 10

 

keyfile /etc/chrony.keys

 

# Specify the key used as password for chronyc.

commandkey 1

 

# Generate command key if missing.

generatecommandkey

 

# Disable logging of client accesses.

noclientlog

 

# Send a message to syslog if a clock adjustment is larger than 0.5 seconds.

logchange 0.5

 

logdir /var/log/chrony

#log measurements statistics tracking

 

server 행의 첫 번째 인수는 NTP 서버의 IP 주소나 DNS 이름입니다. IP나 DNS주소 뒤에 서버의 옵션들이 나열될 수 있습니다. 서비스가 시작된 후에는 보다 정확한 초기 클록 동기화를 위해 네 가지 측정이 이루어지므로 iburst 옵션을 사용하는 것이 좋습니다.

# Please consider joining the pool (http://www.pool.ntp.org/join.html).server xxx.xxx.xxx.xxx iburstserver ntp.server.domain iburst
 

systemctl restart chronyd 재시작

 

chronyc 명령어는 chronyd의 클라이언트 역할을 한다. NTP 서버가 시스템 클록을 동기화되었는지 확인해야한다.

chronyc sources -v를 사용하여 확인

[root@localhost ~]# chronyc sources -v210 Number of sources = 0
.– 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

===============================================================================

^* ntp.server.domain 8 6 17 23 -497ns[-7000ns] +/- 956us

ntp.server.domain ntp서버가 정상적으로 ^* 동기화 되었음을 나타낸다. 

댓글목록

등록된 댓글이 없습니다.

TECH 목록
번호 제목 작성자 작성일 조회수
254 OS OSworker 아이디로 검색 전체게시물 06-29 15
앞으로 RHEL 에서는 핫(Hot) DR 경우만 유료 라고 합니다~ 웜(Warm), 콜드(Cold)는 무료~!!!

카테고리 : OS

15 0
작성자 : OSworker 25/06/29
253 OS OSworker 아이디로 검색 전체게시물 06-22 62
RHEL 10 에서 pacemaker가 어떤것이 변경되었는지 찾아봤습니다.

카테고리 : OS

62 0
작성자 : OSworker 25/06/22
252 OS OSworker 아이디로 검색 전체게시물 06-10 119
EUS 는 알겠는데 EEUS는 뭔가요? Enhanced Extended Update Support

카테고리 : OS

119 0
작성자 : OSworker 25/06/10
251 OS OSworker 아이디로 검색 전체게시물 05-28 189
RHEL10에 탑재되어있는 RHEL LIGHTSPEED 소개 #RHEL9.6도가능 #RHELAI

카테고리 : OS

189 0
작성자 : OSworker 25/05/28
250 OS OSworker 아이디로 검색 전체게시물 05-23 209
두번째 RHEL10 소개 - RHEL10 Lifecycle 소개 및 News

카테고리 : OS

209 0
작성자 : OSworker 25/05/23
249 OS OSworker 아이디로 검색 전체게시물 05-13 279
드디어 RedHat Enterprise Linux 10이 나왔습니다. #RHEL10

카테고리 : OS

279 0
작성자 : OSworker 25/05/13
248 OS OSworker 아이디로 검색 전체게시물 05-01 318
xsos라고 들어보셨나요? #sosreport

카테고리 : OS

318 0
작성자 : OSworker 25/05/01
247 OS OSworker 아이디로 검색 전체게시물 04-23 449
sarchart 라고 들어보셨나요? sar datat 를 좀더 보기 편하게 만들어줍니다.

카테고리 : OS

449 0
작성자 : OSworker 25/04/23
246 OS OSworker 아이디로 검색 전체게시물 04-16 614
Sosreport 생성시에 OS 의 모든 sar 데이터가 포함되지 않아요. 해결방법은?

카테고리 : OS

614 0
작성자 : OSworker 25/04/16
245 OS OSworker 아이디로 검색 전체게시물 03-29 757
이슈 : sbd watchdog type stonith 사용시 메모리 누수 발생 #RHEL8.10 #RHEL9.4

카테고리 : OS

757 0
작성자 : OSworker 25/03/29
Total 254건
게시물 검색

주식회사 클럭스| 대표 : 이찬호| 사업자등록번호 : 107-87-27655
주소 : 서울특별시 영등포구 국회대로 800, 여의도파라곤
E-mail : sales@chlux.co.kr
Copyright © 클럭스 chlux.co.kr All rights reserved.
상단으로Top