Configuring
NTP server for a client and troubleshooting
Prerequisites:
Need to have a TIME server with which client will sync
the time.
Declaration:
(Server: 9.57.167.220)
(Client: 9.57.167.221)
On
the NTP server ,perform the below steps:
1. Verify that you have a suitable NTP
server. Enter:
# lssrc -ls xntpdNOTE: Sys peer should show a valid server or 127.127.1.0.
If the server is "insane", you will need to correct it by adding a server line to /etc/ntp.conf and restarting xntpd. This can be done by following these steps:
a) Add the local host “server 127.127.1.0” entry in /etc/ntp.conf.
# vi /etc/ntp.conf
Add:
server 127.127.1.0
Double check that "broadcast client" is commented out.
Having added , “tail /etc/ntp.conf” should be akin to below:
b) Stop and start the xntpd. # stopsrc -s xntpd # startsrc -s xntpdNOTE: If the server runs databases, use the -x flag to prevent the clock from changing in a negative direction. Enter the following:
# startsrc -s xntpd -a "-x"
2. Repeat the step 1. to verify if we have a suitable NTP server,
server should not be insane. Sys peer should
show a valid server or 127.127.1.0, like below:
NOTE:
The syncronization may take few minutes ,untill then the output will
not show the valid server in “Sys peer”.
This concludes the configuration part
on NTP server end , neverthless it's always a good practice to check
and ensure that the “xntpd” daemon is running.
On
Client, perform the below steps:
1. Specify your xntp server in
/etc/ntp.conf, enter:
# vi /etc/ntp.conf(Comment out the "broadcastclient" line and add server ip.address.of.server prefer.)
Leave the driftfile and tracefile at their defaults.
Server 9.57.167.220
is the NTP server we have declared.
2. Start the xntpd daemon:
# startsrc -s xntpd(Use the -x flag if it is appropriate for your environment.)
- Uncomment xntpd from /etc/rc.tcpip so it will
start on a reboot. (This is optional and depends on envrionment )
# vi /etc/rc.tcpip3. Uncomment the following line:
start /usr/sbin/xntpd "$src_running"If using the -x flag, add "-x" to the end of the line. You must include the quotes around the -x.
4. Verify that you have a server
suitable for synchronization. Enter:
# ntpdate -d ip.address.of.server/hostname Eg: # ntpdate -d 9.57.167.220 or # ntpdate -d hostname
The offset must be less than 1000
seconds for xntpd to synch.
**If the offset is greater than 1000
seconds like in below artifact;# change the time manually on the client so as to meet the nearest time with the NTP server and run the ntpdate -d again , the offset will be below 1000.
NOTE: It's very important to keep the offset below 1000 ,then only it'll synch with the NTP server.
If you get the message, "no server suitable for synchronization found", verify xntpd is running on the server (see above) and that no firewalls are blocking port 123.
5. Verify that the client is synched once the offset is set/exist below 1000.
# lssrc -ls xntpd
NOTE: Sys peer should display the IP address or name of your xntp server. This process may take up to 12 minutes.
No comments:
Post a Comment