配置ntp时间服务器

2019-11-07 走过路过 1833 0

配置ntp时间服务器,首先假如时间服务器为:192.168.1.11

先手动同步时间,因为手动同步时ntp服务必须为关闭状态。
执行命令:ntpdate 192.168.1.11

//检测是否安装ntp,如未安装,则安装ntp
yum install ntp

//配置ntp
vi /etc/ntp.conf

//配置当前节点ip
restrict 192.168.1.55 nomodify notrap nopeer noquery

restrict default nomodify notrap nopeer noquery

//配置网关
restrict 192.168.1.1 mask 255.255.255.0 nomodify notrap

//配置服务器
server 192.168.1.11 prefer

//开启服务
systermctl start ntpd

//设置自启动
systemctl enable ntpd

//查看ntp状态
ntpstat

//配置时区
timedatectl set-timezone Asia/Shanghai

全部评论 最新评论 最早评论
还没有用户评论

联系我们

微信公众号
打赏作者