- 积分
- 16843
在线时间 小时
最后登录1970-1-1
|

楼主 |
发表于 2017-2-28 20:25:21
|
显示全部楼层
配置NTP server 服务器 #yum install -y ntp
0 B; a* s7 u1 a& u● 编辑ntp 配置 vim /etc/ntp.conf
% ], ]. {; _4 r4 V5 ]3 V+ Jdriftfile /var/lib/ntp/drift
" q1 Y- A) w' ?4 Brestrict default nomodify notrap nopeer noquery
: h" Z& I& }; B, hrestrict 127.0.0.1
3 J2 l) K; g& o5 v: \- L) ]# y8 Orestrict ::1
0 \) z# W, Z( {8 n5 E' E& v+ H+ zserver 127.127.1.0 7 ]3 K5 @3 I8 H- V6 s- Y6 x# x
fudge 127.127.1.0 stratum 0 . @. ]0 ~% B+ M( j
includefile /etc/ntp/crypto/pw
/ D: D, D& k, X8 S8 b j1 xkeys /etc/ntp/keys
. z, B K% Z$ U9 Q+ A# Pdisable monitor) M' m; x% D: a2 t8 y
● 编辑ntp 服务器的配置 u$ v9 ]5 n% R$ o- n1 Q+ d
# vim /etc/sysconfig/iptables 9 _, o& W7 v- B; B4 M" l
' H1 ]2 y& D7 z2 B. g -A INPUT -p udp --dport 123 -j ACCEPT
; G4 K u2 C4 V2 c% P7 T$ Q4 S* `4 W/ k8 m( z. H: B& w
# systemctl restart iptables4 O' {: j9 p$ X
# systemctl restart iptables.service6 U" k) I) G. P; M3 f8 i; z: F. y% b
● 将系统时间写入硬件9 X$ w0 U% a# M ?
# hwclock --systohc+ l2 @' c" W: ]. i7 i7 y& Y
● 重新启动NTP服务, y; N% s, J i' Z
# service ntpd restart
6 G' t( y( R- S9 |9 ^: S
2 y" O8 K- D+ g5 M |
|