Part-2:

Part-2: NTP Server & Client settings.

 

2.1 : Install ntp package using yum

[root@loadb1 ~]# ssh ntp
[root@ntp ~]# yum install -y ntp
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * base: ftp.cc.uoc.gr
 * extras: ftp.cc.uoc.gr
 * updates: ftp.cc.uoc.gr
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ntp.i686 0:4.2.4p8-2.el6.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================
 Package                            Arch                                Version                                              Repository                           Size
=======================================================================================================================================================================
Installing:
 ntp                                i686                                4.2.4p8-2.el6.centos                                 base                                436 k

Transaction Summary
=======================================================================================================================================================================
Install       1 Package(s)

Total download size: 436 k
Installed size: 1.1 M
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 436 k
ntp-4.2.4p8-2.el6.centos.i686.rpm                                                                                                               | 436 kB     00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : ntp-4.2.4p8-2.el6.centos.i686                                                                                                                       1/1
Installed:
  ntp.i686 0:4.2.4p8-2.el6.centos
Complete!

2.2 : Edit /etc/ntp.conf file for server’s configurations.

[root@ntp ~]# vi /etc/ntp.conf

# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

driftfile /var/lib/ntp/drift

# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
#restrict default kod nomodify notrap nopeer noquery
#restrict -6 default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1 # BroExperts NTP Server
#restrict -6 ::1

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).

#server 0.centos.pool.ntp.org
#server 1.centos.pool.ntp.org
#server 2.centos.pool.ntp.org

#broadcast 192.168.1.255 autokey        # broadcast server
#broadcastclient                        # broadcast client
#broadcast 224.0.1.1 autokey            # multicast server
#multicastclient 224.0.1.1              # multicast client
#manycastserver 239.255.254.254         # manycast server
#manycastclient 239.255.254.254 autokey # manycast client

# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
server  127.127.1.0     # local clock # BroExperts NTP Server
#fudge  127.127.1.0 stratum 10

# Enable public key cryptography.
#crypto

includefile /etc/ntp/crypto/pw

# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys

# Specify the key identifiers which are trusted.
#trustedkey 4 8 42

# Specify the key identifier to use with the ntpdc utility.
#requestkey 8

# Specify the key identifier to use with the ntpq utility.
#controlkey 8

# Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats

2.3 : start ntpd service and make it available on startup.

[root@ntp ~]# service ntpd start && chkconfig ntpd on
Starting ntpd:                                             [  OK  ]

2.4 : verify your server. ( * ) is sign of your server working fine it will take sometime to appear.

[root@ntp ~]# watch ntpq -p -n
Every 2.0s: ntpq -p -n                                                                   wed Jun 6 15:46:32 2012

   romote         refid        st  t when poll reach    delay offset jitter
===============================================================================
*127.127.1.0      .LOCL.      5  l  -   2  64   377   0.000 0.000

2.5 : Clients Settings.

yum -y install ntp

2.6 : edit /etc/ntp.conf

 

[root@loadb1 ~]# vi /etc/ntp.conf
driftfile /var/lib/ntp/drift

# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
#restrict 127.0.0.1
#restrict -6 ::1

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.centos.pool.ntp.org
#server 1.centos.pool.ntp.org
#server 2.centos.pool.ntp.org

server 192.168.2.31

#broadcast 192.168.1.255 autokey        # broadcast server
#broadcastclient                        # broadcast client
#broadcast 224.0.1.1 autokey            # multicast server
#multicastclient 224.0.1.1              # multicast client
#manycastserver 239.255.254.254         # manycast server
#manycastclient 239.255.254.254 autokey # manycast client

# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
#server 127.127.1.0     # local clock
#fudge  127.127.1.0 stratum 10

# Enable public key cryptography.
#crypto

includefile /etc/ntp/crypto/pw

# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys

# Specify the key identifiers which are trusted.
#trustedkey 4 8 42

# Specify the key identifier to use with the ntpdc utility.
#requestkey 8

# Specify the key identifier to use with the ntpq utility.
#controlkey 8

# Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats

2.7 : start ntpd service and make it available on startup.

[root@loadb1 ~]# service ntpd start && chkconfig ntpd on
Starting ntpd:                                             [  OK  ]

2.8 : Copy this file to all other clients using scp

[root@loadb1 ~]# scp /etc/ntp.conf loadb2:/etc/
ntp.conf                                  100% 1950     1.9KB/s   00:00
[root@loadb1 ~]# scp /etc/ntp.conf websrv1:/etc/
ntp.conf                                  100% 1950     1.9KB/s   00:00
[root@loadb1 ~]# scp /etc/ntp.conf websrv2:/etc/
ntp.conf                                  100% 1950     1.9KB/s   00:00
[root@loadb1 ~]# scp /etc/ntp.conf dbase1:/etc/
ntp.conf                                  100% 1950     1.9KB/s   00:00
[root@loadb1 ~]# scp /etc/ntp.conf dbase2:/etc/
ntp.conf                                  100% 1950     1.9KB/s   00:00
[root@loadb1 ~]# scp /etc/ntp.conf dns:/etc/
ntp.conf                                  100% 1950     1.9KB/s   00:00

2.9 : Run this command on all clients

service ntpd start && chkconfig ntpd on

2.10 : sync your time with your ntp server on all clients

[root@loadb1 ~]# ntpdate -u 192.168.2.31
 6 Jun 13:06:26 ntpdate[10904]: adjust time server 192.168.2.31 offset -0.000111 sec

 

Part-3: Bind Server Installation + configurations.