CentOS 7.x NTP 시간 동기화



리눅스 서버 시간을 우리나라 Asia Seoul 로 동기화 하는 방법입니다.


해외 업체에서 VPS를 개설하니 시간이 맞지 않는군요~


rdate 로 동기화 가능하며 ntpd 데몬으로도 할 수 있습니다.


우선 date 명령어로 시간이 맞는지 확인합니다.


# date

Thu Mar 30 12:07:08 KST 2017


KST 로 나오지 않는다면 /etc/localtime 을 바꾸어 줍니다.


# ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime



이제 시간을 동기화 하는 방법입니다.



▶ 크론으로 동기화


00 06 * * * root /usr/bin/rdate -s time.bora.net && /sbin/clock -w


매일 새벽6시 시간을 동기화 하는 크론입니다.



▶ ntpd 데몬으로 동기화


# yum -y install ntp

# systemctl start ntpd

# systemctl enable ntpd



동기화가 잘 되고 있는지 확인


# ntpq -pn

     remote           refid      st t when poll reach   delay   offset  jitter

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

*211.233.40.78   204.123.2.5      2 u   76   64    2   37.130    0.738   0.000

 45.76.107.191   160.16.75.242    3 u   10   64    1    1.939    3.836   0.000



타임서버를 다른 곳을 변경하는 방법


vi /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

server kr.pool.ntp.org

server asia.pool.ntp.org


그런데 굳이 안바꿔도 됩니다.


블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,