NTP server is used for LAN time synchronization. You can ensure that all servers in the LAN are synchronized with the time server. Some applications require a higher time-to-live nature. Requirements must be unified time, so the configuration of the time server is important.
The internet has a lot of time servers. For example, there is a free NTP server with Fudan University: Ntpdate ntp.fudan.edu.cn. Nanjing University time Server: Ntp.nju.edu.cn and so on.
The service listener port for NTP is UDP port 123. Then you need to enable client Access Port 123 under the local firewall.
System environment:
1. VMware Virtual Machines
2.Linux Environment: CentOS 6.5 x64 System
Turn on the virtual machine. Editing a configuration file vim/etc/sysconfig/iptables
Add the following rules:
-A input-m state--state new-m udp-p--dport 123-j ACCEPT
3. Time server configuration (installed to ignore this step)
Install the NTP service yum install NTP ntpdate-y.
4. Modify the ntp.conf file (before modifying the file, back up the file, develop good habits, (*^__^*) hehe ...)
Cp/etc/ntp.conf/etc/ntpd.conf.bak
5. You can specify the IP address or domain name of the NTP server you want to synchronize
This is based on this machine, 127.0.0.1 realize the time synchronization within the LAN.
6. Restart the service after the configuration is complete.
ETC/INIT.D/NTPD restart
7. Review the connection information after the reboot is complete
Ntpq-p
8. Time synchronization
Ntpdate Server IP Address
9. You can also choose to set scheduled tasks, timing synchronization Time
CRONTAB-E * * * * * */usr/sbin/ntpdate ntpserver IP. >>/usr/local/crontab/logs/ntpdate.log
10. Client Add settings
* * * * * */usr/sbin/ntpdate server IP >>/usr/lcoal/logs/ntpdate.log 2>&1//time can be self-specified, when Synchronous. * Representative Time
The NTP server configuration is complete.
This article is from the "Star Moon Love" blog, please be sure to keep this source http://xuegodxingyue.blog.51cto.com/5989753/1960767
Linux build NTP time server steps