• ntp服务


    ntp服务主要是用于对计算机的时间同步管理操作。时间是对服务器来说是很重要的,一般很多网站都需要读取服务器时间来记录相关信息,如果时间不准,则可能造成很大的影响,对于集群,也需要时间同步。

    部署安装NTP服务器

    第一步:安装服务

    [root@ken ~]# yum install ntp -y

    第二步:配置NTP文件

    [root@ken ~]# vim /etc/ntp.conf
      server 127.127.1.0                        #本地时钟地址,以本机作为时间服务器,也可以根据需要选择阿里时间服务器
      restrict 127.0.0.1                        #允许本机使用时间服务器
      restrict 172.20.10.7 mask 255.255.255.240  #允许172.20.10.7使用本机的时间服务器

    第三步:重启NTP服务

    [root@ken ~]# systemctl restart ntpd

    第四步:检查NTP状态

    [root@ken ~]# ntpstat 
    synchronised to local net at stratum 6 
       time correct to within 7948 ms
       polling server every 64 s

    第五步:客户端下载NTP客户端程序

    [root@host1 ~]# yum install ntpdate -y

    第六步:客户端进行同步

    当前服务端时间

    [root@ken ~]# date
    Thu Feb 28 12:22:41 CST 2019

    当前客户端时间

    [root@host1 ~]# date
    Thu Feb 28 20:34:34 CST 2019

    客户端进行时间同步

    [root@host1 ~]# ntpdate 172.20.10.6
    28 Feb 12:24:52 ntpdate[7551]: step time server 172.20.10.6 offset -29488.471623 sec
    [root@host1 ~]# date
    Thu Feb 28 12:25:10 CST 2019

    如果出现下面的错误,稍等再次执行即可

    [root@ken ~]# ntpdate  192.168.1.163
     6 Mar 23:12:36 ntpdate[1541]: no server suitable for synchronization found
  • 相关阅读:
    光与爱的世界
    [家里训练20_02_28]ABC
    [爬虫]美术作业,爬虫和百度图片
    [机器学习]第六、七周记录
    数据类型和对象
    设备对象
    进程、内存线程
    创建符号链接
    SCM管理器
    Nt内核函数原型and中文
  • 原文地址:https://www.cnblogs.com/zhouby/p/10756120.html
Copyright © 2020-2023  润新知