Ntp服务安装

系列文章目录


一、在线安装

示例:pandas 是基于NumPy 的一种工具,该工具是为了解决数据分析任务而创建的。

#在线安装ntp
yum -y install ntp

#检查rpm包
rpm -qa | grep ntp 

#卸载ntp
yum -y remove ntp

二、离线安装

#检查rpm包
rpm -qa | grep ntp 

#从https://pkgs.org/download/ntp 下载rpm包
autogen-libopts-5.18-5.el7.x86_64.rpm
ntp-4.2.6p5-29.el7.centos.x86_64.rpm
ntpdate-4.2.6p5-29.el7.centos.x86_64.rpm

#server安装
rpm -ivh autogen-libopts-5.18-5.el7.x86_64.rpm
rpm -ivh ntpdate-4.2.6p5-29.el7.centos.x86_64.rpm
rpm -ivh ntp-4.2.6p5-29.el7.centos.x86_64.rpm


#卸载安装包
rpm -e ...

三、服务配置文件

vim /etc/ntp.conf

restrict 192.168.0.101 nomodify notrap nopeer noquery          //当前节点IP地址
restrict 192.168.0.2 mask 255.255.255.0 nomodify notrap      //集群所在网段的网关(Gateway),子网掩码(Genmask)

# 在server部分添加以下部分,并注释掉server 0 ~ n

server 127.127.1.0
fudge 127.127.1.0 stratum 10

在这里插入图片描述

如需其它服务器从本机同步时间,还需将ntp服务开放
[root@centos7 /]firewall-cmd --zone=public --add-service=ntp --permanent

[root@centos7 /]firewall-cmd --reload

最后设置开机启动

[root@centos7 /]systemctl enable ntpd


#NTP服务端口为123/UDP

转载:
https://blog.csdn.net/ywd1992/article/details/82115406

https://blog.csdn.net/vic_qxz/article/details/80343351

离线安装包:https://download.csdn.net/download/weixin_43675226/21615465?spm=1001.2014.3001.5501

  • 1
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值