控制节点服务器

在控制节点上执行这些步骤。

安装并配置组件

  1. 安装软件包:

    适用于 Ubuntu:

    # apt install chrony
    

    适用于 RHEL 和 CentOS:

    # yum install chrony
    

    适用于 SUSE:

    # zypper install chrony
    
  2. Edit the chrony.conf file and add, change, or remove the following keys as necessary for your environment.

    如果是 RHEL、 CentOS 和 SUSE,编辑 /etc/chrony.conf 文件:

    server NTP_SERVER iburst
    

    如果是Ubuntu, 编辑 /etc/chrony/chrony.conf 文件:

    server NTP_SERVER iburst
    

    使用NTP服务器的主机名或者IP地址替换 NTP_SERVER 。配置支持设置多个 server 值。

    备注

    控制节点默认跟公共服务器池同步时间。但是你也可以选择性配置其他服务器,比如你组织中提供的服务器。

  3. 启用其他节点连接至控制节点的chrony守护进程,将这个配置项加入上面提到的相同配置文件``chrony.conf`` 中

    allow 10.0.0.0/24
    

    如有必要,将 10.0.0.0/24 替换成你子网的相应描述。

  4. 重启 NTP 服务:

    适用于 Ubuntu:

    # service chrony restart
    

    适用于RHEL、 CentOS 和 SUSE:

    # systemctl enable chronyd.service
    # systemctl start chronyd.service