728x90
NTP
- NTP 패키지 설치: 먼저 각 가상 서버에 NTP 패키지를 설치
sudo yum install ntp
- /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 time.bora.net
server kr.pool.ntp.org
- NTP 서비스 재시작
systemctl restart ntp //재시작을 통해 변경 사항 적용
- 시간 확인
ntpq -p //현재 NTP 서버와의 연결 상태 및 동기화된 시간 정보를 표시
- 자동 실행 설정: 시스템이 부팅될 때 NTP 서비스가 자동으로 시작되도록 설정
systemctl enable ntp
hwclock
- 하드웨어 시간을 나타내는 명령어
hwclock
- 시스템 시간을 나타내는 명령어
date
# 하드웨어 시간으로 시스템 시간을 변경 (hw -> sys)
hwclock --hctosys
# 시스템 시간으로 하드웨어 시간을 변경 (sys -> hw)
hwclock --systohc
728x90
'OS > Linux' 카테고리의 다른 글
[Linux] vi 편집기 명령어 (0) | 2024.08.28 |
---|---|
[Linux] cron 표현식 (0) | 2024.08.27 |
[Linux] timezone? (0) | 2024.08.26 |
Linux 명령어 정리 (0) | 2023.01.04 |
[Linux] Centos6 yum update 에러 (0) | 2023.01.04 |