zoukankan      html  css  js  c++  java
  • 使用ntpdate 同步 linux的时间

    1. linux 查看时间和时区的命令

    timedatectl
    
    效果为:
          Local time: Sun 2019-05-05 15:03:03 CST
      Universal time: Sun 2019-05-05 07:03:03 UTC
            RTC time: Sun 2019-05-05 15:03:03
           Time zone: Asia/Shanghai (CST, +0800)
         NTP enabled: no
    NTP synchronized: yes
     RTC in local TZ: no
          DST active: n/a

    2. 之前我的一个虚拟机的时间是错的.

    然后可以使用 ntpdate 的命令进行同步时间

    一开始以为 使用 阿里的可以 但是发现不行.

    找了下这个网站的:

    http://blog.sina.com.cn/s/blog_d6c3f6840102xo3g.html

    第一个站点:

    cn.pool.ntp.org

    才可以了. 

    命令为:

    ntpdate cn.pool.ntp.org

    3. 以后找时间自己搭建一个 ntdp 服务器

    发现我这边linux的服务器上面都应安装了 ntp 的server 了

    3.2 修改一下配置文件, 增加上监听当前机器的地址

    vim /etc/ntp.conf
    
    
    interfacelisten 10.24.101.99

    3.3 启动 服务

    systemctl enable ntpd && systemctl restart ntpd

    3.4 其他机器进行测试验证.

  • 相关阅读:
    多重继承
    单继承
    访问限制方法
    猜字游戏
    getSet方法
    访问限制
    __str__函数
    析构函数
    构造函数二
    选择排序
  • 原文地址:https://www.cnblogs.com/jinanxiaolaohu/p/10813148.html
Copyright © 2011-2022 走看看