Linux build NTP time server steps

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.