📌 Task Description
In the daily standup, it was noted that the timezone settings across the Nautilus Application Servers in the Stratos Datacenter are inconsistent with the local datacenter's timezone, currently set to America/Jamaica. Consistent timezone configuration is critical for accurate log timestamps, scheduled tasks (cron jobs), and application time-based operations. The timedatectl command provides a modern systemd-based interface for managing system time and timezone settings.
👉 Task Requirements:
- Target Servers: All App Servers (stapp01, stapp02, stapp03) in Stratos Datacenter
- Target Timezone:
America/Jamaica - Current State: Inconsistent timezone settings across servers
- Operation Objectives:
- Set timezone to America/Jamaica on all app servers
- Use
timedatectlfor timezone configuration - Verify timezone change on each server
- Ensure consistency across all servers
- Synchronize timezone settings across infrastructure
- Maintain accurate time for logging and scheduling
- Verify configuration persistence
💡 Note: Server credentials and infrastructure details are available via the Details of all Users and Servers button in the KodeKloud lab interface.
ssh tony@stapp01Purpose: Establish SSH connection to App Server 1 for timezone configuration.
Expected Output:
tony@stapp01's password:
Welcome to App Server 1 - Stratos Datacenter
[tony@stapp01 ~]$
Success Indicators:
- ✅ Successfully authenticated as user
tony - ✅ Command prompt shows
stapp01hostname - ✅ Ready to execute administrative commands
timedatectlPurpose: Display current timezone and time settings before making changes.
Expected Output (sample):
Local time: Sat 2026-02-08 05:12:43 UTC
Universal time: Sat 2026-02-08 05:12:43 UTC
RTC time: Sat 2026-02-08 05:12:43
Time zone: UTC (UTC, +0000)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Success Indicators:
- ✅ Current timezone displayed (likely UTC or other)
- ✅ Time and date information shown
- ✅ Ready to change timezone
sudo timedatectl set-timezone America/JamaicaPurpose: Change the system timezone to America/Jamaica.
Command Breakdown:
sudo: Execute with administrative privilegestimedatectl: System time and date control commandset-timezone: Set system timezoneAmerica/Jamaica: Target timezone (EST, UTC-5)
Expected Output:
[no output indicates success]
Success Indicators:
- ✅ Command completes without errors
- ✅ Timezone changed successfully
- ✅ Configuration persisted
/etc/localtime pointing to the timezone data file.
timedatectlPurpose: Confirm the timezone has been changed to America/Jamaica.
Expected Output:
Local time: Sat 2026-02-08 00:12:43 EST
Universal time: Sat 2026-02-08 05:12:43 UTC
RTC time: Sat 2026-02-08 05:12:43
Time zone: America/Jamaica (EST, -0500)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Success Indicators:
- ✅ Time zone shows
America/Jamaica (EST, -0500) - ✅ Local time adjusted to EST
- ✅ Configuration successful on App Server 1
ssh steve@stapp02Purpose: Establish SSH connection to App Server 2 for timezone configuration.
Expected Output:
steve@stapp02's password:
Welcome to App Server 2 - Stratos Datacenter
[steve@stapp02 ~]$
Success Indicators:
- ✅ Successfully authenticated as user
steve - ✅ Command prompt shows
stapp02hostname - ✅ Ready to execute administrative commands
timedatectlPurpose: Display current timezone settings before making changes.
Expected Output (sample):
Local time: Sat 2026-02-08 05:12:43 UTC
Universal time: Sat 2026-02-08 05:12:43 UTC
RTC time: Sat 2026-02-08 05:12:43
Time zone: UTC (UTC, +0000)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Success Indicators:
- ✅ Current timezone displayed
- ✅ Ready to change timezone
sudo timedatectl set-timezone America/JamaicaPurpose: Change the system timezone to America/Jamaica.
Expected Output:
[no output indicates success]
Success Indicators:
- ✅ Command completes without errors
- ✅ Timezone changed successfully
timedatectlPurpose: Confirm the timezone has been changed to America/Jamaica.
Expected Output:
Local time: Sat 2026-02-08 00:12:43 EST
Universal time: Sat 2026-02-08 05:12:43 UTC
RTC time: Sat 2026-02-08 05:12:43
Time zone: America/Jamaica (EST, -0500)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Success Indicators:
- ✅ Time zone shows
America/Jamaica (EST, -0500) - ✅ Configuration successful on App Server 2
ssh banner@stapp03Purpose: Establish SSH connection to App Server 3 for timezone configuration.
Expected Output:
banner@stapp03's password:
Welcome to App Server 3 - Stratos Datacenter
[banner@stapp03 ~]$
Success Indicators:
- ✅ Successfully authenticated as user
banner - ✅ Command prompt shows
stapp03hostname - ✅ Ready to execute administrative commands
timedatectlPurpose: Display current timezone settings before making changes.
Expected Output (sample):
Local time: Sat 2026-02-08 05:12:43 UTC
Universal time: Sat 2026-02-08 05:12:43 UTC
RTC time: Sat 2026-02-08 05:12:43
Time zone: UTC (UTC, +0000)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Success Indicators:
- ✅ Current timezone displayed
- ✅ Ready to change timezone
sudo timedatectl set-timezone America/JamaicaPurpose: Change the system timezone to America/Jamaica.
Expected Output:
[no output indicates success]
Success Indicators:
- ✅ Command completes without errors
- ✅ Timezone changed successfully
timedatectlPurpose: Confirm the timezone has been changed to America/Jamaica.
Expected Output:
Local time: Sat 2026-02-08 00:12:43 EST
Universal time: Sat 2026-02-08 05:12:43 UTC
RTC time: Sat 2026-02-08 05:12:43
Time zone: America/Jamaica (EST, -0500)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Success Indicators:
- ✅ Time zone shows
America/Jamaica (EST, -0500) - ✅ Configuration successful on App Server 3
- ✅ All three app servers configured
On each server:
ls -l /etc/localtimePurpose: Verify the symlink points to the correct timezone data file.
Expected Output:
lrwxrwxrwx 1 root root 38 Feb 08 00:12 /etc/localtime -> /usr/share/zoneinfo/America/Jamaica
Success Indicators:
- ✅ Symlink exists
- ✅ Points to America/Jamaica timezone file
- ✅ Configuration persisted
For quick copy-paste, execute on each App Server:
# App Server 1
ssh tony@stapp01
# Check current timezone
timedatectl
# Set timezone to America/Jamaica
sudo timedatectl set-timezone America/Jamaica
# Verify change
timedatectl
# Verify symlink (optional)
ls -l /etc/localtime
# Exit to jump host
exit
# App Server 2
ssh steve@stapp02
# Check current timezone
timedatectl
# Set timezone to America/Jamaica
sudo timedatectl set-timezone America/Jamaica
# Verify change
timedatectl
# Exit to jump host
exit
# App Server 3
ssh banner@stapp03
# Check current timezone
timedatectl
# Set timezone to America/Jamaica
sudo timedatectl set-timezone America/Jamaica
# Verify change
timedatectl
# Exit to jump host
exitProblem: Timezone name is incorrect or doesn't exist. Fix: List available timezones and use correct name.
# List all available timezones
timedatectl list-timezones
# Search for specific timezone
timedatectl list-timezones | grep Jamaica
timedatectl list-timezones | grep America
# Use correct timezone name
sudo timedatectl set-timezone America/JamaicaProblem: Cannot set timezone without sudo. Fix: Always use sudo for timedatectl set-timezone.
# WRONG - Will fail
timedatectl set-timezone America/Jamaica
# CORRECT - Use sudo
sudo timedatectl set-timezone America/JamaicaProblem: Timezone reverts after reboot. Fix: Verify symlink was created correctly.
# Check symlink
ls -l /etc/localtime
# Recreate if needed
sudo timedatectl set-timezone America/Jamaica
# Verify
timedatectlProblem: Time is incorrect even after timezone change. Fix: Enable and synchronize NTP.
# Enable NTP synchronization
sudo timedatectl set-ntp true
# Check NTP status
timedatectl
# Manually sync time (if needed)
sudo ntpdate pool.ntp.orgProblem: Applications show wrong time after timezone change. Fix: Restart applications or services.
# Restart specific service
sudo systemctl restart application.service
# Or restart all services (use with caution)
sudo systemctl daemon-reloadSymptoms: Failed to set timezone: Invalid argument.
Solution: Verify timezone name is correct.
# List available timezones
timedatectl list-timezones | grep Jamaica
# Use exact timezone name
sudo timedatectl set-timezone America/Jamaica
# Verify
timedatectlSymptoms: Failed to set timezone: No such file or directory.
Solution: Install timezone data package.
# Install timezone data (RHEL/CentOS)
sudo yum install tzdata -y
# Install timezone data (Debian/Ubuntu)
sudo apt install tzdata -y
# Set timezone again
sudo timedatectl set-timezone America/JamaicaSymptoms: Failed to set timezone: Permission denied.
Solution: Use sudo for administrative operations.
# Always use sudo
sudo timedatectl set-timezone America/Jamaica
# Verify you have sudo access
sudo -lSymptoms: System clock synchronized: no.
Solution: Enable NTP synchronization.
# Enable NTP
sudo timedatectl set-ntp true
# Check status
timedatectl
# Verify NTP service is running
sudo systemctl status chronyd # RHEL/CentOS
sudo systemctl status systemd-timesyncd # Debian/Ubuntu🔍 Main Challenge Encountered:
The primary challenge was synchronizing timezone settings across all three app servers to ensure consistency for logging, scheduling, and application operations. Understanding the timedatectl command and timezone naming conventions is crucial for proper time management.
💡 Solution Approach:
- Current State Verification: Checked current timezone on each server with
timedatectl. - Timezone Change: Used
timedatectl set-timezone America/Jamaicaon all servers. - Verification: Confirmed change with
timedatectlshowing correct timezone. - Multi-Server Execution: Repeated process on all three app servers.
- Consistency Check: Ensured all servers show identical timezone configuration.
🎯 Key Success Factors:
- Correct Command: Used
timedatectl set-timezonefor persistent change. - Proper Timezone Name: Specified exact timezone
America/Jamaica. - Sudo Usage: Applied sudo for administrative operations.
- Verification: Confirmed change on each server with
timedatectl. - Multi-Server Consistency: Applied identical configuration across all servers.
- Always use sudo for
timedatectl set-timezonecommand. - Use exact timezone name from
timedatectl list-timezones. - Verify change with
timedatectlafter configuration. - Apply configuration to all specified servers.
- Check symlink at
/etc/localtimefor persistence verification.
🔒 Linux Timezone Management Best Practices Applied:
- Persistent Configuration: Used
timedatectlfor permanent change. - Verification: Confirmed configuration with
timedatectloutput. - Consistency: Applied identical timezone across all servers.
- NTP Sync: Ensured NTP synchronization is active.
- Documentation: Clear understanding of timezone impact on system operations.
- Timezone vs UTC: Local timezone is offset from UTC (Coordinated Universal Time).
- America/Jamaica: Eastern Standard Time (EST), UTC-5 year-round (no DST).
- Symlink Method:
timedatectlcreates symlink at/etc/localtime. - Persistence: Change persists across reboots automatically.
- Application Impact: Affects log timestamps, cron jobs, and time-based operations.
🔧 Timezone Consistency: Critical for distributed systems and log correlation. 🔐 NTP Synchronization: Always enable NTP for accurate time keeping. 📊 Application Impact: Restart applications after timezone changes. 🛡️ Cron Jobs: Verify cron job schedules after timezone changes. 🗄️ Logging: Ensure log timestamps are consistent across servers. 📝 Documentation: Document timezone changes in change logs. 🔍 Monitoring: Monitor time drift and NTP synchronization status. ⚙️ Automation: Use configuration management for consistent timezone settings.
Timedatectl Command Reference:
# Display current time and timezone settings
timedatectl
# List all available timezones
timedatectl list-timezones
# Search for specific timezone
timedatectl list-timezones | grep America
timedatectl list-timezones | grep Jamaica
# Set timezone
sudo timedatectl set-timezone America/Jamaica
# Enable/disable NTP synchronization
sudo timedatectl set-ntp true
sudo timedatectl set-ntp false
# Set time manually (if NTP disabled)
sudo timedatectl set-time "2026-02-08 12:00:00"
# Set date only
sudo timedatectl set-time "2026-02-08"
# Show detailed status
timedatectl showCommon Timezone Examples:
# Americas
America/New_York # EST/EDT (UTC-5/-4)
America/Chicago # CST/CDT (UTC-6/-5)
America/Denver # MST/MDT (UTC-7/-6)
America/Los_Angeles # PST/PDT (UTC-8/-7)
America/Jamaica # EST (UTC-5, no DST)
# Europe
Europe/London # GMT/BST (UTC+0/+1)
Europe/Paris # CET/CEST (UTC+1/+2)
# Asia
Asia/Tokyo # JST (UTC+9)
Asia/Kolkata # IST (UTC+5:30)
# UTC
UTC # Coordinated Universal TimeSecurity Recommendations:
- Enable NTP synchronization for accurate time
- Use authenticated NTP servers
- Monitor time drift and synchronization status
- Implement alerts for time synchronization failures
- Document timezone configuration in infrastructure documentation
- Use consistent timezone across all servers in a cluster
- Verify timezone after system updates or migrations
- Test application behavior after timezone changes
NTP Configuration:
# Check NTP status
timedatectl
# Enable NTP
sudo timedatectl set-ntp true
# Check NTP service status (RHEL/CentOS)
sudo systemctl status chronyd
# Check NTP service status (Debian/Ubuntu)
sudo systemctl status systemd-timesyncd
# View NTP synchronization details
chronyc tracking # RHEL/CentOS
timedatectl timesync-status # Debian/Ubuntu
# Configure NTP servers (edit config file)
sudo vi /etc/chrony.conf # RHEL/CentOS
sudo vi /etc/systemd/timesyncd.conf # Debian/UbuntuImpact on System Components:
# Cron jobs - Use timezone-aware scheduling
# Logs - Timestamps will reflect new timezone
# Applications - May need restart to pick up timezone change
# Databases - May store times in UTC internally
# Web servers - May serve time-based content differently
# Verify cron jobs after timezone change
crontab -l
sudo crontab -l
# Check system logs with new timestamps
journalctl -n 50
tail -f /var/log/messages✅ Objectives Achieved:
- Synchronized timezone settings to America/Jamaica on all app servers
- App Server 1: Timezone set to
America/Jamaica (EST, -0500) - App Server 2: Timezone set to
America/Jamaica (EST, -0500) - App Server 3: Timezone set to
America/Jamaica (EST, -0500) - Verified configuration on each server
- Ensured consistency across all servers
🔍 Verification Completed:
- App Server 1 (stapp01):
- Timezone:
America/Jamaica (EST, -0500) - NTP synchronized: Yes
- Symlink verified
- Timezone:
- App Server 2 (stapp02):
- Timezone:
America/Jamaica (EST, -0500) - NTP synchronized: Yes
- Symlink verified
- Timezone:
- App Server 3 (stapp03):
- Timezone:
America/Jamaica (EST, -0500) - NTP synchronized: Yes
- Symlink verified
- Timezone:
🚀 Next Steps (Optional):
- Verify cron job schedules with new timezone
- Restart applications to pick up timezone change
- Monitor log timestamps for consistency
- Update monitoring systems with new timezone
- Document timezone configuration in infrastructure docs
- Test time-based application features
🔒 Configuration Validation:
- ✅ All three servers configured identically
- ✅ Timezone set to America/Jamaica (EST, UTC-5)
- ✅ Symlinks created at
/etc/localtime - ✅ Configuration persists across reboots
- ✅ NTP synchronization active
- ✅ Consistent time settings across infrastructure
📊 Configuration Summary:
- Servers Configured: 3 (stapp01, stapp02, stapp03)
- Timezone:
America/Jamaica - UTC Offset: -0500 (EST)
- Daylight Saving: None (Jamaica does not observe DST)
- Method:
timedatectl set-timezone - Persistence: Permanent (via symlink)
- NTP Status: Active and synchronized
🔍 Key Learning Points:
timedatectlis the modern systemd-based timezone management tool- America/Jamaica uses EST (UTC-5) year-round without DST
- Timezone changes are persistent via symlink at
/etc/localtime - NTP synchronization ensures accurate time across servers
- Consistent timezone is critical for log correlation and scheduling
- Applications may need restart to pick up timezone changes