Ntp: Difference between revisions

From CLONWiki
Jump to navigation Jump to search
Boiarino (talk | contribs)
No edit summary
Boiarino (talk | contribs)
No edit summary
Line 53: Line 53:




#Linux========================================================================
'''Linux'''


1. Create file /etc/ntp.conf
1. Login as 'root'


2. /etc/init.d/ntpd start
2. Modify file /etc/ntp.conf:


Starting ntpd:                                             [  OK  ]
3. Start daemon:


3. /etc/init.d/ntpd status
  /etc/init.d/ntpd start
    Starting ntpd:                                            [  OK  ]


ntpd (pid 15598) is running...
4. Check if it is running:


4. ntpq -p
  /etc/init.d/ntpd status
    ntpd (pid 15598) is running...
 
5. ntpq -p


     remote          refid      st t when poll reach  delay  offset  jitter
     remote          refid      st t when poll reach  delay  offset  jitter
Line 72: Line 76:
  ccs1.jlab.org  192.43.244.18    2 u  50  64    7    0.522  35138.7  1.351
  ccs1.jlab.org  192.43.244.18    2 u  50  64    7    0.522  35138.7  1.351


5. To start service at boot:
6. To start service at boot:


#
#

Revision as of 17:39, 2 February 2007

NTP is Network Time Protocol. It exists on both Solaris and Linux but is not started by default so it must be started using following procedure:

Solaris

1. login as 'root'

2. Create file /etc/inet/ntp.conf, or copy from another Solaris machine:

 # peer host_address [ key # ] [ version # ] [ minpoll interval ] [prefer]
 # server host_address [ key # ] [ version # ] [ minpoll interval ] [prefer]
 # broadcast host_address [ key # ] [ version # ] [ minpoll interval ]
 # driftfile filename
 # broadcast yes|no
 # broadcastdelay seconds
 # authenticate yes|no
 # authdelay seconds
 # keys filename
 # trustedkey # [ # ... ]
 # controlkey #
 # restrict address [ mask numeric_mask ] [ flag ] [ ... ]
 # statsdir /directory/[ prefix ]
 # statistics names
 # filegen name [ file filename ] [ type typename ] [ link|nolink ] [enable|disable ]
 # enabled/disabled
 # link/nolink
 # keyno  type  key
 #
 ####################
 #
 # JLAB time servers
 server ntp1.jlab.org  version 3  prefer  # stratum 2, Ver 3
 server ntp2.jlab.org  version 3          # stratum 2, Ver 3
 #
 #
 driftfile /etc/inet/ntp.drift

3. Start the xntp daemon:

 svcadm enable network/ntp

4. Check if it is running:

 svcs | grep ntp
   online         16:29:30 svc:/network/ntp:default

5. Make query to make sure everything is Ok:

 ntpq -p
        remote           refid      st t when poll reach   delay   offset    disp
   ==============================================================================
   *ns1.jlab.org    time.nist.gov    2 u   27   64   77     0.46   -1.440  387.54
   +ccs1.jlab.org   time.nist.gov    2 u   27   64   77     0.43    1.798  386.89


Linux

1. Login as 'root'

2. Modify file /etc/ntp.conf:

3. Start daemon:

 /etc/init.d/ntpd start
   Starting ntpd:                                             [  OK  ]

4. Check if it is running:

 /etc/init.d/ntpd status
   ntpd (pid 15598) is running...

5. ntpq -p

    remote           refid      st t when poll reach   delay   offset  jitter
==================================================================
ns1.jlab.org    192.43.244.18    2 u   57   64    7    0.245  35139.8   1.521
ccs1.jlab.org   192.43.244.18    2 u   50   64    7    0.522  35138.7   1.351

6. To start service at boot:

      1. chkconfig --add ntpd (normally linux has it already)

chkconfig --level 3 ntpd on chkconfig --level 4 ntpd on chkconfig --level 5 ntpd on chkconfig --list ntpd (last command prints: ntpd 0:off 1:off 2:off 3:on 4:on 5:on 6:off)