Chrony is a service for keeping your servers time in sync, similar to NTPd, see https://chrony.tuxfamily.org/ for more.
– Chrony provides another implementation of NTP.
– Chrony is designed for systems that are often powered down or disconnected from the network.
– The main configuration file is /etc/chrony.conf.
– Parameters are similar to those in the /etc/ntp.conf file.
– chronyd is the daemon that runs in user space.
– chronyc is a command-line program that provides a command prompt and a number of commands. Examples:
tracking: Displays system time information
sources: Displays information about current sources.
Steps to deploy chronyd on the 1+3 node cluster with CentOS7 as operating system on each node:
- Our cluster has 1+3 nodes, named master, slave1, slave2, slave3 with following DHCP assigned IPs.
2. On master node (controller node – where ansible is installed), install ansible and configure chronyd with below conf file configuration. (ansible installation steps source : https://unixcop.com/ansible-installation-configuration-on-centos-7-8/)
In master Under /etc
#start of chronyd.conf : source – https://www.ibm.com/docs/en/db2/11.5?topic=servers-setting-up-network-time-protocol
server 127.xxx.x.x # This is the IP of our Lab NTP server
local stratum 10
#end of chronyd.conf
In slave nodes under /etc
#start of chronyd.conf-slaves
server <master node IP 10.xx.0.xx> iburst prefer
#end of chronyd.conf-slaves
3. make copy of abovechronyd.conf-slaves file as /home/chrony.conf.j2 or under any path where ansible playbook is run.
4. ansible configuration of yml for chronyd is created as below :
“chrony-config.yml”: source – https://www.redhat.com/sysadmin/ansible-chrony-daemon
Under /home, execute below command:
Now manually sync the time on each node including master as shown below:
timedatectl set-time “2021-11-17 11:53:59” –> my current time IST – run this command on master and slave nodes simultaneously (I used moba-xterm multi execution mode for this).
Above command is used to set the time manually from the approximate LOCAL time got from the wall clock, your phone, the Internet etc
Now restart the chronyd service on all nodes inclusing master
Once above is completed verified chronyd status as shown below:
Hence you can see using ansible chronyd configuration and few commands we have time synced across the cluster nodes. The time is set to 2021-11-17 13:18:38 IST on all nodes including the master node.
So now i can proceed with spark cluster configuration on this cluster!! Once i am done with it, i will post the link to the same.