guide:Os/ntp

From Dgiref
Jump to: navigation, search

WARNING: Time synchronization
A common source of errors in the establishment of the grid environments is the incorrect or inadequate time synchronization of the participating systems. The common time on the clocks, however, is a necessary prerequisite for the smooth communication between the middleware components, particularly for the Grid Security Infrastructure (GSI). It is recommended that all systems start the NTP daemon (ntpd) or at least call regularly ntpdate cronjob. The ntpd or ntpdate should be configure to synchronize the machine's system clock with any known organization with the appropriate time-server or via the competent computer center (or institution).

  1.  
  2. #!/bin/sh
  3. # NTP configuration
  4. yum install ntp
  5.  
  6. # Configure and start NTP daemon on server machines:
  7. cat << EOF >> /etc/ntp.conf 
  8. #restrict <time_server_IP_address> mask 255.255.255.255 nomodify notrap noquery
  9. #server <time_server_name>
  10. server timehost.domain burst iburst
  11.  
  12. EOF
  13.  
  14. ## Edit the file /etc/ntp/step-tickers 
  15.  
  16. # adding a list of your time server(s) host name(s)
  17. # ELECTIVE!
  18. # cat << EOF >> /etc/ntp/step-tickers
  19. #  <time_server_IP_address> 
  20. # EOF
  21.  
  22. ## allow inbound communication on the NTP port 
  23. cat << EOF >> /etc/sysconfig/iptables 
  24.  -A INPUT -s NTP-serverIP-1 -p udp --dport 123 -j ACCEPT 
  25.  -A INPUT -s NTP-serverIP-2 -p udp --dport 123 -j ACCEPT
  26.  
  27. EOF
  28.  
  29. /etc/init.d/iptables restart
  30.  
  31. ## Activate the ntpd service with the following commands: 
  32.  
  33. ntpdate <your ntp server name>
  34. service ntpd start
  35. chkconfig ntpd on
  36.  
  37.  
  38. ## check ntpd's status by running 
  39.  
  40. ntpq -p
  download administrator's script: ntp.sh
Personal tools