linux 下的时间同步服务器NTP
2010-05-13 09:36
218 查看
安装平台:CentOS 5.3 64位
NTP服务器设置
通过yum 安装,也可以直接用安装光盘里的rpm 文件安装
# yum install ntp
配置ntp 配置文件:/etc/ntp.conf
restrict 192.168.1.0子mask 255.255.255.0 nomodify
只需要设置上面这一句即可,上面这一句的意思是允许内网中某一个网段的客户端通过这台ntp服务器同步时间
启动ntp 服务
# /etc/init.d/ntpd start
# /sbin/chkconfig --level 35 ntpd on
查看同步的状态
#ntpstat
synchronised to NTP server (221.7.129.79) at stratum 3
time correct to within 115 ms
polling server every 64 s
出现以上内容时,说明同步成功。
客户端设置
客户端两种方式:一种是用ntpdate 同步,一种是用 ntp 服务同步
1、ntpdate 同步
# yum install ntp
通过crontabe 设置同步频率
*/20 * * * * /root/ntpsync.sh
# cat /root/ntpsync.sh
#!/bin/bash
/usr/sbin/ntpdate 192.168.1.1
/sbin/hwclock -w
192.168.1.1 是内部NTP服务器IP
2、ntp服务同步
# yum install ntp
编辑/etc/ntp.conf
将以下三行注释掉
#server 0.centos.pool.ntp.org
#server 1.centos.pool.ntp.org
#server 2.centos.pool.ntp.org
添加如下这一行
server 192.168.1.1
192.168.1.1 是内部NTP服务器IP
# /etc/init.d/ntpd start
# /sbin/chkconfig --level 35 ntpd on
查看同步状态
# ntpstat
NTP服务器设置
通过yum 安装,也可以直接用安装光盘里的rpm 文件安装
# yum install ntp
配置ntp 配置文件:/etc/ntp.conf
restrict 192.168.1.0子mask 255.255.255.0 nomodify
只需要设置上面这一句即可,上面这一句的意思是允许内网中某一个网段的客户端通过这台ntp服务器同步时间
启动ntp 服务
# /etc/init.d/ntpd start
# /sbin/chkconfig --level 35 ntpd on
查看同步的状态
#ntpstat
synchronised to NTP server (221.7.129.79) at stratum 3
time correct to within 115 ms
polling server every 64 s
出现以上内容时,说明同步成功。
客户端设置
客户端两种方式:一种是用ntpdate 同步,一种是用 ntp 服务同步
1、ntpdate 同步
# yum install ntp
通过crontabe 设置同步频率
*/20 * * * * /root/ntpsync.sh
# cat /root/ntpsync.sh
#!/bin/bash
/usr/sbin/ntpdate 192.168.1.1
/sbin/hwclock -w
192.168.1.1 是内部NTP服务器IP
2、ntp服务同步
# yum install ntp
编辑/etc/ntp.conf
将以下三行注释掉
#server 0.centos.pool.ntp.org
#server 1.centos.pool.ntp.org
#server 2.centos.pool.ntp.org
添加如下这一行
server 192.168.1.1
192.168.1.1 是内部NTP服务器IP
# /etc/init.d/ntpd start
# /sbin/chkconfig --level 35 ntpd on
查看同步状态
# ntpstat
相关文章推荐
- 在 Linux 上使用 NTP 保持精确的时间
- linux NTP 配置时间同步
- Linux下ntpdate时间同步
- Linux的时间设置与同步(NTP)
- ntpdate linux时间同步命令
- Linux下ntpdate时间同步
- 关于linux的ntpdate时间同步失败的解决办法
- linux时间同步ntpd和ntpdate
- linux时间同步,ntpd、ntpdate
- Linux时间设置与NTP服务配置
- ntpdate刷新linux系统时间
- Linux下ntpdate时间同步
- linux时间同步ntp服务的安装与配置
- Linux学习日志day2 part0——搭建NTP服务进行时间管理
- linux时间同步-NTP服务
- Linux内网服务器从Windows通过NTP同步时间
- linux时间同步ntp服务的安装与配置
- 在 Linux 上使用 NTP 保持精确的时间
- ntpdate命令_Linux ntpdate 命令用法详解:使用网络计时协议(NTP)设置日期和时间
- linux NTP 配置时间同步