** This is applicable in Linux environment (red hat , Centos , Amazon linux ..etc) .
Why ?
Having
different time in each server/client in same environment will lead you with
issue in your platform , thus; you will need to configure NTP services in all
your server to sync the time via network from same source .
How ?
To
setup NTP server we use chronyd service as below :
1- make sure chronyd is started and enabled :
systemctl status chronyd
2- if it is not started and enabled use :
systemctl enable --now chronyd
check
the status to make sure it is working properly
you
can use as well to check all setting : timedatectl
3- Edit the /etc/chrony.conf
:
vim /etc/chrony.conf
4- line "pool 2.rhel.pool.ntp.org iburst" , make it
with comment to be
" #pool
2.rhel.pool.ntp.org iburst"
5- now add your ntp server
:
server ntp.example.com iburst
where
ntp.example.com is ntp server , or ip can be instead of url
6- to check it is work use "
:
chronyc sources -v
or use :
timedatectl