美文网首页
使用NTP时间同步

使用NTP时间同步

作者: boskt | 来源:发表于2019-01-30 17:12 被阅读0次

安装ntp

1.安装软件

># yum install ntp

2.配置ntp启动项

># chkconfig ntpd on

3.同步时间

># ntpdate pool.ntp.org

4.启动ntpd服务

># /etc/init.d/ntpd start

配置时间源

># vi /etc/ntp.conf

 server pool.ntp.org   #可选择其他优先服务器
 server 0.pool.ntp.org
 server 1.pool.ntp.org
 server 2.pool.ntp.org

配置是否为其他PC提供时间服务

># vi /etc/ntp.conf
 restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

验证ntp服务已经运行

># pgrep ntpd

初始同步

># ntpdate -u time.lib.tsinghua.edu.cn

确认同步成功

># ntpq -p

同时建议修改一下 /etc/sysconfig/ntpd 文件

># vi /etc/sysconfig/ntpd
SYNC_HWCLOCK=yes
# 改成yes,这样主机BIOS的时间也会跟着一起改变的!

修改时区

复制相应的时区文件,替换CentOS系统时区文件;或者创建链接文件

># cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

附NTP时间服务器:

210.72.145.44(中国国家授时中心服务器IP地址)

ntp.fudan.edu.cn 为复旦大学的网络时间服务器

相关文章

  • 03-MongoDB集群运维-NTP时间同步

    背景 使用 NTP时间同步操作,避免出现因时间不一致导致集群间数据同步问题 NTP时间同步 测试NTP常用服务器是...

  • 使用NTP时间同步

    安装ntp 1.安装软件 2.配置ntp启动项 3.同步时间 4.启动ntpd服务 配置时间源 配置是否为其他PC...

  • Linux,系统时间设置大法

    方案一: 方案二:使用NTP同步服务器时间

  • linux ntp 同步时间

    文章来自:linux ntp 同步时间,linux ntp时间同步的两种方法[https://blog.csdn....

  • ntp时间同步服务

    ntp时间同步服务 概念 NTP是网络时间协议(Network Time Protocol),它是用来同步网络中各...

  • ntp时间同步

    解决的问题: 保证集群中所有的节点时间一致方案: 需要使用同步软件NTP , 并在主机上开启此服务, 其他节点的...

  • ntp时间同步

    检查是否安装ntpd 安装ntpd 配置ntpd 启动ntpd 查看 查看状态 注意: 这个状态要等上几分钟或者一...

  • ntp时间同步

  • ntp时间同步

    ntp时间同步 介绍如果一个集群中,时间相差很大,那么会出现很多诡异的问题,我们也不想在一个无法解决的问题上浪费几...

  • ntp时间同步

    ntp时间同步 介绍如果一个集群中,时间相差很大,那么会出现很多诡异的问题,我们也不想在一个无法解决的问题上浪费几...

网友评论

      本文标题:使用NTP时间同步

      本文链接:https://www.haomeiwen.com/subject/uoucsqtx.html