Centos build a local NTP server
Environmental preparation
Two centos7, firewall closed, selinux closed
server (server): 192.168.112.153
client (client): 192.168.112.154
Step start
1. View the current system kernel
- Confirm that the server and client versions are the same
cat /etc/redhat-release
- Execution effect chart
2. Server installation service
yum -y install ntp
- After installation, check
3. Modify the configuration file
vim /etc/ntp.conf
- Comment out line 8
- Comment out lines 13, 14
- Remove the comment (#) on line 17 and modify the local IP
resolution: Allow updated IP address segment to synchronize time - Comment out lines 21 to 24
- 25.26 line added
Analysis: If the network time synchronization server is not available, provide services to the client based on the local time
4. Start the service
systemctl start ntpd 启动
systemctl enable ntpd 开机自启
5. View service status
systemctl status ntpd
ntp check to
see if it is synchronized
6. Verify time synchronization
Client install ntp service
yum -y install ntp
synchronised time
ntpdate -u 192.168.112.153
Check time
date
Anti-thunder
-
-
- If the time on the server side changes or changes manually,
remember to restart the service! ! !
- If the time on the server side changes or changes manually,
-
- Change the verification rendering
- Server modification, restart
- Client side synchronization verification