티스토리 뷰

Linux/CentOS

CentOS 시간 동기화

gyuzero 2022. 5. 3. 16:53

NTP(Network Time Protocol)

- 네트웍으로 연결되어 있는 컴퓨터들끼리 클록 시각을 동기화시키는데 사용되는 프로토콜

 

NTP 설치

rpm -qa | grep ntp
sudo yum install -y ntp ntpdate

 

NTP 설정

sudo firewall-cmd --permanent --add-service=ntp
sudo firewall-cmd --reload

 

sudo vi /etc/ntp.conf

# 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.nuri.net

 

NTP 실행

sudo chkconfig ntpd on # 부팅과 동시에 실행되게 런레벨 조정
sudo systemctl start ntpd.service
sudo systemctl status ntpd.service
동기화까지는 5~10분정도 시간이 소요

 

설정 확인

ntpq -p

* 표시가 있는 것이 현재 NTP 데몬이 싱크를 하고 있는 서버
+ 는 ntp 알고리즘에 의해 접속은 가능하지만 sync 를 하고 있지는 않음을 의미
- 는 ntp 알고리즘에 의해 접속은 가능하지만 sync 가능 리스트에서 제외
아무 기호 표시 없다면 접속이 불가능
sudo timedatectl set-timezone Asia/Seoul

 

 

https://www.lesstif.com/system-admin/linux-ntp-time-daemon-14090306.html

 

Linux에서 NTP time daemon 으로 시간 동기화하기

NTP daemon 이 떠 있으면 다음과 같은 에러가 나고 ntpdate 명령어가 먹지 않으므로 ntpdate 로 업데이트할 경우 service ntpd stop 으로 daemon 을 중지해야 함 18 Jan 05:53:49 ntpdate[21340]: the NTP socket is in use, exitin

www.lesstif.com

 

 

 

'Linux > CentOS' 카테고리의 다른 글

Linux fail2ban 설정  (0) 2022.08.02
SFTP 설정  (0) 2022.05.01
cron 사용법  (0) 2022.05.01
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함