Chinaunix首页 | 论坛 | 博客
  • 博客访问: 388769
  • 博文数量: 112
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 800
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-29 13:41
文章分类

全部博文(112)

文章存档

2020年(1)

2018年(10)

2017年(27)

2016年(18)

2015年(31)

2014年(25)

分类: 系统运维

2018-11-29 02:36:38

一、服务端配置192.168.199.125:

点击(此处)折叠或打开

  1. NTP服务器监听端口为UDP的123,需要在本地防火墙开启运行客户端访问123端口;
  2. echo '-A INPUT -m state --state NEW -m udp -p udp --deport 123 -j ACCEPT'>> /etc/sysconfig/iptables
  3. ntp服务安装与配置
  4. yum install ntp ntpdate -y
  5. /etc/init.d/ntpd restart
  6. 同步nptd时间服务器时间
  7. ntpd -p
  8. 同步/etc/ntp.conf中的外网时间服务器
  9. /etc/init.d/ntpd stop
  10. ntpdate pool.ntp.org
  11. 29 Nov 01:42:23 ntpdate[2115]: adjust time server 85.199.214.101 offset 0.015287 sec

二、客户端配置:

点击(此处)折叠或打开

  1. #安装ntpdate
  2. yum -y install ntp
  3. #编辑计划任务
  4. crontab -e
  5. 0 0 * * * /usr/sbin/ntpdate 192.168.199.125 >>/var/log/ntpstats/ntp.log 2>&1
  6. #编辑/etc/ntp.conf配置
  7. vim /etc/ntp.conf
  8. driftfile /var/lib/ntp/drift
  9. restrict default kod nomodify notrap nopeer noquery
  10. restrict -6 default kod nomodify notrap nopeer noquery
  11. #开启内部递归网络接口lo
  12. restrict 127.0.0.1
  13. restrict -6 ::1
  14. #上级时间服务器
  15. server 192.168.199.125
  16. fudge 192.168.199.125 stratum 10
  17. includefile /etc/ntp/crypto/pw
  18. keys /etc/ntp/keys

  1. ntpdate 192.168.199.125
  2. 29 Nov 01:42:23 ntpdate[2115]: adjust time server 85.199.214.101 offset 0.015287 sec

阅读(682) | 评论(0) | 转发(0) |
0

上一篇:python管理mysql

下一篇:LAMP+Discuz搭建论坛

给主人留下些什么吧!~~