CentOS中时间同步方法
2011-06-12 19:24
381 查看
在CentOS 5不再区分客户端和服务器,只要配置了NTP,它就会提供NTP服务。
1)确认已经ntp程序包:
# yum install ntp
2)配置时间源
# vi /etc/ntp.conf
server pool.ntp.org #可选择其他优先服务器
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
3)配置是否为其他PC提供时间服务
# vi /etc/ntp.conf
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
4)配置开机时自动运行时间服务
# chkconfig ntpd on
5)启动或停止时间服务
# service ntpd start
# service ntpd stop
# service ntpd restart
6)验证ntp服务已经运行
# pgrep ntpd
7)初始同步
# ntpdate -u time.lib.tsinghua.edu.cn
8)确认同步成功
# ntpq -p
9)同时建议修改一下 /etc/sysconfig/ntpd 文件
# vi /etc/sysconfig/ntpd
SYNC_HWCLOCK=yes
# 改成 yes 吧!这样主机 BIOS 的时间也会跟着一起改变的 !
当然,如果要提供时间服务,还必须相应的设置iptable防火墙的配置。CentOS的时间服务使用udp 123端口。
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/qiujiaqun/archive/2009/08/22/4471644.aspx
1)确认已经ntp程序包:
# yum install ntp
2)配置时间源
# vi /etc/ntp.conf
server pool.ntp.org #可选择其他优先服务器
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
3)配置是否为其他PC提供时间服务
# vi /etc/ntp.conf
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
4)配置开机时自动运行时间服务
# chkconfig ntpd on
5)启动或停止时间服务
# service ntpd start
# service ntpd stop
# service ntpd restart
6)验证ntp服务已经运行
# pgrep ntpd
7)初始同步
# ntpdate -u time.lib.tsinghua.edu.cn
8)确认同步成功
# ntpq -p
9)同时建议修改一下 /etc/sysconfig/ntpd 文件
# vi /etc/sysconfig/ntpd
SYNC_HWCLOCK=yes
# 改成 yes 吧!这样主机 BIOS 的时间也会跟着一起改变的 !
当然,如果要提供时间服务,还必须相应的设置iptable防火墙的配置。CentOS的时间服务使用udp 123端口。
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/qiujiaqun/archive/2009/08/22/4471644.aspx
相关文章推荐
- 修改CentOS 6环境时区、日期、时间同步方法
- centos时间不同步的解决方法(centos时间同步)
- CentOS 集群自动同步时间的一种方法
- CentOS 同步时间的方法
- CentOS中时间同步方法
- CentOS中时间同步方法
- CentOS6.5 使用ntpd同步时间的方法
- centos时间不同步的解决方法(centos时间同步)
- 在CentOS中设置时间同步的方法
- CentOS中时间同步方法
- VPS的CentOS中时间同步方法
- CentOS 6环境时区、日期、时间同步方法
- centos 7时间同步方法
- centos时间同步方法
- CentOS中服务器时间设为自动同步的方法
- centos时间不同步的解决方法(centos时间同步)
- CentOS集群自动同步时间的一种方法
- CentOS中时间同步方法
- CentOS集群自动同步时间的一种方法
- CentOS 越南韩国服务器时间同步配置方法