NTP服务器配置(centos)

简介:

NTP服务器配置

 

1, 检查是否安装
[root@zxclinux ~]# rpm -q ntp
ntp-4.2.2p1-7.el5
2. 编辑配置文件/etc/ntp.conf
restrict default kod nomodify notrap nopeer noquery
限制其他计算机查询。修改
restrict 127.0.0.1
开放本机内部接口,用于反馈
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
开放这个网段,不能修改
server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org
这些是网络中真正服务器!
3. 启动服务( 最好关掉iptable ,使用udp123 端口)
Service ntpd start
chkconfig  --levels 3 ntpd on
chconfig --list ntpd
ntpd             0:关闭  1:关闭  2:关闭  3:启用  4:关闭 5:启用  6:
设置开机启动。
4.测试
修改网络时间date MMDDhhmmYYYY.ss
ntpq –p检查NTP服务器同步状态
[root@zxclinux ~]# ntpq -p
     remote           refid      st t when poll reach   delay   offset jitter
61.129.66.79     216.218.192.202 2 u   21   64    3   36.800 75527.0 25.918
www.chinaepg.ne 158.43.128.66     3 u   20   64    3   57.995 75497.6 46.614
211.166.12.46    218.75.4.130     3 u   17   64    3   52.094 75534.2 56.985
LOCAL(0)         .LOCL.          10 l   17   64    3    0.000    0.000   0.008
检查本地NTP服务器是否通过NTP校验
ntptrace 158.43.128.66
ntp1.pipex.net: stratum 2, offset -0.000026, synch distance 0.020605
ntp0.nl.uu.net: stratum 1, offset 0.000001, synch distance 0.000410, refid 'PPS'
如果stratum小于16.那么正常
 
vi /etc/ntp/step-tickers

加入一行

pool.ntp.org

这样每次ntpd启动时,会自动连接该国际标准时间服务器;

 

几个命令

#/usr/sbin/ntpdate -u 210.72.145.44 校对时间
#/usr/sbin/ntpdate -q 210.72.145.44 查询不更新
#hwclock --systohc  将机器硬件时钟同步为系统时钟


本文转自 houzaicunsky 51CTO博客,原文链接:http://blog.51cto.com/hzcsky/475619


相关文章
|
2月前
|
缓存 关系型数据库 MySQL
百度搜索:蓝易云【CentOS8服务器安装MySQL报错:no match mysql-community-server】
现在,你已经成功安装了MySQL服务器并解决了"no match mysql-community-server"的报错问题。祝你使用愉快!
43 1
|
3月前
|
Linux
CentOS7.9服务器一键脚本部署FRP内网穿透服务端与客户端
CentOS7.9服务器一键脚本部署FRP内网穿透服务端与客户端
226 0
|
3月前
|
Linux 网络安全
CentOS7服务器SSH登陆时自动显示服务器基础信息
CentOS7服务器SSH登陆时自动显示服务器基础信息
42 0
|
16天前
|
Linux
centos 查看服务器信息 版本cpu
centos 查看服务器信息 版本cpu
12 0
|
1月前
|
Oracle 关系型数据库 Linux
服务器Centos7 静默安装Oracle Database 12.2
服务器Centos7 静默安装Oracle Database 12.2
86 0
|
1月前
|
存储 弹性计算 Linux
阿里云ECS(CentOS镜像)安装docker
阿里云ECS(CentOS镜像)安装docker
385 0
|
3月前
|
Linux 网络安全 数据安全/隐私保护
centos宝塔远程服务器怎么链接?
【1月更文挑战第6天】centos宝塔远程服务器怎么链接?
191 2
|
4月前
|
XML 应用服务中间件 Linux
在一个centos服务器上同时部署tomcat,django,flask
在一个centos服务器上同时部署tomcat,django,flask
72 0
|
Java 应用服务中间件 Linux
Centos7云服务器部署Tomcat
Centos7云服务器部署Tomcat
Centos7云服务器部署Tomcat
|
数据采集 弹性计算 网络协议
[CentOS Python系列] 一.阿里云服务器安装部署及第一个Python爬虫代码实现
本文将详细讲解阿里云服务器如何安装及部署本地Python环境,并搭建代码。
1152 1
[CentOS Python系列] 一.阿里云服务器安装部署及第一个Python爬虫代码实现

热门文章

最新文章