博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
centos 6.5 ntp 服务器搭建
阅读量:7119 次
发布时间:2019-06-28

本文共 1595 字,大约阅读时间需要 5 分钟。

1、配置内网NTP-Server(192.168.1.135)

# yum install ntp

# chkconfig ntpd on

# chkconfig --list ntpd

#vim /etc/ntp.conf

------------------------------------------------------------------------------------------- 

# Hosts on local network are less restricted.

# 允许内网其他机器同步时间

restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# 中国这边最活跃的时间服务器 : http://www.pool.ntp.org/zone/cn

server 210.72.145.44 perfer   # 中国国家受时中心

server 202.112.10.36             # 1.cn.pool.ntp.org

server 59.124.196.83             # 0.asia.pool.ntp.org

  

# 允许上层时间服务器主动修改本机时间

restrict 210.72.145.44 nomodify notrap noquery

restrict 202.112.10.36 nomodify notrap noquery

restrict 59.124.196.83 nomodify notrap noquery

# 外部时间服务器不可用时,以本地时间作为时间服务

server  127.127.1.0     # local clock

fudge   127.127.1.0 stratum 10

------------------------------------------------------------------------------------------- 

#service ntpd start

2、配置内网NTP-Clients

# yum install ntp

# chkconfig ntpd on

# chkconfig --list ntpd

#vim /etc/ntp.conf

------------------------------------------------------------------------------------------- 

driftfile /var/lib/ntp/drift

restrict 127.0.0.1

restrict -6 ::1

# 配置时间服务器为本地的时间服务器

server 192.168.1.135

restrict 192.168.1.135 nomodify notrap noquery

server  127.127.1.0     # local clock

fudge   127.127.1.0 stratum 10

includefile /etc/ntp/crypto/pw

keys /etc/ntp/keys

------------------------------------------------------------------------------------------- 

#service ntpd start

手动同步服务器时间

ntpdate -u 192.168.1.135

硬件时间与系统时间一起同步

# vim /etc/sysconfig/ntpd

SYNC_HWCLOCK=yes

 本文转自1321385590 51CTO博客,原文链接:http://blog.51cto.com/linux10000/1717524,如需转载请自行联系原作者
你可能感兴趣的文章
【分享】免费建立自己的站点
查看>>
UiPath如何实现暂停功能?
查看>>
MySQL事务及隔离级别详解
查看>>
VTK Users Guide 中C++例程之ImplicitPlaneWidget
查看>>
编码的事[转]
查看>>
Linux网络配置
查看>>
python笔记9-多线程Threading之阻塞(join)和守护线程(setDaemon)
查看>>
python 字符串分割
查看>>
使用Spring Task轻松完成定时任务
查看>>
Java基础知识
查看>>
Hibernate中的一对一映射
查看>>
论 静态方法@staticmethod 类方法@classmethod @property属性
查看>>
intellij idea+easychm生成帮助文档
查看>>
sql查询条件为空的另类写法o( ̄▽ ̄)d
查看>>
vue学习(十五) 过滤器简单实用
查看>>
MJRefresh的使用
查看>>
.Net Core 之 图形验证码 本文介绍.Net Core下用第三方ZKWeb.System.Drawing实现验证码功能。...
查看>>
修改Chrome默认搜索引擎为Google.com
查看>>
05:整数序列的元素最大跨度值
查看>>
(1)-使用json所要用到的jar包下载
查看>>