컴퓨터 / Computer

NTPD를 이용한 시간 동기화

공유지기 1 4,266 2017.12.19 16:14

0_fivEmSUN_cafc0046fceae53820e6e11ed19a3a0d3034ec3c.jpg 


서버의 경우 시간 설정이 매우 중요하다. date 명령으로 해당 시간을 확인해 보면 가끔 안 맞는 경우가 있다. 한두 번 수정하는 건 rdate 명령으로 가능한데, 계속 틀린다면 동기화를 시켜 줘야 한다. 이럴 때 Network Time Protocol, 즉 NTP를 사용한다.

CentOS 기준으로 설명한다.

 

 

1. NTP 설치 

 

 

 yum install ntp 

 

 

2. NTP 설정

설정파일 : /etc/ntp.conf

 

아래 내용을 제거한다.

 

 

server 0.centos.pool.ntp.org iburst

server 1.centos.pool.ntp.org iburst

server 2.centos.pool.ntp.org iburst

server 3.centos.pool.ntp.org iburst

 

국내 서버로 대체한다. (목록은 http://webdir.tistory.com/120 에서 가져옴)

 

 

server kr.pool.ntp.org 

server time.bora.net 

server time.kornet.net

 

 

3. NTP 등록 

 

 

chkconfig ntpd on

 

 

4. 동작 여부 확인 

 

아래와 같이 입력하면 등록된 서버들을 보여준다.

 

 

ntpq -p 

 

 

결과 화면.

 

 

     remote           refid      st t when poll reach   delay   offset  jitter

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

*dadns.cdnetwork 204.123.2.5      2 u   52   64   77    1.613   -7.979   4.190

 time.bora.net   204.123.2.5      2 u  123   64   72    2.663    7.502   5.621

 

 

 

dadns.cdnetwork 에 "*"이 붙어 있으면 동기화 중이라고 한다.

 

 

이상. 

 

 

 

 

Comments

공유지기 2020.02.13 09:55
한국 시간대로 변경하기

timedatectl set-timezone Asia/Seoul

출처 : https://www.fun25.co.kr/blog/linux-centos-7-change-timezone/?category=001

bob 차량용 비상탈출용 다용도 미니 해머 망치 절단기
칠성상회
그랜드스타렉스 번호판가드 현대모비스 자동차 번호판
칠성상회
우신 박스테이프 백색 노랑 파랑 빨강 컬러50M 50개
칠성상회
생활굿 2024 캘린더 스탠딩 탁상달력 랜덤1개
칠성상회