zoukankan      html  css  js  c++  java
  • 时间同步ntp服务的安装与配置

       NTP服务及时间同步服务器,是用来使计算机时间同步化的一种协议,它可以使计算机对其服务器或时钟源(如石英钟,GPS等等)做同步化,下面就来说下如何安装NTP服务

    1.安装ntp服务

    输入下面命令进行安装(如果没网络或者安装速度慢的请设置本地yum源进行安装,设置教程请点击这里查看)

    yum install ntp -y

    修改ntpd服务的配置文件/etc/ntp.conf

    #server 0.centos.pool.ntp.org iburst
    #server 1.centos.pool.ntp.org iburst
    #server 2.centos.pool.ntp.org iburst
    #server 3.centos.pool.ntp.org iburst     (注释掉如上4行,同步自己定义的服务器)
    
    server 192.168.100.3
    server 192.168.100.2 prefer     (prefer优先服务器,可定义多个master同步服务器)
    logfile /var/log/ntp.log     (可选的操作,方便记录日志信息

    启动ntpd服务,并加入到开机启动项

    systemctl start ntpd.service

    将ntp服务加入到开机启动项

    systemctl enable ntpd.service 

    如果我们需要将系统时间同步到硬件时间,还可以使用hwclock -w命令进行同步

  • 相关阅读:
    CodeForces 404C Ivan and Powers of Two
    CodeForces 433C Ryouko's Memory Note-暴力
    if not
    python3的print函数
    交叉熵
    tensorflow一个很好的博客
    关于第几维的问题
    更新软件
    tensorflow训练代码
    tensorflow的一些函数
  • 原文地址:https://www.cnblogs.com/KiraEXA/p/5947057.html
Copyright © 2011-2022 走看看