နိဒန်း ။ Network Time Protocol (NTP
Daemon) ကို Network တခုအတွင်း တွင် Local NTP Daemon အနေဖြင့်
သီးသန့် Configuration ပြုလုပ်ပြီး
အခြား မိမိ၏ Local Network အတွင်းမှ
node များကို Time Synchronize ပြုလုပ်စေခြင်း ဖြင့် အကျိုးကျေးဇူး များစွာရှိပါသည်။ Network Authentication Case, Different System Integrations Case,
Certificate Verification Case, Network Monitoring and Remote logs Analysis
Case, Client Server Data Transaction Case ( In Database Transaction) ပြုလုပ်ရာတွင် အချိန်မှန်ကန်မူ့ ရှိရန် အလွန် အရေးကြီးပါသည်။ အထူးသဖြင့် Service Level Agreements (SLA) ဖြင့်
ဝန်ဆောင်မူ့ ကိစ္စများတွင် မဖြစ်မနေ စဉ်းစားရမည့် ကိစ္စဖြစ်ပါသည်။ အချို့ သော Data Center များတွင် Internet
ကို အကန့်သတ််ဖြင့်သာ ချိတ်ဆက်ခွင့် ရှိကြသည်။ ထိုသို့သော
အကြောင်းများကြောင့် Local Network Time Protocol (NTP
Daemon) ကို Linux Distro တခုဖြစ်သော Centos 7 (minimum) ပေါ်တွင် တည်ဆောက်ခြင်းကို စာရေးသူမှ ရေးသားခြင်းဖြစ်ပါသည်။
⇉ ⇉ ⇉ Server Site Configuration စတင်ခြင်း။ ⇇ ⇇ ⇇
System ကို update လုပ် ပြီး လိုအပ်သော binary packages များကို install ပြုလုပ်
ပါမည်။
# yum
install nmap net-tools traceroute bind-utils NetworkMangager-tui
policycoreutils-python open-vm-tools ntp -y
|
System ၏ IP, Net-mask,
Gateway, DNS နှင့် DNS Search Path
များကို လိုအပ်သလို ပြောင်းလဲရန်အတွက် အောက်ပါ command ကို အသုံး ပြုဆောင်ရွတ်ပါမည်။
 |
Figure (1.1) Network Manager Terminal User Interface. |
 |
Figure (1.2) Edit Ethernet Connection of ens160 (NIC). |
 |
Figure (1.3) Edit Connection Detail of ens160 with Static IPv4 Address. |
 |
Figure (1.4) To Edit Host Name From Network Manager TUI. |
 |
Figure (1.5) Set Host name From Network Manager TUI. |
 |
Figure (1.6) Confirm Host name From Network Manager TUI. |
 |
Figure (1.7) Exit From Network Manager TUI. |
Network Setting, Host Name နှင့် update လုပ်ထားခြင်းကြောင့် Kernel firmware များပြောင်းလဲသွားပြီး
ဖြစ်ပါသည်။ ထို့ကြောင့် system ကို restart ချရန် အောက်ပါ command
ကို အသုံးပြုဆောင်ရွတ်ပါမည်။
 |
Figure (1.8) System Restart From Command. |
System ကို Login ဝင်ပြီး /etc/hosts
file တွင် စာသုံးကြောင်း ထပ်တိုးပါမည်။
 |
Figure (1.9) Append Upper 3 Lines in hosts file. |
Esc key ကိုနိပ်ပြီး :wq ရိုက်ကာ save လုပ်ပါမည်။ hostname ဖိုင်ကို
cat command အသုံးပြုပြီး
မှန်ကန်မူ့ရှိမရှိကြည့်ပါမည်။ vi command ကိုလည်း အသုံးပြုနိုင်ပါသည်။
 |
Figure (2.1) Check Host Name In hostname File. |
DNS Configuration ဖိုင်ဖြစ်တဲ့ resolv.conf ဖိုင်ကို cat
command အသုံးပြုပြီး မှန်ကန်မူ့ရှိမရှိကြည့်ပါမည်။ vi command ကိုလည်း အသုံးပြုနိုင်ပါသည်။
 |
Figure (2.2) Check DNS Server Setting in resolve.conf File. |
Hostname အပြည့်အစုံကို ခေါ်ကြည့်ခြင်းဖြစ်ပါသည်။
 |
Figure (2.3) Check System's Fully Qualified Name with hostname -f command. |
 |
Figure (2.4) Check System's Short Name. |
DNS Record ကို
စမ်သပ်စစ်ဆေးခြင်းဖြစ်ပါသည်။
# nslookup
ntp02.mycompany.local
|
 |
Figure (2.5) DNS Record Test with nslookup Command. |
NTP Daemon ကို System
Setup လုပ်သည်နှင့် တပြိုင်နက် စတင်စေရန် အသုံးပြုသော command ဖြစ်ပါသည်။
# systemctl
enable ntpd.service
|
 |
Figure (2.6) Enable NTP Damon at System Setup Time. |
NTP Daemon ကို စတင်စေရန် အသုံးပြုသော command ဖြစ်ပါသည်။
# systemctl
start ntpd.service
|
 |
Figure (2.7) Starting NTP Daemon. |
နောက်တဆင့် အနေဖြင့် NTP Daemon
Configuration ကို
ပြင်ဆင်မှာဖြစ်ပါသည်။ NTP Daemon Configuration ဖိုင်သည် /etc/ntp.conf ဖြစ်ပါသည်။
# vi /etc/ntp.conf ရိုက်ပြီး ဝင်ပါမည်။ i ကိုနိပ်ပြီး insert
mode ကို ဝင်ပြီးနောက်
# restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap နေရာတွင် အောက်ပါစာကြောင်း ၅ ကြောင်း ကို ရေးသွင်ပါမည်။
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
server 127.127.1.0
fudge 127.127.1.0 stratum 10
server ntp02.mycompany.local
fudge ntp02.mycompany.local stratum 8
ထို့နောက် Esc key ကိုနိပ်ပြီး :wq ရိုက်ကာ save လုပ်ပါမည်။
အထက်ပါ configuration များအရ NTP Daemon သည် 192.168.1.0/24 Network မှလာသော NTP request များကို လက်ခံပေးမည်ဖြစ်ပြီး
သတ်မှတ်ထားသော Network Time Server များနှင့်
အချိန် ကိုက်ခြင်း မပြုလုပ်နိုင်ပါက လည်းကောင်း၏ Hardware
Time ဖြင့် ချိန်ကိုက်ခြင်းကိုဆောင်ရွတ်ပါသည်။ NTP Daemon ကိုပြင်ဆင်ပြီးသွားပြီ ဖြစ်သဖြင့် Service ကို restart ပြုလုပ်ခြင်း Firewall တွင်
ပြုပြင်ခြင်းမျာကို ဆက်လက်ဆောင်ရွတ်ပါမည်။
# systemctl
restart ntpd.service
|
Global Time Server ဖြင့် Time Synchronize ပြုလုပ်ရန် အတွက်
# ntpdate
-d .0.asia.pool.ntp.org
|
 |
Figure (2.8) Time synchronize with Global Time Server |
ပြန်လည် စစ်ဆေးရန်အတွက်
 |
Figure (2.9) Check Time Synchronize Process Result. |
လက်ရှိ zone မှ work zone သို့ပြောင်းခြင်းဖြစ်ပါသည်။
#
firewall-cmd --set-default-zone=work
|
လက်ရှိအသုံးပြုနေသော firewall
၏ work zone တွင်
ntp service အားထည့်
သွင်းခြင်းဖြစ်ပါသည်။
#
firewall-cmd --zone=work --add-service=ntp --permanent
|
Firewall ၏ setting များ ပြောင်းလဲ ထားခြင်းကို အသက်ဝင်စေရန်
reload ပြုလုပ်ခြင်းဖြစ်ပါသည်။
Firewall ၏ setting မျာကို ကြည့်ခြင်းဖြစ်ပါသည်။
#
firewall-cmd --list-all
|
⇉ ⇉ ⇉ Server Site Configuration ပြီးဆုံးခြင်း။ ⇇ ⇇ ⇇
⇉ ⇉ ⇉ Client Site Configuration စတင်ခြင်း။ ⇇ ⇇ ⇇
⇉ For Linux OS
Client Site အနေဖြင့် NTP Daemon ကို install ပြုလုပ်ထားရန်၊ System နှင့်
အတူ setup ဖြစ်နေစေရန် နှင့် running ဖြစ်နေရန် လိုအပ်ပါသည်။ ထိုသို့
ဖြစ်နေစေရန် အောက်ပါ command များကို
အသုံးပြုပါမည်။
# yum install ntp -y
# systemctl enable ntpd.service
# systemctl start ntpd.service
Local NTP Server ဖြင့်
အချိန် တိုက်စေရန် အတွက်ပြင်ဆင်မူ့မျာကို /etc/ntp.conf တွင်ပြုလုပ်ပါမည်။
# vi /etc/ntp.conf ရိုက်ပြီး ဝင်ပါမည်။ i ကိုနိပ်ပြီး
insert mode ကို ဝင်ပြီးနောက်
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
များအား ဖျက်ပြီး
server ntp02.mycompany.local ibust
ဟုရေးသားပါမည်။ ထို့နောက် Esc key ကိုနိပ်ပြီး :wq
ရိုက်ကာ save လုပ်ပါမည်။
 |
Figure (2.10) Comment and Insert Local NTP Server |
NTP Daemon ကို restart ပြုလုပ်ပါမည်။
# systemctl
restart ntpd.service
|
Time Synchronize ပြုလုပ်ရန်
အတွက်
# ntpdate
-d ntp02.mycompany.local
|
 |
Figure (3.1) NTP Update with local NTP Daemon Process Result. |
ပြန်လည် စစ်ဆေးရန်အတွက်
 |
Figure (3.2) Check Date and Time Control Setting. |
command များ
အသုံးပြုနိုင်ပါသည်။
⇉ For Device
⇉ For VMware vSphere Hypervisor
 |
Figure (3.4) Configure NTP Server Setting in VMware vSphere Hypervisor. |
⇉ ⇉ ⇉
Client Site
Configuration ပြီးဆုံးခြင်း။ ⇇ ⇇ ⇇
⇉ NTP Daemon ၏ အကျိုးသက်ရောက်မူ့အား မြင်သာသောနေရာမှကြည့်ခြင်း။
 |
Figure (3.5) NTP Daemon ၏ အကျိုး သက်ရောက်မူ့ အား rSysLog Server မှ ကြည့်ခြင်း။ |