공유할 서비스 선택

TECH


TECH

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

페이지 정보

작성자 partner_test 아이디로 검색 전체게시물 댓글 0건 조회 12,826회 좋아요 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 목록
번호 제목 작성자 작성일 조회수
114 Virtualization Leesangwoo 아이디로 검색 전체게시물 03-18 3702
[ KVM ] KVM 네트워크 구성

카테고리 : Virtualization

3,702 0
작성자 : Leesangwoo 22/03/18
113 Middleware 미들웨어 아이디로 검색 전체게시물 03-08 1954
(weblogic 활용) 퓨전미들웨어로 OHS Collocated 모드 구성 및 모니터링

카테고리 : Middleware

1,954 0
작성자 : 미들웨어 22/03/08
112 Virtualization Leesangwoo 아이디로 검색 전체게시물 02-28 3861
[ KVM ] KVM 설치 및 구성

카테고리 : Virtualization

3,861 0
작성자 : Leesangwoo 22/02/28
111 OS LeeHyongDong 아이디로 검색 전체게시물 02-28 8409
[Linux]Postfix 설명 및 설정

카테고리 : OS

8,409 0
작성자 : LeeHyongDong 22/02/28
110 Middleware 미들웨어 아이디로 검색 전체게시물 02-23 3290
(weblogic 활용) Weblogic-12c & WebTier 연동설정 및 (첨부파일 test.war 배포방법)

카테고리 : Middleware

3,290 0
작성자 : 미들웨어 22/02/23
109 Middleware 미들웨어 아이디로 검색 전체게시물 02-07 2484
(weblogic 활용) WebTier 12cR2 (OHS)를 Standalone 모드로 단독 구성 후 연결TEST

카테고리 : Middleware

2,484 0
작성자 : 미들웨어 22/02/07
108 Middleware 미들웨어 아이디로 검색 전체게시물 01-19 1541
(weblogic 활용) Weblogic 14c 다운로드 & Xming 으로 리눅스에서 GUI 실행, 콘솔 접속 가이드

카테고리 : Middleware

1,541 0
작성자 : 미들웨어 22/01/19
107 Middleware 미들웨어 아이디로 검색 전체게시물 01-05 1243
(docker) Oracle Cloud (OCI) VM서버에서 Docker 설치하기

카테고리 : Middleware

1,243 0
작성자 : 미들웨어 22/01/05
106 Middleware 미들웨어 아이디로 검색 전체게시물 12-20 1166
(JBoss & Wildfly) wildfly 모듈 빌드하는 방법 (mvn package)

카테고리 : Middleware

1,166 0
작성자 : 미들웨어 21/12/20
105 Middleware 미들웨어 아이디로 검색 전체게시물 12-06 1237
(JBoss & Wildfly) JBoss 마이그레이션 툴 "RHAMT" 5.2.0 다운로드 및 설치 방법

카테고리 : Middleware

1,237 0
작성자 : 미들웨어 21/12/06
Total 204건
게시물 검색

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