在初始部署 VMware Cloud Director 设备后,可以更改 NTP 服务器配置。
过程
- 以 root 身份直接或通过 SSH 客户端登录到 VMware Cloud Director 设备控制台。
- 要修改 NTP 服务器,请编辑 /etc/systemd/timesyncd.conf 文件。
/etc/systemd/timesyncd.conf 文件的内容必须类似于以下内容。要指定多个 NTP 服务器,请使用空格分隔列表。
# This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # Entries in this file show the compile time defaults. # You can change settings by editing this file. # Defaults can be restored by simply deleting this file. # # See timesyncd.conf(5) for details. [Time] #FallbackNTP=time1.sample-time-server.com time2.sample-time-server.com time3.sample-time-server.com time4.sample-time-server.com NTP=time.sample-time-server.com
- 重新启动 NTP 服务。
systemctl restart systemd-timesyncd.service -l
- 确认服务正常运行。
timedatectl status
timedatectl 命令的示例输出。Local time: Tue 2022-12-13 15:29:18 UTC Universal time: Tue 2022-12-13 15:29:18 UTC RTC time: Tue 2022-12-13 15:29:18 Time zone: Etc/UTC (UTC, +0000) Network time on: yes NTP synchronized: yes RTC in local TZ: no
- 将时间同步到 NTP 服务器。
ntpdate time_server
- 对集群中的每个设备重复步骤 2 至 5。