In this section, we will install and configure NTP on Ubuntu and CentOS/Red Hat.
First, we will look at the steps to install and configure NTP on Ubuntu. Ubuntu comes preinstalled with ntpdate
, and this service runs automatically and updates time data at system startup. If we need a more frequent update, we can set up a cron job for the same. For this, we can create a script file such as updateTimeDate.sh
and include the following lines:
#!bin/sh ntpdate ntp.ubuntu.com
Set this as a crontab
job to update the system date more frequently, keep in mind that this file must be the same, and note that the frequency of crontab
must be the same for all the nodes in the cluster.
We can use the sudontpq –np
command to check if the NTP service is running properly.
It can also be installed using the following commands, if it is not already installed:
sudo aptitude update sudo aptitude install ntp
On CentOS or Red Hat, we...