SUSE11 & RedHat6.1 & HP-UXB.11.31NTP time synchronization service implementation case collection

Source: Internet
Author: User
SUSELinuxEnterpriseServer11 (i586) NTP (Network Time Protocol) is a protocol used to synchronize system time on the network. First, the computer obtains time from the server that acts as a reliable time source. The computer is then used as the time source for other computers in the network. In this way, both absolute time can be maintained and the time of all computer systems in the network can be synchronized. 1. view the system clock (Linux kernel clock) and set the system clock boco @ TJ-Unicom-Gr

SUSE Linux Enterprise Server 11 (i586)

The NTP (Network Time Protocol) mechanism is used to synchronize the system time on the network. First, the computer obtains time from the server that acts as a reliable time source. The computer is then used as the time source for other computers in the network. In this way, both absolute time can be maintained and the time of all computer systems in the network can be synchronized.

1. view the system clock (Linux kernel clock) and set the system clock
Boco @ TJ-Unicom-Group-GnCol2: ~> Date
Mon Jun 27 14:06:29 CST 2011
# Date-s 091713272003.30 system clock setting
# General format of date, month, day, and year. Second

2. view the hardware clock and set the hardware clock
In Linux, there are two types of Clock: System Clock and Real Time Clock (RTC. The system clock refers to the clock in the current Linux Kernel, while the hardware clock is the hardware clock of the motherboard powered by a battery (quartile clock) on the motherboard, this clock can be set in the Standard BIOS Feture item of BIOS.
TJ-Unicom-Group-GiCol2 :~ # Hwclock another way to write hwclock -- show view hardware clock
Mon Jun 27 15:12:29 2011-0.346217 seconds
Hwclock -- set -- date = "MM/DD/YYYY hh: mm: ss" common setting format

3. Synchronize the system clock and hardware clock
Linux (the author uses Red Hat 8.0 and has not performed any experiments in other systems), the hardware clock is synchronized with the system clock after the default restart. If it is not easy to restart (the server usually rarely restarts), use the clock or hwclock command to synchronize the system clock and hardware clock.
# Hwclock -- hctosys Hardware Clock synchronization SYStem clock (with the Hardware clock as the benchmark), -- hctosys indicates that the Hardware Clock to SYStem clock command cannot be used on suse11
# Hwclock-w or hwclock -- The systohc SYStem clock synchronizes the Hardware Clock (based on the SYStem clock). -- systohc indicates that the SYStem Clock to Hardware clock
# Hwclock -- help view all parameters and formats

4. Install the NTP package
Check whether these software packages are installed before installation. The method is as follows:
TJ-Unicom-Group-SysLogCol1 :~ # Rpm-qa | grep ntp
Ntp-4.2.4p6-1.15
Yast2-ntp-client-2.17.14-1.8
If not, install
Linux :~ # Rpm-ivh ntp-4.2.4p6-1.15.i586.rpm
This installation package is located at D: \ working software \ SUSE 11 32-bit operating system image ISO \ SUSE_SLES-11-0-1 \ suse \ i586 \ ntp-4.2.4p6-1.15.i586.rpm

5. set the clock synchronization-NTP configuration file mode (the configuration file mode is valid for a long time and the command mode is temporarily valid) SUSE version 11
NTP configuration file/etc/ntp. conf
Server 10.3.64.61 set the clock server (source) and restart the NTP service. The IP address or domain name of the upper-level Time server
# Local clock (LCL)
Fudge 127.127.1.0 stratum 10 fudge sets Stratum (layer)
# LCL is unsynchronized
Start/stop/restart/status ntp service
#/Sbin/service ntp start
#/Sbin/service ntp stop
#/Sbin/service ntp restart
#/Sbin/service ntp status
Remote refid st t when poll reach delay offset jitter
========================================================== ============================================
* 10.3.64.61 132.174.32.151 5 u 40 64 17 0.226 0.533 0.133 this is the NTP startup status running, pointing to the clock source 10.3.64.61
Checking for network time protocol daemon (NTPD): running
TJ-Unicom-Group-LupsCol2:/etc # ntpq-p monitoring NTP-> NTP can be monitored only when the NTP service is started, otherwise ntpq: read: Connection refused
Remote refid st t when poll reach delay offset jitter
========================================================== ============================================
LOCAL (0). LOCL. 10 l 58 64 1 0.000 0.000 0.001 monitors NTP, but does not point to the clock source
Remote refid st t when poll reach delay offset jitter
========================================================== ============================================
* 10.3.64.61 132.174.32.151 3 u 31 64 377 0.714 207.690 147.835 monitors NTP, which has been directed to the clock source 10.3.64.61. Is the destination NTP normal? If it is found that an asterisk and a plus sign appear before the remote column, it indicates that the synchronization has been successful with this server.
TJ-Unicom-Group-Analyse1 :~ # Service ntp status this is the status where NTP is not started
Checking for network time protocol daemon (NTPD): unused
TJ-Unicom-Group-GnCol1:/etc # ntpdate 10.3.64.61 NTP command mode, manual NTP synchronization, WARNING information, but can be synchronized (configuration file mode is valid for a long time, command mode Temporary valid)
!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!
The ntpdate program is deprecated and shocould not be used any more.
Quote the upstream ntp developers:
"The functionality ntpdate offered is now provided by the ntpd daemon
Itself. If you call ntpd with the command line option-q it will
Retrieve the current time and set it accordingly ."
Please check the Network Time Protocol (NTP) daemon man page and
Http://support.ntp.org/bin/view/Dev/DeprecatingNtpdate
For further information.
You can replace the ntpdate call with "rcntp ntptimeset" to achieve
In‑poll of the servers specified in/etc/ntp. conf.
The program/usr/sbin/sntp offers comparable functionality to ntpdate.
Specifically
Sntp-P no-r pool.ntp.org
Is equivalent
Ntpdate pool.ntp.org
For further details please refer to the man page of sntp.
TJ-Unicom-Group-GnCol1:/etc # date
Mon Jul 4 11:32:56 CST 2011
TJ-Unicom-Group-GnCol1:/etc # ntpq-p monitoring NTP-> NTP can be monitored only when the NTP service is started, otherwise ntpq: read: Connection refused
Ntpq: read: whether the Connection refused destination NTP is normal

Related Article

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.