> Thanks. That is correct - I was looking for Sun specific implementation (as
> I am new to Solaris) synchronizing with a reference clock and a common queue
> of events that can be accessed by all peer servers in the network. For
> instance, does it use any specific algorithm such as Lamport's for clock
> synchronization?
>

 I do not know if I can help you with the algorithms.  I think that the
source is open and you can go look at it for that sort of detail.

If you want NTP to work in your network then you need some stratum 1 or
stratum 2 time sources or a locally attached radio clock.  Unless you happen
to know all the details of setting up and then maintaining your own cesium
based atomic clock then I suggest that you locate some time sources near
you.  Please check with your local universities as they generally have an
NTP server.  Also, your country should have a stratum 1 level time source
also.

So locate three sources and get their ip addresses or host names.

Then create an ntp.conf that looks like so :

$ cat /etc/inet/ntp.conf
server time.server.number.one
server time.server.number.two
server time.server.number.three
driftfile /etc/inet/ntp.drift
statsdir /var/ntp/ntpstats/
filegen peerstats file peerstats type day enable
filegen loopstats file loopstats type day enable
filegen clockstats file clockstats type day enable
logconfig =syncevents +peerevents +sysevents +allclock

The start the NTP service with svcadm.

$ svcs -av | grep ntp
online         -             Mar_02       36 svc:/network/ntp:default

After a little time you will begin to get NTP data flowing in and your
server will self adjust to become ever more accurate and then keep itself
there.

$ /usr/sbin/ntpq -c rl
status=0654 leap_none, sync_ntp, 5 events, event_peer/strat_chg
system="SunOS", leap=00, stratum=3, rootdelay=25.92,
rootdispersion=102.08, peer=10660, refid=time1.chu.nrc.ca,
reftime=c996e92d.4826b000  Mon, Mar  5 2007 14:08:29.281, poll=10,
clock=c996eb95.1f9eb000  Mon, Mar  5 2007 14:18:45.123, phase=-12.839,
freq=-625.76, error=41.99

$ /usr/sbin/ntpq -pn
     remote           refid      st t when poll reach   delay   offset    disp
==============================================================================
*209.87.233.53   209.87.233.51    2 u  620 1024  377    24.43  -26.910    7.37
+128.100.100.128 128.100.96.226   2 u  530 1024  357    72.72   -2.350   12.15
+128.100.56.135  128.100.96.226   2 u  922 1024  377    65.95  -11.023   13.52
$

Then, other machines in your network can get time data from your first
server.  Just create an ntp.conf thus :

$ cat /etc/inet/ntp.conf
server my.time.server.host
driftfile /etc/inet/ntp.drift
statsdir /var/ntp/ntpstats/
filegen peerstats file peerstats type day enable
filegen loopstats file loopstats type day enable
filegen clockstats file clockstats type day enable
logconfig =syncevents +peerevents +sysevents +allclock

then start ntp services.

$ /usr/sbin/ntpq -c rl
status=0644 leap_none, sync_ntp, 4 events, event_peer/strat_chg
system="SunOS", leap=00, stratum=4, rootdelay=26.40,
rootdispersion=120.70, peer=3540, refid=my.time.server.host,
reftime=c996ec1e.77775000  Mon, Mar  5 2007 14:21:02.466, poll=6,
clock=c996ec28.23157000  Mon, Mar  5 2007 14:21:12.137, phase=2.623,
freq=10100.77, error=0.98

You can do this with a stack of servers.

If you feel so inclined you can drag a fair amount of data out of that stats
information collected.

see http://www.blastwave.org/ntpstats/index.html

Dennis
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to