cancel
Showing results for 
Search instead for 
Did you mean: 

NTP Client Configuration

Raoof
Regular Advisor

NTP Client Configuration

Hi,

 

Need your help please!!

 

We have the Windows Domain Controller as NTP server for time sync and need to configure NTP client in HP-UX servers.


Production Environment Deatails.

Oracle 11g RAC running on two nodes (Time dependent, should i need to stop the database before configuring ntp client?)
HP-UX 11.31 (two servers)

 

On both servers date is same where as the clock of these two servers is 20 minutes ahead from NTP Server.

 

[mcmsdbl1@oracle@/u01/oracle]$date

Mon Sep 7 08:29:47 WAT 2015


I got the below message on checking if NTP is already configured

 

[mcmsdbl1@root@/]#ntpq -p

ntpq: read: Can't assign requested address

 

Whereas on checking service it shows running..


[mcmsdbl1@root@/]#ps -ef | grep xntpd

root 21276 21177 0 08:45:12 pts/0 0:00 grep xntpd


Do i need to configure NTP Client on both servers? or only in one server will be enough because both servers is synchronising the time with each other as shown below the message from /var/adm/syslog/syslog.log


Time is syincronizing with in both nodes in cluster

p 6 14:37:53 mcmsdbl1 CLSD: The clock on host mcmsdbl1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.

 

If i have to configure NTP Client in one of the server then Will follow the below steps, please check and advice if am i missing any steps.


-- Shutting down the database first before proceeding further----

 

The configuration of /etc/ntp.conf file as below,

 

server 10.10.xx.xx prefer           #NTP Server IP-Address

fudge 127.127.1.1 stratum 10 # localhost if NTP servers fail

driftfile /etc/ntp.drift


The configuration of /etc/rc.config.d/netdaemons file as below,

export NTPDATE_SERVER=10.xx.xx.xx     #NTP Server IP Address
export XNTPD=1
export XNTPD_ARGS=


And running the xntpd daemon manually. #/sbin/init.d xntpd or /sbin/init.d/xntpd start and Wait. 

 

Then will check the ntp sync status

 

ntpq -p

 

Regards,

Syed

7 REPLIES
Raoof
Regular Advisor

Re: NTP Client Configuration

Yes, it got duplicated due to my browser issue. I have deleted the previous one.

Bill Hassell
Honored Contributor

Re: NTP Client Configuration

There is no problem in configuring every system with NTP. The cluster time sync is just an additional tweak since the servers will be within a few milliseconds of each other since they are both running NTP.

 

Now before you start xntpd, manually set each server's time to match the Windows box. NTP will not sync at 20 min difference, and will take a long time for 10 minutes (ie, hours) if you slew the time to avoid losing or gaining seconds during a 24 hour period. But most important: Starting xntpd using the start script will JUMP the time, which can have bad consequences for a running database. Never make any time changes manually or with the start/stop rc script while databases and/or apps are running.

 

In your netdaemons file, assign a separate log file like this:

export XNTPD_ARGS="-l /var/adm/xntpd.log"

I would configure NTP on your idle node (ie, no apps or databases running). Start by setting (jumping) the time directly with ntpdate like this:

# ntpdate -b 10.10.whatever
 7 Sep 21:09:11 ntpdate[2866]: step time server 10.11.10.210 offset -0.002836 sec

Pay attention to the response! It should tell you that it was successful or there is a problem. If the local time is way off, manually set the local time with the date command, then run ntpdate again.

 

Once that is working, you can start xntpd using the rc script.

Then check the current xntpd status with ntpq -p

*AND* read the log.

 

 

 



Bill Hassell, sysadmin
Raoof
Regular Advisor

Re: NTP Client Configuration

 

Hi Bill,

 

Thanks a million for the detailed and clear explaination which is really very helpful for the newbies like me.

 

Please need your usual valuable advice for the following steps. I just want to be make sure that the steps and command which i will be following is correct or missing any before i proceed further as i have to take downtime for this task to get accomplish.

 

>>I would configure NTP on your idle node (ie, no apps or databases running).

 

Fyi, oracle database is on two node cluster. So, i have to shutdown the database and stop all the cluster services first before proceeding further

 

>>Now before you start xntpd, manually set each server's time to match the Windows box.

 

 

1)After shutting down the database and all cluster services, will use the below command to set the time manually on two servers to match with Windows NTP Server.


2)#date [-u] [mmddhhmm[[cc]yy]]



3)Then create the configuration file /etc/ntp.conf as below, ( i can create the below files in both servers?, hope it will not give any time errors between the cluster nodes)

server 10.10.xx.xx prefer               #NTP Server IP-Address
fudge 127.127.1.1 stratum 10     # localhost if NTP servers fail
driftfile /etc/ntp.drift

 

4)The configuration of /etc/rc.config.d/netdaemons file as below,


export NTPDATE_SERVER=10.xx.xx.xx   #NTP Server IP Address
export XNTPD=1
export XNTPD_ARGS="-l /var/adm/xntpd.log"

 

5)And running the xntpd daemon manually.

 

# /sbin/init.d xntpd or /sbin/init.d/xntpd start and Wait for the response.

6)Then will check the ntp sync status

# ntpq -p

 

Regards,

Syed

Bill Hassell
Honored Contributor

Re: NTP Client Configuration

For step 1, if both nodes are always running (that is, there is no standby node), then yes, the packages must be shutdown and the cluster halted.

 

Step 2 can also be accomplished the ntpdate command rather than date. This accomplishes two steps:

 

1. It sets the clock exactly to a fraction of second accuracy, and

2. It verifies that the Windows server is providing NTP service for your system.

 

Step 3:

>> i can create the below files in both servers?, hope it will not give any time errors between the cluster nodes

 

There will be no errors between cluster nodes. Copy the same ntp.conf file to both nodes.

 

Step 4 is fine.

 

Step 5: The command to manually start xntpd is:

# /sbin/init.d/xntpd start
 8 Sep 11:33:17 ntpdate[3678]: step time server 10.11.10.210 offset 0.001120 sec

Step 6: ntpq -p will report no sync until at least a minute has elapsed. It will look something like this:

# ntpq -p
     remote           refid      st t when poll reach   delay   offset    disp
==============================================================================
 atl6            129.6.15.28      2 u    1   64    1    0.341    4.784 7937.50
 ignite          97.107.128.58    3 u    -   64    1   60.867   12.321 7937.50
 atl1            .INIT.          16 u    -   64    0    0.000    0.000 16000.0

The columns of interest are:

reach - should be 377 when the connection is stable (may take several minutes)

delay - long delay values (more than 1.0) indicate a slow or unstable connection

offset and disp - 16000 means there is no connection (reach will be 0 too).

 

Here is the same server after about an hour:

# ntpq -p
     remote           refid      st t when poll reach   delay   offset    disp
==============================================================================
*atl6            129.6.15.28      2 u  106  128  377    0.153    0.802   3.232
+ignite          97.107.128.58    3 u   41  128  377   34.458   -1.674   2.041
+atl1            10.11.10.210     3 u   83  128  377    0.287    4.179   5.465

The reach is now 377 for all NTP sources, poll = 128 (secs) between updates and this will grow to 1024 secs (17 mins) for stable network communication. From now on, this server will be within a few milliseconds from the reference.

 

 

 

 



Bill Hassell, sysadmin
Raoof
Regular Advisor

Re: NTP Client Configuration

Thanks!!

 

After running  this command (# /sbin/init.d/xntpd start) how much time i have to wait and look for the status of sync.

 

Once  The reach  value appears as 377 means sysnc between NTP Serve and Client is working correctly?

 

And after completing all the steps does it require restart the servers?

Bill Hassell
Honored Contributor

Re: NTP Client Configuration

>> After running  this command (# /sbin/init.d/xntpd start) how much time i have to wait and look for the status of sync.

 

 Zero time. The clock will be accurate to a fraction of a second after the xntpd script is run.

 

>> Once  The reach  value appears as 377 means sysnc between NTP Serve and Client is working correctly?

 

The reach value is a count of the number of times the NTP server was contacted successfully. 377 is the largest value, but is not an indication of accuracy, just how regularly the server haas been successfully contacted. The poll value starts at 64 seconds and will slow down as the reliability and stability of the remote servers is evaluated. The maximum is 1024 and indicates excellent sync.

 

However, these metrics are documenting extremely small time differences (milliseconds).

To check each server's time, type the command: date then compare that value with your phone or the Windows server.

 

>> And after completing all the steps does it require restart the servers?

 

No. NTP sync is instantaneous once the xntpd script is run successfully.

 



Bill Hassell, sysadmin
Raoof
Regular Advisor

Re: NTP Client Configuration

Hi Bill,

 

Thanks a billion for such a wonderful and clear information. 

 

Will come back to you for further assitance if require after configuring the NTP Client.

 

Thanks again...

 

Best Regards,

Syed