[centOS 7] 로컬시간, NTP 서버를 이용하여 시간(날짜) 동기화

2017-02-20 14:01:55

< 순서 >

1. ntpd (또는 chrony) 설치

2. 방화벽(firewall-cmd) 서비스 단위로 개방

3. ntp 서버 설정

  1. ntpd 데몬 실행

5. 확인

6. 트러블 슈팅

< 진행 방법 >

1. ntpd 설치

yum update -y

yum install -y ntpd

2. 방화벽 서비스 단위로 개방

firewall-cmd –add-service=ntp –permanent

firewall-cmd –reload

3. ntp 서버 설정

vim /etc/ntp.conf

server kr.pool.ntp.org

server time.bora.net

server time.kornet.net

  1. ntpd 데몬 실행

systemctl enable ntpd

systemctl start ntpd

5. 확인

ntpq -p

timedatectl

6. 트러블 슈팅

처음에 Asia/Seoul (UTC, +0000) 으로 나오는 현상이 있었다. (현재 시간은 11시인데 02시로 나오던 현상)

timedatectl set-ntp yes

timedatectl set-timezone KST

의 명령어로 해결하였음

그래도 안 되면

mv /etc/localtime /etec/localtime_org //(백업 하는 것임)

ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime // (심볼릭 링크 생성)

을 시도해본다. (사실 이 명령어를 가장 먼저 쳤었음)

Comments