How to Implement ntp time server in Centos6.3 for linux sharing

Source: Internet
Author: User
In Centos6.3, the ntp time server-linux Enterprise Application-Linux server application information is implemented. For more information, see the following section. Network Time Protocol (NTP) is a standard Internet Protocol used for Time synchronization on the Internet. NTP is used to synchronize computer time to certain time standards. The current Time standard is Universal Time Coordinated ). The primary developer of NTP is Professor David L. Mills from the University of Delaware.

What is the use of NTP for us? Simply put, when your computer time is not accurate, you can access the Internet and synchronize the time from the Internet.

For enterprises, if you have hundreds of thousands of computers that cannot directly connect to the Internet, time does not affect your business. If one computer is modified, it cannot be exhausted. At this time, the establishment of an NTP server will show its advantages.

Configure the relevant yum source to ensure that your ntp server can connect to the network.
[Root @ node1 ~] Vim/etc/resolv. conf
# Add a gateway. You can view the gateway under mongown and view the default gateway under ipconfig.
Nameserver 10.17.1.1

1. Install ntp service in yum
[Root @ node1 ~] Yum install-y ntp

2. Compile the ntp configuration file/etc/ntp. conf and add the following two lines,
Restrict 10.17.1.0 mask limit 255.0 nomodify

Server 210.72.145.44 prefer

For the time servers provided on the Internet, you can find them online. There are time servers provided by many countries.

After the ntp server is configured, restart the service. The listening port is UDP port 123 and can be used.
# Ss-autnl port viewing

After the restart, you have to wait a few minutes or ten minutes to synchronize time,
[Root @ node2 ~] # Ntpdate 10.17.1.60
11 Aug 11:38:30 ntpdate [7619]: adjust time server 10.17.1.60 offset 0.000178 sec

If the test is performed immediately after the restart, the following occurs:
[Root @ node2 ~] # Ntpdate 10.17.1.60
11 Aug 11:05:28 ntpdate [1, 7326]: no server suitable for synchronization found

You can use this command parameter to view:
[Root @ node2 ~] # Ntpdate-d 10.17.1.60


NTP configuration file:
The configuration file of/etc/ntp. conf NTP service.

1) permission settings are mainly set by the restrict parameter. The main syntax is:
Restrict IP Address mask subnet mask parameter
The IP address can be an IP address or a default IP address.
The following parameters are provided:
Ignore: Disable all NTP online services.
Nomodify: the client cannot change the time parameter of the server, but the client can perform network calibration on the server.
Notrust: the client source is considered as a untrusted subnet unless it passes authentication.
Noquery: no client Time query is provided.
2) use the server parameter to set the upper-level time server. Syntax:
Server IP address or domain name [prefer]
The IP address or domain name is the designated upper-level time Server. If prefer is added to the Server parameter, the NTP Server is calibrated based on the host time.
3) solves the transfer delay during NTP server Calibration Time
Use the driftfile parameter settings:
Driftfile file name
The time spent in contacting the upper-level time server is recorded in the file after the driftfile parameter.
Note: driftfile must be followed by a complete path file name, not a link file, and the file permission must be set to ntpd daemon for writing.

The/usr/share/zoneinfo/directory stores the setting files corresponding to each time zone.
/Etc/localtime local system time setting file.
/Etc/sysconfig/clock local time zone setting file.
Http://www.magedu.com/

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.