🍌Install NTP on Oracle Linux

NTP ( Network Time Protocol ) เป็นโปรโตคอลที่ใช้ในการ Sync Time ของเครื่อง Server ทุกเครื่องภายใน Network ให้ตรงกันผ่าน Protocol UDP ซึ่งทำงานแบบ Client-Server หรือ Peer-to-Peer ด้วย Port 123 ถ้าหาก Sync Time ของเครื่องไม่ตรงกัน อาจจะทำให้ Application หรือ Database ทำงานผิดพลาดได้

Install

  • ทำการติดตั้ง Package

#
yum install ntp -y
  • ทำการแก้ไขไฟล์ /etc/ntp.conf เลือกตาม NTP Pool Zone in Thailand คำเตือนหากไม่ระบุ iburst จะไม่ทำการ Sync ทันที ดังนั้นควรระบุ

#
vi /etc/ntp.conf
server 3.th.pool.ntp.org iburst
server 0.asia.pool.ntp.org iburst
server 2.asia.pool.ntp.org iburst
  • กรณีที่ต้องการใช้ NTP Server อื่นของไทย

#
vi /etc/ntp.conf
server time.navy.mi.th iburst
server time1.nimt.or.th iburst
server clock.nectec.or.th iburst
  • ทำการ Enable Firewall

#
iptables -I INPUT -p udp -m udp --dport 123 -j ACCEPT
#
service iptables save
  • ทำการ Start Service NTP

  • ทำการกำหนดให้ Start ทุกครั้งที่ Restart เครื่อง

  • ทำการตรวจสอบ List of Peers ด้วย NTP Query

  • ทำการแสดง Network Time Synchronization ด้วย NTP Stat

  • ทำการตรวจสอบ Date

  • ทำการสร้าง Crontab

อ่านเพิ่มเติม : https://bit.ly/38E7ROy, https://bit.ly/35tDSaq

Last updated

Was this helpful?