Pemilihan zona waktu berpengaruh dengan pengaturan tanggal dan jam, sementara tanggal dan jam akan berpengaruh kepada perekaman sistem atau aplikasi yang membutuhkan keakuratan waktu.
*Cek Zona Waktu*
Cek zona waktu yang terpasang saat ini.
[INPUT]1 2 3 4 5 6 7 8 9 timedatectl Local time: Tue 2019-10-15 09:16:16 EDT Universal time: Tue 2019-10-15 13:16:16 UTC RTC time: Tue 2019-10-15 13:16:14 Time zone: America/New_York (EDT, -0400) System clock synchronized: yes NTP service: active RTC in local TZ: no
atau
[INPUT]1 2 3 timedatectl | grep Time Time zone: America/New_York (EDT, -0400)
Tampilkan semua zona waktu yang tersedia.
[INPUT]1 timedatectl list-timezones
Hanya menampilkan zona waktu Asia.
[INPUT]1 timedatectl list-timezones | grep Asia | more
*Setting Zona Waktu*
Setting zona waktu ke Asia/Pontianak.
[INPUT]1 2 3 4 5 6 7 8 9 10 timedatectl set-timezone Asia/Pontianak timedatectl Local time: Tue 2019-10-15 20:22:54 WIB Universal time: Tue 2019-10-15 13:22:54 UTC RTC time: Tue 2019-10-15 13:22:53 Time zone: Asia/Pontianak (WIB, +0700) System clock synchronized: yes NTP service: active RTC in local TZ: no
*Setting NTP Client*
NTP client akan melakukan sinkronisasi waktu dengan NTP server. Pastikan NTP service aktif.
[INPUT]1 timedatectl | grep ‘NTP service’
Jika NTP service: inactive, aktifkan terlebih dahulu.
[INPUT]1 timedatectl set-ntp true
Install chrony NTP client jika belum terinstall.
[INPUT]1 2 3 4 dnf install chrony systemctl enable chronyd systemctl start chronyd systemctl status chronyd
Setting NTP server yang digunakan.
[INPUT]1 vi /etc/chrony.conf
Nonaktifkan atau hapus baris pool 2.centos.pool.ntp.org iburst. Ganti NTP server dengan lokasi terdekat.
[INPUT]1 pool asia.pool.ntp.org iburst
Cek sources NTP server.
[INPUT]1 2 3 4 5 6 7 8 9 chronyc sources 210 Number of sources = 4 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^? 120.25.115.20 6 – +0ns[ +0ns] +/- 0ns ^+ static.226.144.216.95.cl> 2 6 17 33 -1000us[ -439us] +/- 143ms ^+ static.15.192.216.95.cli> 2 6 17 33 +303us[ +864us] +/- 143ms ^* 202-65-114-202.jogja.cit> 2 6 17 34 +3202us[+3763us] +/- 60ms
Install NTPStat, tool untuk memeriksa status sinkronisasi waktu.
[INPUT]1 2 3 4 5 6 dnf install ntpstat ntpstat synchronised to NTP server (95.216.192.15) at stratum 3 time correct to within 179 ms polling server every 64 s
Cek waktu yang terpasang di server.
[INPUT]1 2 timedatectl date
Selamat mencoba ð