RHCSA Rapid Track
In this lab, students will adjust the timezone on a system and synchronize the hardware clock with a NTP time source.
Outcomes
Students will configure the serverX system to use the time zone appropriate for Haiti
and configure chronyd on serverX to use the NTP
server running on classroom.example.com as time source.
Your serverX machine has been relocated to Haiti. Change the time zone on the serverX machine appropriate for Haiti and verify the time zone has been changed properly.
Identify the correct time zone for Haiti on serverX.
[root@serverX ~]#tzselectPlease identify a location so that time zone rules can be set correctly. Please select a continent or ocean. 1) Africa 2) Americas 3) Antarctica 4) Arctic Ocean 5) Asia 6) Atlantic Ocean 7) Australia 8) Europe 9) Indian Ocean 10) Pacific Ocean 11) none - I want to specify the time zone using the Posix TZ format.#?2Please select a country. 1) Anguilla 28) Haiti 2) Antigua & Barbuda 29) Honduras 3) Argentina 30) Jamaica 4) Aruba 31) Martinique 5) Bahamas 32) Mexico 6) Barbados 33) Montserrat ... output omitted ... 26) Guatemala 53) Virgin Islands (US) 27) Guyana#?28The following information has been given: Haiti Therefore TZ='America/Port-au-Prince' will be used. Local time is now: Thu Nov 20 11:07:46 EST 2014. Universal Time is now: Thu Nov 20 16:07:46 UTC 2014. Is the above information OK? 1) Yes 2) No#?1You can make this change permanent for yourself by appending the line TZ='America/Port-au-Prince'; export TZ to the file '.profile' in your home directory; then log out and log in again. Here is that TZ value again, this time on standard output so that you can use the /usr/bin/tzselect command in shell scripts: America/Port-au-PrinceChange the time zone to America/Port-au-Prince on serverX.
[root@serverX ~]#timedatectl set-timezone America/Port-au-PrinceVerify the time zone has been properly set on serverX.
[root@serverX ~]#timedatectlLocal time: Wed 2014-11-20 11:09:00 EST Universal time: Wed 2014-11-20 16:09:00 UTC RTC time: Wed 2014-11-20 16:09:00 Timezone: America/Port-au-Prince (EST, -0500) NTP enabled: yes NTP synchronized: no RTC in local TZ: no DST active: no Last DST change: DST ended at Sun 2014-11-02 01:59:59 EDT Sun 2014-11-02 01:00:00 EST Next DST change: DST begins (the clock jumps one hour forward) at Sun 2015-03-08 01:59:59 EST Sun 2015-03-08 03:00:00 EDT
Enable
NTPsynchronization on the serverX system and use classroom.example.com as time source.Configure chronyd to synchronize the time on serverX with classroom.example.com. Edit
/etc/chrony.confto resemble the following configuration file excerpt:# Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). # server 0.rhel.pool.ntp.org iburst # server 1.rhel.pool.ntp.org iburst # server 2.rhel.pool.ntp.org iburst # server 3.rhel.pool.ntp.org iburst server classroom.example.com iburst ...
Restart the chronyd service on serverX.
[root@serverX ~]#systemctl restart chronydTurn on
NTPsynchronization on serverX if it is not already turned on.[root@serverX ~]#timedatectl set-ntp true
Verify the serverX system has its clock synchronized with classroom.example.com by using
NTP.Verify the hardware clock on serverX was synchronized with
NTP.[root@serverX ~]#timedatectl... NTP synchronized: yes ...Verify that the classroom.example.com system is used as time source for synchronizing the clock on serverX.
[root@serverX ~]#chronyc sources -v210 Number of sources = 1 .-- Source mode '^' = server, '=' = peer, '#' = local clock. / .- Source state '*' = current synced, '+' = combined , '-' = not combined, | / '?' = unreachable, 'x' = time may be in error, '~' = time too variable. || .- xxxx [ yyyy ] +/- zzzz || / xxxx = adjusted offset, || Log2(Polling interval) -. | yyyy = measured offset, || \ | zzzz = estimated error. || | | MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^* classroom.example.com 8 6 37 51 -25ns[-703us] +/- 128us