2010. 9. 9. 17:58

ntp client 설정하

fedora 8/UNIX 에서 ntp client 설정을 하기 위한 설명이다.


[ index ]

  [ reference ]

  [ intall overview ]

  [ 기타 정보들 ]

  [ how to run ntp client at UNIX ]


[ reference ]
o 아래 링크 참조하면 거의 모든 설명 되어 있다.
   http://annyung.oops.org/?m=white&p=ntp
o 좀더 자세한 정보는 아래에서 ...
  http://www.akadia.com/services/ntp_synchronize.html
  http://www.eecis.udel.edu/~mills/ntp/html/ntpd.html#opt

[ intall overview ]

o ntp server 가 어떤게 있는지 알아 놓는다.

 * startum 1

   http://support.ntp.org/bin/view/Servers/StratumOneTimeServers
    ntp.xbsd.kr

* stratum 2 list

time.bora.net
ntp.ewha.net
ticktock.ewha.net
ntp1.epidc.co.kr
ntp2.epidc.co.kr
time.bora.net
time.korserve.net
t2.korserve.net
rokkorclub.net
time.wonkwang.ac.kr
noc6-3.koren21.net


o ntp 정보를 받을 host(ntp client)의 /etc/ntp.conf 를 다음과 같이 수정을 한다.

server time.bora.net # server 정보

# server 정보외 다양한 설정 정보가 있지만 위 정보만 넣으면 일단 가능


o ntpd 데몬을 실행시킨다.

service ntpd restart 명령으로 ntpd 를 시작 하고,


o ntpq -p 명령으로 시간정보가 제대로 들어오는지 확인한다.
-------------------------------------------------------------------------------
remote 는 sync 를 하는 straum 2 서버 주소이다.
refid 는 각 straum 2 서버가 현재 sync 를 하고 있는 straum 1 서버를 보여준다.
st 는 각 라인의 remote 들의 straum 을 나타낸다.
* 는 현재 sync 를 받고 있음을 의미한다.
+ ntp 알고리즘에 의해 접속은 가능하지만 sync 를 하고 있지는 않음을 의미
- ntp 알고리즘에 의해 접속은 가능하지만 sync 가능 리스트에서 제외
blank 는 접속이 불가능함을 의미한다.

st 가 16 이 나올 경우는, 해당 서버에 접속을 할 수 없음이다.

[ 기타 정보들 ]
/etc/ntp.conf 파일 설정 관련 정보
server <ip address>
fudge # server local_ip 명령과 함께 ntp서버 접속이 안될때 local clock을 참조하여ntp server 로서 동작할수 있도록 한다.
peer # server-client 동작이 아니라 서로 시각정보를 줄수 있는 동등한 지위가 된다.
drift 파일 # offset시간을 파일에 넣어두고 ntpd가 restart할때 참조하여 조금 더 빨리 sync가 될수 있도록 한다.
- ntpq -p 했을때 "Name or service not known" 메시지 뜨면 /etc/hosts밑에 localhost(127.0.0.1) 있어야 한다.


[ how to run ntp client at UNIX ]
1. config file create
mv -f /etc/inet/ntp.conf /etc/inet/ntp.conf.org
echo "server ntp.ewha.net" > /etc/inet/ntp.conf /* 서버 IP를 설정해준다.
2. run xntp
/etc/init.d/xntpd start
3. check "the xntpd daemon is right?"
일단 xntpd 를 실행한 후나 혹은 시스템 재시동 후 약 5분 정도가 지난 후에>는 ntpq -p 라는 명령어로 현재 NTP 서버로부터 제대로 시각에 관한 정보를 받고 있는
지를 확인할 수 있습니다. (좀더 자세한 설명이 필요하면 아래 참조)
remote refid st t when poll reach delay offset disp
===================================================================
*gps.bora.net .GPS. 1 u 33 34 377 11.99 11.468 1.14
4. NTP 서버와 시간을 맞추는 프로그램인 xntpd 프로그램을 실행합니다. 이후에는 서>버를 재시동하더라도 자동 으로 이 프로그램을 실행하게 됩니다.

5. 설치 파일 및 도움말





[ What is Stratum 1? ]

http://www.endruntechnologies.com/stratum1.htm

The basic definition of a stratum-1 time server is that it be directly linked (not over a network path) to a reliable source of UTC time such as GPS, WWV, or CDMA transmissions. A stratum-1 time server acts as a primary network time standard.

A stratum-2 server is connected to the stratum-1 server OVER A NETWORK PATH. Thus, a stratum-2 server gets its time via NTP packet requests from a stratum-1 server. A stratum-3 server gets its time via NTP packet requests from a stratum-2 server, and so on.