為什麼 NTP 時鐘與另一個大陸的 NTP 伺服器不同步?

為什麼 NTP 時鐘與另一個大陸的 NTP 伺服器不同步?

我的 Ubuntu16.04.5 PC位於Delhi, India.

我正在嘗試將我的系統時鐘與美國 NTP 伺服器同步。在我的系統/etc/ntp.conf檔案中,我使用了以下配置:

# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
# pool 0.ubuntu.pool.ntp.org iburst
# pool 1.ubuntu.pool.ntp.org iburst
# pool 2.ubuntu.pool.ntp.org iburst
# pool 3.ubuntu.pool.ntp.org iburst
server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org
server 3.us.pool.ntp.org

# Use Ubuntu's ntp server as a fallback.
# pool ntp.ubuntu.com

的輸出ntpq -p是:

remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*hydrogen.consta 209.51.161.238   2 u   46   64  377  223.270  -93.650  47.200
+horp-bsd01.horp 152.2.133.54     2 u   47   64  377  271.806  -103.56  35.670
 ntpool1.603.new .XFAC.          16 u 1463  512    0    0.000    0.000   0.000
+69.10.161.7     195.205.216.85   3 u   30   64  377  268.569  -95.798  54.450

但我的系統仍然採用印度標準時間 (IST)。我究竟做錯了什麼?

答案1

NTP總是以 UTC 形式分配時間。它位於何處並不重要。

時區適用於您的計算機,不同的使用者可以有不同的時區。在內部,Unix 記錄 UTC 時間。

若要變更時區,請執行sudo dpkg-reconfigure tzdata.

您也可以更改單一命令的時區:

[~]$ TZ=UTC; date
Fri 17 May 07:34:05 UTC 2019
[~]$ TZ=CEST; date
Fri 17 May 07:34:07 CEST 2019
[~]$ TZ=EST; date
Fri 17 May 02:35:03 EST 2019
[~]$ 

這裡我先顯示 UTC 時間,然後是中歐夏令時間(我當地的 TZ),然後是美國東部使用的東部標準時間。

當您選擇 NTP 伺服器時,選擇當地的伺服器.這可能意味著印度伺服器。您希望盡可能低的延遲和低抖動。這可能意味著您應該使用in.pool.ntp.org,除非您有特殊要求。

相關內容