Step-by-Step NTP configuration on HP-UX

Source: Internet
Author: User
Step by step on the HP-UX to configure NTP-Linux Enterprise Application-Linux server application information, the following is detailed reading. To achieve time synchronization on the HP-UX, you need to set the time server and client, the relevant process is xntpd.

The specific configuration files are as follows:

1./etc/ntp. conf
2./etc/ntp. drift is created on the client and used as the drift file.
3./etc/rc. config. d/netdaemons

Related execution files:
/Usr/sbin/xntpd

Run scripts
/Sbin/init. d/xntpd {start | stop}

The specific configuration steps are as follows (two machines: goodgirl and asogz01, with goodgirl as the benchmark ):

1. Configure the/etc/hosts file for the two machines

A. the hosts file of goodgirl is as follows:
127.0.0.1 localhost loopback
15.70.146.115 goodgirl
15.70.146.113 asogz01

B. The hosts file of asogz01 is as follows:
127.0.0.1 localhost loopback
15.70.146.113 asogz01
15.70.146.115 goodgirl

2. Edit the/etc/rc. config. d/netdaemons file on the two servers.

The settings are as follows:

Export NTPDATE_SERVER = goodgirl
Export XNTPD = 1
Export XNTPD_ARGS =

3. Modify the/etc/ntp. conf file

A. the configuration of the/etc/ntp. conf file of goodgirl (server) is as follows:
Server 127.127.1.1
Fudge 127.127.1.1 stratum 10
Driftfile/etc/ntp. drift

Note: 127.127.1.1 indicates the time when the local machine is synchronized. Generally, the NTP server serves as the time benchmark for other clients, and it uses its own time as the benchmark.

B. Configure the/etc/ntp. conf file of asogz01 (client) as follows:
Server goodgirl
Driftfile/etc/ntp. drift

4. the/etc/ntp. drift file is generated on both hosts.
A. Generate the/etc/ntp. drift file.
# Touch/etc/ntp. drift
B. Modify the File Permission.
# Chmod 755/etc/ntp. drift

5. Start NTP on two hosts
A. Run NTP on goodgirl (server)
#/Sbin/init. d/xntpd start
B. Run NTP on asogz01 (client) (320 seconds later)
#/Sbin/init. d/xntpd start

6. View
A. Run the date check on the two machines respectively.
# Date
B. Run ntpq-p check on the two machines respectively.
# Ntpq-p

NTP configuration problems:

1. No Server suitable for synchronization found
Note: This is the most common problem. After configuring the server and starting the server process, you can immediately start the customer process. Therefore, an error will be reported for the customer process. The solution is to start the process about five minutes later -- otherwise, the above error will be reported and the time will not be synchronized (the specific time should be 5 minutes and 20 seconds, 64 s * 5 = 320 s)

2. Last adjustment did not complete
Note: NTP synchronization is not performed once.

3. Synchronization lost
Note: In general, if the time difference is less than 1000 ms, NTP uses slew adjustment for synchronization. If the time difference is between MS and seconds, it uses step for synchronization. If it exceeds 1000 seconds, ntpd cannot be synchronized. You can only use ntpdate? B command

4. ntpd process loss
Note: One of the main reasons is that you manually used the date command to change the time of the local machine or server (the server defined in ntp. conf), and the time difference between the two is more than 1000 seconds. That is to say, if ntpd finds that the local time and server time exceed 1000 seconds, it will automatically exit. Ntpdate is required if the number exceeds 1000 seconds? B server synchronizes the sum server once (that is, there is a ntpdate in HP's/sbin/init. d/xntpd? B)

Common NTP commands:

1. ntptrace (equivalent to traceroute in windows)
2. ntpdate? Q HOSTNAME (query the time of other hosts)
3. ntpdate? D HOSTNAME (debug mode)
4. ntpdate-B HOSTNAME (synchronized with other hosts)
5. ntpq? P

The above is just the simplest way to configure NTP, as well as more detailed permissions, synchronization interval, and so on. Please refer to the/etc/ntp. conf file, which will provide detailed instructions.
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.