# linux 6 NTP 시간 동기화 / 타임서버와 시간 동기화 #
우리나라에서 운영되고 있는 NTP 서버
kr.pool.ntp.org
time.bora.net
time.kornet.net
-----------------------------------------------
"지금 시간이 맞는지 확인"
[root@localhost /]#
[root@localhost /]# date
2017. 12. 01. (금) 13:51:41 KST
-----------------------------------------------
" date 및 ntp 가 설치되어 있는지 확인 "
[root@localhost /]# rpm -qa|grep date
rdate-1.4-16.el6.x86_64
system-config-date-1.9.60-2.el6.centos.noarch
python-dateutil-1.4.1-6.el6.noarch
system-config-date-docs-1.0.11-1.el6.noarch
ntpdate-4.2.6p5-10.el6.centos.x86_64
[root@localhost /]# rpm -qa|grep ntp
fontpackages-filesystem-1.41-1.1.el6.noarch
ntp-4.2.6p5-10.el6.centos.x86_64
ntpdate-4.2.6p5-10.el6.centos.x86_64
-----------------------------------------------
"설치되어 있지 않다면 yum 으로 설치진행"
[root@localhost /]# yum install ntp
-----------------------------------------------
"ntp 설정"
[root@localhost /]# vi /etc/ntp.conf
# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
driftfile /var/lib/ntp/drift
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict -6 ::1
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
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
(이하생략........)
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#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
server kr.pool.ntp.org
server time.bora.net
server time.kornet.net
"파랑색 부분을 빨강색 부분처럼 변경"
-----------------------------------------------
"ntpd 서비스를 시작프로그램에 등록 및 확인"
[root@localhost /]# chkconfig ntpd on
[root@localhost /]# chkconfig --list|grep ntpd
ntpd 0:해제 1:해제 2:활성 3:활성 4:활성 5:활성 6:해제
ntpdate 0:해제 1:해제 2:해제 3:해제 4:해제 5:해제 6:해제
-----------------------------------------------
"ntpd 가 실행되고 있는지 확인"
[root@localhost /]# /etc/init.d/ntpd status
ntpd가 정지되었습니다
"ntpd start"
[root@localhost /]# /etc/init.d/ntpd start
ntpd (을)를 시작 중: [ OK ]
-----------------------------------------------
[root@localhost /]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*static.betaidc. 106.247.248.106 3 u 16 64 1 1.864 2.810 0.000
time.bora.net ..{... 16 u 16 64 0 0.000 0.000 0.000
-----------------------------------------------
* : 현재 sync 를 받고 있음을 의미
+ : ntp 알고리즘에 의해 접속은 가능하지만 sync 를 하고 있지는 않음을 의미
- : ntp 알고리즘에 의해 접속은 가능하지만 sync 가능 리스트에서 제외
blank : 접속이 불가능함을 의미
remote는 sync 를 하는 straum 2 서버주소를 가리키며
refid는 각 straum 2 서버가 현재 sync 를 하고 있는 straum 1 서버를 보여준다.
st가 16일 경우 해당 서버에 접속 할 수 없음을 의미한다.
-----------------------------------------------
"시간확인"
[root@localhost /]# date
2018. 04. 06. (금) 15:23:21 KST
'# IT # > Linux' 카테고리의 다른 글
# linux 새로운 디스크 포맷 및 마운트 방법 # (0) | 2018.04.27 |
---|---|
# 리눅스 linux 부팅시간 확인 # (0) | 2018.04.10 |
# linux 물리 메모리 확인방법 # (0) | 2018.03.29 |
# linux 6 버전에서 새로운 디스크 추가 후 fdisk 로 포맷 및 마운트 작업 # (0) | 2018.03.09 |
# 윈도우 에서 리눅스로 파일 옮기기 / winscp 다운로드 및 방법 # (0) | 2018.03.02 |