Operating System - HP-UX
1819804 Members
2876 Online
109607 Solutions
New Discussion юеВ

how to setup ntp server for serviceguard

 
Rajesh Karelia
Frequent Advisor

how to setup ntp server for serviceguard

Hi,

I am using 2 node cluster using Serviceguard as Oracle database server. The time of the nodes should be synchronised for this purpose.

Can someone pls let me know what are the steps to do this.

Our organisation uses lon.bt.co.uk as ntp server.

Thanks,
Rajesh
15 REPLIES 15
melvyn burnard
Honored Contributor

Re: how to setup ntp server for serviceguard

Just set each server up to use these timeservers, assuming they can be reached directly.
Use SAM if needed to make it easier.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Rajesh Karelia
Frequent Advisor

Re: how to setup ntp server for serviceguard

Hi,

I wouldnt like to use SAM for this purpose.
Would be great if you can give me all the commands and files reqd to be changed.

The time server is as mentioned: lon.bt.co.uk.

Thanks
Rajesh
BPatrick
Trusted Contributor

Re: how to setup ntp server for serviceguard

Hi Rajesh,
Follow these steps and setup ntp on both server.
1. stop the xntp service daemon if it is running.
2.create ntp.conf file if it does not exist in /etc
3. Update the ntp.conf file with the ntp server name
4. change the parametes in /etc/rc.config.d/netdaemons
update NTP server address
set XNTPD=1 so the daemon will be restarted automaticall if it stops. Also create a log file and specify it int eh XNTPD args.
5. Restart your server.


Regards
Patrick

BPatrick
Trusted Contributor

Re: how to setup ntp server for serviceguard

Rajesh
Here is the commands you need to run
1) Check if the xntp daemon is running: ps -ef | grep ntp
2) If xntp daemon is running, kill this process by kill -9 pid
3) Check if the file /etc/ntp.conf exists.
a) If the file exists execute: cp /etc/ntp.conf /etc/ntp.conf.orig
b) If the file does not exist then run: touch /etc/ntp.conf
4) Update the content of /etc/ntp.conf
5) Change parameters in /etc/rc.config.d/netdaemens, so that the parameters are loaded on boot time
NTPDATE_SERVER = lon.bt.co.uk
XNTPD = 1
XNTPD_ARGS= ''-l /etc/ntp.log''
6)Create an empty log file
touch /etc/ntp.log
7)Start the xntpd daemon
xntpd -c /etc/ntpd.conf -l /etc/ntp.log

Regards
Patrick
Rajesh Karelia
Frequent Advisor

Re: how to setup ntp server for serviceguard

1. xntp process is not present.

2. vi /etc/ntp.conf
add line -
server lon.bt.co.uk

3. Run command
# ntpdate

4. vi /etc/rc.config.d/netdaemons
export NTPDATE_SERVER=lon.bt.co.uk
export XNTPD=1

5. Restart xntpd
# /sbin/init.d/xntpd stop
# /sbin/init.d/xntpd start

6. Check the time
# ntpq -p

7. Wait for 25 mins...
# ntpq -c rv


Are these commands good enough to configure NTP client on our nodes?

Do I need to edit inetd.conf and
i) write -i before -f for hacl_prob entry
ii) write -i after -c for hacl_cfg entry
...????

Thanks
Rajesh
BPatrick
Trusted Contributor

Re: how to setup ntp server for serviceguard

Rajesh,

You need not make any changes to the inetd.conf

Regards

Patrick
Bill Hassell
Honored Contributor

Re: how to setup ntp server for serviceguard

Before you change anything, mkake sure you can actually reach the NTP server:

ntpq -p lon.bt.co.uk

It must report back the sources of NTP sync for that server. If it times out or fails to connect, you must resolve that problems first. NOTE: Do not use a single external server. You should pick at least 3 to 5 servers. Look at the website: www.ntp.org


Bill Hassell, sysadmin
Michael Steele_2
Honored Contributor

Re: how to setup ntp server for serviceguard

Bon Jour Rajesh:

Regarding: Are these commands good enough to configure NTP client on our nodes?

I would not use a service guard node as the NTP server, only as clients. That way they'll be sync'd up all the time to a server outside of the cluster. ntp should be operated on a continuous basis. If it is necessary to stop xntpd, the interval when it is not running should be kept to a minimum.

For clients, you don't need to fool with the ntp.conf file. And you sequence is a liitle out of order.

1 xntp stop
2 netdaemons
export NTPDATE_SERVER=hostname
export XNTPD=1
3 ntpdate hostname
4 xntp start
5 5-8 minutes, (* let me know how long it takes*)
6 ntpq -c rv
7 ntpq -p

ntp.conf only gets updated on the ntp server, outside your serviceguard cluster.

Here's a little too much information about ntp. ( don't get confused about internet time servers. Interesting but not realistic in todays world of hackers. You can try to get more then one ntp server up. perhaps with a radio receiver.)

http://www.docs.hp.com/en/B2355-90685/ch07.html
Support Fatherhood - Stop Family Law
Rajesh Karelia
Frequent Advisor

Re: how to setup ntp server for serviceguard


How to stop and start xntpd deamon from command prompt?

Rajesh
Rajesh Karelia
Frequent Advisor

Re: how to setup ntp server for serviceguard

When I do ntpq -p:

# ntpq -p lon.bt.co.uk
w.x.y.z: timed out, nothing received
***Request timed out
#

When i give the Ip for server name:

# ntpq -p w.x.y.z
w.x.y.z: timed out, nothing received
***Request timed out
#



I have Edited inetd.conf file:
i) write -i before -f for hacl_prob entry
ii) write -i after -c for hacl_cfg entry (last line)
iii) inetd -c

Whats going wrong here?
melvyn burnard
Honored Contributor

Re: how to setup ntp server for serviceguard

Firstly do:
man xntp

second:
# ntpq -p lon.bt.co.uk
w.x.y.z: timed out, nothing received
***Request timed out
# Does the above resolve when you do nslookup lon.bt.co.uk ?

When i give the Ip for server name:

# ntpq -p w.x.y.z
w.x.y.z: timed out, nothing received
***Request timed out
#Does the above resolve when you do nslookup w.x.y.z ?



I have Edited inetd.conf file:
i) write -i before -f for hacl_prob entry
ii) write -i after -c for hacl_cfg entry (last line)
iii) inetd -c

WHY???
This is not required at all
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
BPatrick
Trusted Contributor

Re: how to setup ntp server for serviceguard

Rajesh

Try run ntpq in debug mode.
first run ntpq -i to run ntpq in interactive mode and enter the following commands

ntpq> host lon.bt.co.uk
ntpq> debug more
ntpq> peers

Also check if your firewall is blocking port 123

Regards
Patrick
Rajesh Karelia
Frequent Advisor

Re: how to setup ntp server for serviceguard

hi all, I have done the foll steps for ntp client on my nodes:

1) Check if the xntp daemon is running:
# ps -ef | grep ntp

2) If xntp daemon is running, kill this process by
# kill -9 pid

3) Check if the file /etc/ntp.conf exists.
# ll /etc/ntp.conf

4) If the file exists execute:
# cp /etc/ntp.conf /etc/ntp.conf.orig

5) If the file does not exist then run:
# touch /etc/ntp.conf

6) Update the content of /etc/ntp.conf
#vi /etc/ntp.conf
Add line -
server
eg,
server lon.bt.co.uk

7) Change parameters in /etc/rc.config.d/netdaemons, so that the parameters are loaded on

boot time
NTPDATE_SERVER=lon.bt.co.uk
XNTPD=1
XNTPD_ARGS="-l /etc/ntp.log"

8) Create an empty log file:
# touch /etc/ntp.log


9) Edit inetd.conf file:
i) write -i before -f for hacl_prob entry
ii) write -i after -c for hacl_cfg entry (last line)
iii) inetd -c

10) Start the xntpd daemon
# xntpd -c /etc/ntpd.conf -l /etc/ntp.log


11) Check that ntp server is reachable. It must report back the sources of NTP sync for that server. If it times out or fails to connect, you must resolve that problems first. NOTE: Do not use a single external server. You should pick at least 3 to 5 servers. Look at the website: www.ntp.org

# ntpq -p lon.bt.co.uk

This command gives:
# ntpq -p lon.bt.co.uk
time.lon.bt.com: timed out, nothing received
***Request timed out


I dont know this is right or wrong.
Is ntp client is running now and it has synchronised with the ntp server lon.bt.co.uk?
how to check it out?

Thanks.
TKeller
Frequent Advisor

Re: how to setup ntp server for serviceguard

The above advice for setting up ntp.conf is definitely the official way to correctly synchronize but if you're looking for another way, here's one.

1: create a simple script called something like /scripts/time.sh with the following in it:

/usr/sbin/ntpdate lon.bt.co.uk 1>/dev/null

2: add that script to root's crontab with something like this:

30 * * * * /scripts/time.sh

Now, ntpdate will run every hour on the 30 minute mark and keep everything synchronized. Keep in mind, ntpdate is only good for small time changes whereas ntpd can make large time changes over a period of time.
It is said you should treat your body like a temple. I treat mine like an amusement park.
Bill Hassell
Honored Contributor

Re: how to setup ntp server for serviceguard

The ntpdate cron job is definitely not recommended for production machines because it guarentees the time will 'jump' forward or (worse) backwards. You do not want any loss or gain of time ticks per day. The ntpq command indicates that you cannot reach the ntp server at all, so all the above is useless until you are able to query an NTP server. You must contact your network department to have them open port 123 on the firewall so your system can reach the NTP server(s). Alternatively, have your network department set up an NTP server on your firewall, get it synced and then point your HP-UX server to the NTP port on the firewall. ntpq -p fire-wall-IP
will now work OK.


Bill Hassell, sysadmin