架设本地时间服务器

一:本地时间服务

1、安装ntp

查看是否安装---rpm -qa |grep ntpdate

没安装先安装 -- yum install ntp

2、ntp配置

ntp.conf 配置

修改/etc/ntp.conf文件内容

server 127.127.1.0


fudge 127.127.1.0 stratum 8


restrict 192.168.1.0 mask 255.255.255.0 nomodify                         //允许 192.168.1的号段的ip使用与时间服务器

restrict 0.0.0.0 mask 0.0.0.0 nomodify notrap noquery notrust      //屏蔽其它ip使用时间服务

其它不变


使NTP服务可以在系统引导的时候自动启动------- chkconfig ntpd on


将同步好的时间同步到CMOS  ----- 

vim /etc/sysconfig/ntpd 

SYNC_HWCLOCK=yes

3、启动|停止|重启

启动------ /etc/init.d/ntpd start

停止-------/etc/init.d/ntpd stop

重启-------/etc/init.d/ntpd restart


4、问题排查

查看ntp服务是否启动----pgrep ntpd

查看端口 ---- netstat -ntlup



二:需要同步服务器

crontab -e 

添加以下内容

* */1 * * * /usr/sbin/ntpdate 时间服务IP                          //此例子是1小时同步一次。


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值