在初始部署 VMware Cloud Director 應用裝置後,可以變更 NTP 伺服器組態。

程序

  1. root 身分直接登入或使用 SSH 用戶端登入 VMware Cloud Director 應用裝置主控台。
  2. 若要修改 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
  3. 重新啟動 NTP 服務。
    systemctl restart systemd-timesyncd.service -l
  4. 確認該服務正常執行。
    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
    
  5. 將時間同步到 NTP 伺服器。
    ntpdate time_server
  6. 對叢集中的每個應用裝置重複步驟 2 至 5。