Merge lp:~paelzer/serverguide/serverguide-chrony-18.04 into lp:serverguide/trunk
- serverguide-chrony-18.04
- Merge into trunk
Proposed by
Christian Ehrhardt
Status: | Merged |
---|---|
Approved by: | Doug Smythies |
Approved revision: | 359 |
Merged at revision: | 349 |
Proposed branch: | lp:~paelzer/serverguide/serverguide-chrony-18.04 |
Merge into: | lp:serverguide/trunk |
Diff against target: |
380 lines (+161/-66) 2 files modified
serverguide/C/network-auth.xml (+4/-4) serverguide/C/network-config.xml (+157/-62) |
To merge this branch: | bzr merge lp:~paelzer/serverguide/serverguide-chrony-18.04 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Doug Smythies | Approve | ||
Review via email: mp+338892@code.launchpad.net |
Commit message
Description of the change
Update for 18.04 for the time synchronization chapter
- general 18.04 updates (e.g. new output)
- recommended NTP server changed from ntpd to chrony (LP: #1744072)
- minor cleanups while working at the section
To post a comment you must log in.
Revision history for this message
Simon Déziel (sdeziel) wrote : | # |
LGTM with 2 minor nitpicks.
Revision history for this message
Doug Smythies (dsmythies) wrote : | # |
@Simon: Thank you very much for your diligence. Since I already pushed this one, I'll make edits and push another revision.
Revision history for this message
Simon Déziel (sdeziel) wrote : | # |
Alright, thanks guys.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'serverguide/C/network-auth.xml' | |||
2 | --- serverguide/C/network-auth.xml 2017-11-06 15:28:57 +0000 | |||
3 | +++ serverguide/C/network-auth.xml 2018-02-23 10:55:44 +0000 | |||
4 | @@ -3977,7 +3977,7 @@ | |||
5 | 3977 | <para>The following packages are needed: <emphasis>krb5-user</emphasis>, <emphasis>samba</emphasis>, <emphasis>sssd</emphasis>, and <emphasis>ntp</emphasis>. Samba needs to be installed, even if the system is not exporting shares. The Kerberos realm and FQDN or IP of the domain controllers are needed for this step.</para> | 3977 | <para>The following packages are needed: <emphasis>krb5-user</emphasis>, <emphasis>samba</emphasis>, <emphasis>sssd</emphasis>, and <emphasis>ntp</emphasis>. Samba needs to be installed, even if the system is not exporting shares. The Kerberos realm and FQDN or IP of the domain controllers are needed for this step.</para> |
6 | 3978 | <para>Install these packages now. | 3978 | <para>Install these packages now. |
7 | 3979 | </para> | 3979 | </para> |
9 | 3980 | <screen><command>sudo apt install krb5-user samba sssd ntp</command></screen> | 3980 | <screen><command>sudo apt install krb5-user samba sssd chrony</command></screen> |
10 | 3981 | <para>See the next section for the answers to the questions asked by the <emphasis>krb5-user</emphasis> postinstall script.</para> | 3981 | <para>See the next section for the answers to the questions asked by the <emphasis>krb5-user</emphasis> postinstall script.</para> |
11 | 3982 | </sect2> | 3982 | </sect2> |
12 | 3983 | <sect2 id="sssd-ad-kerberos" status="review"> | 3983 | <sect2 id="sssd-ad-kerberos" status="review"> |
13 | @@ -3997,7 +3997,7 @@ | |||
14 | 3997 | 3997 | ||
15 | 3998 | <para>If default_realm is not specified, it may be necessary to log in with <quote>username@domain</quote> instead of <quote>username</quote>.</para> | 3998 | <para>If default_realm is not specified, it may be necessary to log in with <quote>username@domain</quote> instead of <quote>username</quote>.</para> |
16 | 3999 | 3999 | ||
18 | 4000 | <para>The system time on the Active Directory member needs to be consistent with that of the domain controller, or Kerberos authentication may fail. Ideally, the domain controller server itself will provide the NTP service. Edit <filename>/etc/ntp.conf</filename>:</para> | 4000 | <para>The system time on the Active Directory member needs to be consistent with that of the domain controller, or Kerberos authentication may fail. Ideally, the domain controller server itself will provide the NTP service. Edit <filename>/etc/chrony/chrony.conf</filename>:</para> |
19 | 4001 | 4001 | ||
20 | 4002 | <programlisting> | 4002 | <programlisting> |
21 | 4003 | server dc.myubuntu.example.com | 4003 | server dc.myubuntu.example.com |
22 | @@ -4085,8 +4085,8 @@ | |||
23 | 4085 | 4085 | ||
24 | 4086 | <sect2 id="sssd-ad-join" status="review"> | 4086 | <sect2 id="sssd-ad-join" status="review"> |
25 | 4087 | <title>Join the Active Directory</title> | 4087 | <title>Join the Active Directory</title> |
28 | 4088 | <para>Now, restart ntp and samba and start sssd.</para> | 4088 | <para>Now, restart chrony and samba and start sssd.</para> |
29 | 4089 | <screen><command>sudo systemctl restart ntp.service</command> | 4089 | <screen><command>sudo systemctl restart chrony.service</command> |
30 | 4090 | <command>sudo systemctl restart smbd.service nmbd.service</command> | 4090 | <command>sudo systemctl restart smbd.service nmbd.service</command> |
31 | 4091 | <command>sudo systemctl start sssd.service</command></screen> | 4091 | <command>sudo systemctl start sssd.service</command></screen> |
32 | 4092 | 4092 | ||
33 | 4093 | 4093 | ||
34 | === modified file 'serverguide/C/network-config.xml' | |||
35 | --- serverguide/C/network-config.xml 2017-07-02 17:41:08 +0000 | |||
36 | +++ serverguide/C/network-config.xml 2018-02-23 10:55:44 +0000 | |||
37 | @@ -1055,34 +1055,49 @@ | |||
38 | 1055 | </sect1> | 1055 | </sect1> |
39 | 1056 | 1056 | ||
40 | 1057 | <sect1 id="NTP" status="review"> | 1057 | <sect1 id="NTP" status="review"> |
42 | 1058 | <title>Time Synchronisation</title> | 1058 | <title>Time Synchronization</title> |
43 | 1059 | <para> | 1059 | <para> |
45 | 1060 | NTP is a TCP/IP protocol for synchronising time over a network. Basically a client requests the current time from a server, and uses it to set its own clock. | 1060 | NTP is a TCP/IP protocol for synchronizing time over a network. Basically a client requests the current time from a server, and uses it to set its own clock. |
46 | 1061 | </para> | 1061 | </para> |
47 | 1062 | <para> | 1062 | <para> |
48 | 1063 | Behind this simple description, there is a lot of complexity - there are tiers of NTP servers, with the tier one NTP servers connected to atomic clocks, and tier two and three servers spreading the load of actually handling requests across the Internet. Also the client software is a lot more complex than you might think - it has to factor out communication delays, and adjust the time in a way that does not upset all the other processes that run on the server. But luckily all that complexity is hidden from you! | 1063 | Behind this simple description, there is a lot of complexity - there are tiers of NTP servers, with the tier one NTP servers connected to atomic clocks, and tier two and three servers spreading the load of actually handling requests across the Internet. Also the client software is a lot more complex than you might think - it has to factor out communication delays, and adjust the time in a way that does not upset all the other processes that run on the server. But luckily all that complexity is hidden from you! |
49 | 1064 | </para> | 1064 | </para> |
50 | 1065 | <para> | 1065 | <para> |
52 | 1066 | Ubuntu by default uses <emphasis>timedatectl / timesyncd</emphasis> to synchronize time and users can optionally use ntpd to serve network time info. | 1066 | Ubuntu by default uses <emphasis>timedatectl / timesyncd</emphasis> to synchronize time and users can optionally use chrony to <xref linkend="timeservers"/>. |
53 | 1067 | </para> | 1067 | </para> |
54 | 1068 | 1068 | ||
55 | 1069 | <sect2 id="timedate-info" status="review"> | 1069 | <sect2 id="timedate-info" status="review"> |
56 | 1070 | <title>Synchronizing your systems time</title> | 1070 | <title>Synchronizing your systems time</title> |
57 | 1071 | <para> | 1071 | <para> |
59 | 1072 | Starting with Ubuntu 16.04 <emphasis>timedatectl / timesyncd</emphasis> (which are part of systemd) replace most of <emphasis>ntpdate / ntp</emphasis>. | 1072 | Since Ubuntu 16.04 <emphasis>timedatectl / timesyncd</emphasis> (which are part of systemd) replace most of <emphasis>ntpdate / ntp</emphasis>. |
60 | 1073 | </para> | 1073 | </para> |
61 | 1074 | <para> | 1074 | <para> |
63 | 1075 | <application>timesyncd</application> is available by default and replaces not only <application>ntpdate</application>, but also the client portion of <application>ntpd</application>. | 1075 | <application>timesyncd</application> is available by default and replaces not only <application>ntpdate</application>, but also the client portion of <application>chrony</application> (or formerly <application>ntpd</application>). |
64 | 1076 | So on top of the one-shot action that <application>ntpdate</application> provided on boot and network activation, now <application>timesyncd</application> by default regularly checks and keeps your local time in sync. | 1076 | So on top of the one-shot action that <application>ntpdate</application> provided on boot and network activation, now <application>timesyncd</application> by default regularly checks and keeps your local time in sync. |
65 | 1077 | It also stores time updates locally, so that after reboots monotonically advances if applicable. | 1077 | It also stores time updates locally, so that after reboots monotonically advances if applicable. |
66 | 1078 | </para> | 1078 | </para> |
67 | 1079 | <para> | 1079 | <para> |
70 | 1080 | If <application>ntpdate / ntp</application> are installed <application>timedatectl</application> steps back to let you keep your old setup. | 1080 | If <application>chrony</application> is installed <application>timedatectl</application> steps back to let chrony do the time keeping. |
71 | 1081 | That shall ensure that no two time syncing services are fighting and also to retain any kind of old behaviour/config that you had through an upgrade. | 1081 | That shall ensure that no two time syncing services are fighting. |
72 | 1082 | While no more recommended to be used, this still also applies to <application>ntpd</application> being installed to retain any kind of old behavior/config that you had through an upgrade. | ||
73 | 1082 | But it also implies that on an upgrade from a former release ntp/ntpdate might still be installed and therefore renders the new systemd based services disabled. | 1083 | But it also implies that on an upgrade from a former release ntp/ntpdate might still be installed and therefore renders the new systemd based services disabled. |
74 | 1083 | </para> | 1084 | </para> |
75 | 1084 | <para> | 1085 | <para> |
77 | 1085 | <application>ntpdate</application> is considered deprecated in favour of <application>timedatectl</application> and thereby no more installed by default. | 1086 | <application>ntpdate</application> is considered deprecated in favor of <application>timedatectl</application> (or <application>chrony</application>) and thereby no more installed by default. |
78 | 1087 | timesyncd will generally do the right thing keeping your time in sync, and <application>chrony</application> will help with more complex cases. | ||
79 | 1088 | But if you had one of a few known special ntpdate use cases, consider the following: | ||
80 | 1089 | <itemizedlist> | ||
81 | 1090 | <listitem> | ||
82 | 1091 | <para> | ||
83 | 1092 | If you require a one-shot sync use: <command>chronyd -q</command> | ||
84 | 1093 | </para> | ||
85 | 1094 | </listitem> | ||
86 | 1095 | <listitem> | ||
87 | 1096 | <para> | ||
88 | 1097 | If you require a one-shot time check, without setting the time use: <command>chronyd -Q</command> | ||
89 | 1098 | </para> | ||
90 | 1099 | </listitem> | ||
91 | 1100 | </itemizedlist> | ||
92 | 1086 | </para> | 1101 | </para> |
93 | 1087 | 1102 | ||
94 | 1088 | <sect3 id="timedate-config" status="review"> | 1103 | <sect3 id="timedate-config" status="review"> |
95 | @@ -1090,16 +1105,20 @@ | |||
96 | 1090 | <para> | 1105 | <para> |
97 | 1091 | The current status of time and time configuration via <application>timedatectl</application> and <application>timesyncd</application> can be checked with <command>timedatectl status</command>. | 1106 | The current status of time and time configuration via <application>timedatectl</application> and <application>timesyncd</application> can be checked with <command>timedatectl status</command>. |
98 | 1092 | </para> | 1107 | </para> |
100 | 1093 | <screen> | 1108 | <screen> |
101 | 1094 | $ timedatectl status | 1109 | $ timedatectl status |
110 | 1095 | Local time: Mo 2017-06-26 12:16:16 CEST | 1110 | Local time: Fr 2018-02-23 08:47:13 UTC |
111 | 1096 | Universal time: Mo 2017-06-26 10:16:16 UTC | 1111 | Universal time: Fr 2018-02-23 08:47:13 UTC |
112 | 1097 | RTC time: Mo 2017-06-26 10:16:16 | 1112 | RTC time: Fr 2018-02-23 08:47:13 |
113 | 1098 | Time zone: Europe/Berlin (CEST, +0200) | 1113 | Time zone: Etc/UTC (UTC, +0000) |
114 | 1099 | Network time on: yes | 1114 | System clock synchronized: yes |
115 | 1100 | NTP synchronized: yes | 1115 | systemd-timesyncd.service active: yes |
116 | 1101 | RTC in local TZ: no | 1116 | RTC in local TZ: no |
117 | 1102 | </screen> | 1117 | |
118 | 1118 | If chrony is running it will automatically switch to: | ||
119 | 1119 | [...] | ||
120 | 1120 | systemd-timesyncd.service active: no | ||
121 | 1121 | </screen> | ||
122 | 1103 | <para> | 1122 | <para> |
123 | 1104 | Via <application>timedatectl</application> an admin can control the timezone, how the system clock should relate to the hwclock and if permanent synronization should be enabled or not. | 1123 | Via <application>timedatectl</application> an admin can control the timezone, how the system clock should relate to the hwclock and if permanent synronization should be enabled or not. |
124 | 1105 | See <command>man timedatectl</command> for more details. | 1124 | See <command>man timedatectl</command> for more details. |
125 | @@ -1108,62 +1127,75 @@ | |||
126 | 1108 | timesyncd itself is still a normal service, so you can check its status also more in detail via. | 1127 | timesyncd itself is still a normal service, so you can check its status also more in detail via. |
127 | 1109 | <screen> | 1128 | <screen> |
128 | 1110 | $ systemctl status systemd-timesyncd | 1129 | $ systemctl status systemd-timesyncd |
130 | 1111 | . systemd-timesyncd.service - Network Time Synchronization | 1130 | systemd-timesyncd.service - Network Time Synchronization |
131 | 1112 | Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled) | 1131 | Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled) |
135 | 1113 | Drop-In: /lib/systemd/system/systemd-timesyncd.service.d | 1132 | Active: active (running) since Fri 2018-02-23 08:55:46 UTC; 10s ago |
133 | 1114 | |_disable-with-time-daemon.conf | ||
134 | 1115 | Active: active (running) since Mo 2017-06-26 11:12:19 CEST; 30min ago | ||
136 | 1116 | Docs: man:systemd-timesyncd.service(8) | 1133 | Docs: man:systemd-timesyncd.service(8) |
142 | 1117 | Main PID: 12379 (systemd-timesyn) | 1134 | Main PID: 3744 (systemd-timesyn) |
143 | 1118 | Status: "Synchronized to time server [2001:67c:1560:8003::c8]:123 (ntp.ubuntu.com)." | 1135 | Status: "Synchronized to time server 91.189.89.198:123 (ntp.ubuntu.com)." |
144 | 1119 | Tasks: 2 | 1136 | Tasks: 2 (limit: 4915) |
140 | 1120 | Memory: 424.0K | ||
141 | 1121 | CPU: 12ms | ||
145 | 1122 | CGroup: /system.slice/systemd-timesyncd.service | 1137 | CGroup: /system.slice/systemd-timesyncd.service |
147 | 1123 | |_12379 /lib/systemd/systemd-timesyncd | 1138 | └─3744 /lib/systemd/systemd-timesyncd |
148 | 1124 | 1139 | ||
152 | 1125 | Jun 26 11:12:19 lap systemd[1]: Starting Network Time Synchronization... | 1140 | Feb 23 08:55:46 bionic-test systemd[1]: Starting Network Time Synchronization... |
153 | 1126 | Jun 26 11:12:19 lap systemd[1]: Started Network Time Synchronization. | 1141 | Feb 23 08:55:46 bionic-test systemd[1]: Started Network Time Synchronization. |
154 | 1127 | Jun 26 11:12:19 lap systemd-timesyncd[12379]: Synchronized to time server [2001:67c:1560:8003::c8]:123 (ntp.ubuntu.com). | 1142 | Feb 23 08:55:46 bionic-test systemd-timesyncd[3744]: Synchronized to time server 91.189.89.198:123 (ntp.ubuntu.com). |
155 | 1128 | </screen> | 1143 | </screen> |
156 | 1129 | </para> | 1144 | </para> |
157 | 1130 | <para> | 1145 | <para> |
158 | 1131 | The nameserver to fetch time for <application>timedatectl</application> and <application>timesyncd</application> from can be specified in <filename>/etc/systemd/timesyncd.conf</filename> and additional config files can be stored in <filename>/etc/systemd/timesyncd.conf.d/</filename>. | 1146 | The nameserver to fetch time for <application>timedatectl</application> and <application>timesyncd</application> from can be specified in <filename>/etc/systemd/timesyncd.conf</filename> and additional config files can be stored in <filename>/etc/systemd/timesyncd.conf.d/</filename>. |
159 | 1132 | The entries for NTP= and FallbackNTP= are space separated lists. | 1147 | The entries for NTP= and FallbackNTP= are space separated lists. |
160 | 1148 | See <command>man timesyncd.conf</command> for more. | ||
161 | 1133 | </para> | 1149 | </para> |
162 | 1134 | </sect3> | 1150 | </sect3> |
163 | 1135 | 1151 | ||
164 | 1136 | </sect2> | 1152 | </sect2> |
165 | 1137 | 1153 | ||
166 | 1138 | <sect2 id="timeservers" status="review"> | 1154 | <sect2 id="timeservers" status="review"> |
168 | 1139 | <title>Serving NTP</title> | 1155 | <title>Serve the Network Time Protocol</title> |
169 | 1140 | <para> | 1156 | <para> |
171 | 1141 | If on top of synchronizing your system you also want to serve NTP information you need an ntp server. The most classic and supported one is <application>ntpd</application>, but it is also very old so there also are <application>openntpd</application> and <application>chrony</application> as alternatives available in the archive. | 1157 | If in addition to synchronizing your system you also want to serve NTP information you need an NTP server. There are several options with <application>chrony</application>, <application>ntpd</application> and <application>open-ntp</application>. |
172 | 1158 | The recommended solution <application>chrony</application>. | ||
173 | 1142 | </para> | 1159 | </para> |
174 | 1143 | 1160 | ||
177 | 1144 | <sect3 id="ntpd" status="review"> | 1161 | <sect3 id="chrony" status="review"> |
178 | 1145 | <title>ntpd</title> | 1162 | <title>chrony(d)</title> |
179 | 1146 | <para> | 1163 | <para> |
182 | 1147 | The ntp daemon ntpd calculates the drift of your system clock and continuously adjusts it, so there are no large corrections that could | 1164 | The NTP daemon chronyd calculates the drift and offset of your system clock and continuously adjusts it, so there are no large corrections that could |
183 | 1148 | lead to inconsistent logs for instance. The cost is a little processing power and memory, but for a modern server this is negligible. | 1165 | lead to inconsistent logs for instance. The cost is a little processing power and memory, but for a modern server this is usually negligible. |
184 | 1149 | </para> | 1166 | </para> |
185 | 1150 | </sect3> | 1167 | </sect3> |
186 | 1151 | 1168 | ||
188 | 1152 | <sect3 id="ntp-installation" status="review"> | 1169 | <sect3 id="chrony-installation" status="review"> |
189 | 1153 | <title>Installation</title> | 1170 | <title>Installation</title> |
190 | 1154 | <para> | 1171 | <para> |
192 | 1155 | To install ntpd, from a terminal prompt enter: | 1172 | To install chrony, from a terminal prompt enter: |
193 | 1156 | </para> | 1173 | </para> |
194 | 1157 | <screen> | 1174 | <screen> |
196 | 1158 | <command>sudo apt install ntp</command> | 1175 | <command>sudo apt install chrony</command> |
197 | 1159 | </screen> | 1176 | </screen> |
198 | 1177 | <para> | ||
199 | 1178 | This will provide two binaries: | ||
200 | 1179 | <itemizedlist> | ||
201 | 1180 | <listitem> | ||
202 | 1181 | <para> | ||
203 | 1182 | chronyd - the actual daemon to sync and serve via the NTP protocol | ||
204 | 1183 | </para> | ||
205 | 1184 | </listitem> | ||
206 | 1185 | <listitem> | ||
207 | 1186 | <para> | ||
208 | 1187 | chronyc - command-line interface for chrony daemon | ||
209 | 1188 | </para> | ||
210 | 1189 | </listitem> | ||
211 | 1190 | </itemizedlist> | ||
212 | 1191 | </para> | ||
213 | 1160 | </sect3> | 1192 | </sect3> |
214 | 1161 | 1193 | ||
215 | 1162 | <sect3 id="timeservers-conf" status="review"> | 1194 | <sect3 id="timeservers-conf" status="review"> |
217 | 1163 | <title>Configuration</title> | 1195 | <title>Chronyd Configuration</title> |
218 | 1164 | 1196 | ||
219 | 1165 | <para> | 1197 | <para> |
221 | 1166 | Edit <filename>/etc/ntp.conf</filename> to add/remove server lines. | 1198 | Edit <filename>/etc/chrony/chrony.conf</filename> to add/remove server lines. |
222 | 1167 | By default these servers are configured: | 1199 | By default these servers are configured: |
223 | 1168 | </para> | 1200 | </para> |
224 | 1169 | 1201 | ||
225 | @@ -1171,21 +1203,21 @@ | |||
226 | 1171 | # Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board | 1203 | # Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board |
227 | 1172 | # on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for | 1204 | # on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for |
228 | 1173 | # more information. | 1205 | # more information. |
233 | 1174 | server 0.ubuntu.pool.ntp.org | 1206 | pool 0.ubuntu.pool.ntp.org iburst |
234 | 1175 | server 1.ubuntu.pool.ntp.org | 1207 | pool 1.ubuntu.pool.ntp.org iburst |
235 | 1176 | server 2.ubuntu.pool.ntp.org | 1208 | pool 2.ubuntu.pool.ntp.org iburst |
236 | 1177 | server 3.ubuntu.pool.ntp.org | 1209 | pool 3.ubuntu.pool.ntp.org iburst |
237 | 1178 | </programlisting> | 1210 | </programlisting> |
238 | 1179 | 1211 | ||
239 | 1180 | <para> | 1212 | <para> |
242 | 1181 | After changing the config file you have to reload the | 1213 | See <command>man chrony.conf</command> for more details on the configuration options. |
243 | 1182 | <application>ntpd</application>: | 1214 | After changing the any of the config file you have to reload <application>chrony</application>: |
244 | 1183 | </para> | 1215 | </para> |
245 | 1184 | <screen> | 1216 | <screen> |
247 | 1185 | <command>sudo systemctl reload ntp.service</command> | 1217 | <command>sudo systemctl restart chrony.service</command> |
248 | 1186 | </screen> | 1218 | </screen> |
249 | 1187 | <para> | 1219 | <para> |
251 | 1188 | Of the pool number 2.ubuntu.pool.ntp.org as well as ntp.ubuntu.com also support ipv6 if needed. | 1220 | Of the pool 2.ubuntu.pool.ntp.org as well as ntp.ubuntu.com also support ipv6 if needed. |
252 | 1189 | If one needs to force ipv6 there also is ipv6.ntp.ubuntu.com which is not configured by default. | 1221 | If one needs to force ipv6 there also is ipv6.ntp.ubuntu.com which is not configured by default. |
253 | 1190 | </para> | 1222 | </para> |
254 | 1191 | 1223 | ||
255 | @@ -1194,26 +1226,79 @@ | |||
256 | 1194 | <sect3 id="ntp-status" status="review"> | 1226 | <sect3 id="ntp-status" status="review"> |
257 | 1195 | <title>View status</title> | 1227 | <title>View status</title> |
258 | 1196 | <para> | 1228 | <para> |
260 | 1197 | Use ntpq to see more info: | 1229 | Use chronyc to see query the status of the chrony daemon. |
261 | 1230 | For example to get an overview of the currently available and selected time sources. | ||
262 | 1231 | </para> | ||
263 | 1232 | <para> | ||
264 | 1198 | </para> | 1233 | </para> |
265 | 1199 | <screen> | 1234 | <screen> |
268 | 1200 | <command># sudo ntpq -p</command> | 1235 | <command>chronyc sources</command> |
269 | 1201 | <computeroutput> remote refid st t when poll reach delay offset jitter | 1236 | <computeroutput> |
270 | 1237 | MS Name/IP address Stratum Poll Reach LastRx Last sample | ||
271 | 1238 | =============================================================================== | ||
272 | 1239 | ^+ gamma.rueckgr.at 2 8 377 135 -1048us[-1048us] +/- 29ms | ||
273 | 1240 | ^- 2b.ncomputers.org 2 8 377 204 -1141us[-1124us] +/- 50ms | ||
274 | 1241 | ^+ www.kashra.com 2 8 377 139 +3483us[+3483us] +/- 18ms | ||
275 | 1242 | ^+ stratum2-4.NTP.TechFak.U> 2 8 377 143 -2090us[-2073us] +/- 19ms | ||
276 | 1243 | ^- zepto.mcl.gg 2 7 377 9 -774us[ -774us] +/- 29ms | ||
277 | 1244 | ^- mirrorhost.pw 2 7 377 78 -660us[ -660us] +/- 53ms | ||
278 | 1245 | ^- atto.mcl.gg 2 7 377 8 -823us[ -823us] +/- 50ms | ||
279 | 1246 | ^- static.140.107.46.78.cli> 2 8 377 9 -1503us[-1503us] +/- 45ms | ||
280 | 1247 | ^- 4.53.160.75 2 8 377 137 -11ms[ -11ms] +/- 117ms | ||
281 | 1248 | ^- 37.44.185.42 3 7 377 10 -3274us[-3274us] +/- 70ms | ||
282 | 1249 | ^- bagnikita.com 2 7 377 74 +3131us[+3131us] +/- 71ms | ||
283 | 1250 | ^- europa.ellipse.net 2 8 377 204 -790us[ -773us] +/- 97ms | ||
284 | 1251 | ^- tethys.hot-chilli.net 2 8 377 141 -797us[ -797us] +/- 59ms | ||
285 | 1252 | ^- 66-232-97-8.static.hvvc.> 2 7 377 206 +1669us[+1686us] +/- 133ms | ||
286 | 1253 | ^+ 85.199.214.102 1 8 377 205 +175us[ +192us] +/- 12ms | ||
287 | 1254 | ^* 46-243-26-34.tangos.nl 1 8 377 141 -123us[ -106us] +/- 10ms | ||
288 | 1255 | ^- pugot.canonical.com 2 8 377 21 -95us[ -95us] +/- 57ms | ||
289 | 1256 | ^- alphyn.canonical.com 2 6 377 23 -1569us[-1569us] +/- 79ms | ||
290 | 1257 | ^- golem.canonical.com 2 7 377 92 -1018us[-1018us] +/- 31ms | ||
291 | 1258 | ^- chilipepper.canonical.com 2 8 377 21 -1106us[-1106us] +/- 27ms | ||
292 | 1259 | </computeroutput> | ||
293 | 1260 | <command>chronyc sourcestats</command> | ||
294 | 1261 | <computeroutput> | ||
295 | 1262 | 210 Number of sources = 20 | ||
296 | 1263 | Name/IP Address NP NR Span Frequency Freq Skew Offset Std Dev | ||
297 | 1202 | ============================================================================== | 1264 | ============================================================================== |
303 | 1203 | +stratum2-2.NTP. 129.70.130.70 2 u 5 64 377 68.461 -44.274 110.334 | 1265 | gamma.rueckgr.at 25 15 32m -0.007 0.142 -878us 106us |
304 | 1204 | +ntp2.m-online.n 212.18.1.106 2 u 5 64 377 54.629 -27.318 78.882 | 1266 | 2b.ncomputers.org 26 16 35m -0.132 0.283 -1169us 256us |
305 | 1205 | *145.253.66.170 .DCFa. 1 u 10 64 377 83.607 -30.159 68.343 | 1267 | www.kashra.com 25 15 32m -0.092 0.259 +3426us 195us |
306 | 1206 | +stratum2-3.NTP. 129.70.130.70 2 u 5 64 357 68.795 -68.168 104.612 | 1268 | stratum2-4.NTP.TechFak.U> 25 14 32m -0.018 0.130 -2056us 96us |
307 | 1207 | +europium.canoni 193.79.237.14 2 u 63 64 337 81.534 -67.968 92.792</computeroutput> | 1269 | zepto.mcl.gg 13 11 21m +0.148 0.196 -683us 66us |
308 | 1270 | mirrorhost.pw 6 5 645 +0.117 0.445 -591us 19us | ||
309 | 1271 | atto.mcl.gg 21 13 25m -0.069 0.199 -904us 103us | ||
310 | 1272 | static.140.107.46.78.cli> 25 18 34m -0.005 0.094 -1526us 78us | ||
311 | 1273 | 4.53.160.75 25 10 32m +0.412 0.110 -11ms 84us | ||
312 | 1274 | 37.44.185.42 24 12 30m -0.983 0.173 -3718us 122us | ||
313 | 1275 | bagnikita.com 17 7 31m -0.132 0.217 +3527us 139us | ||
314 | 1276 | europa.ellipse.net 26 15 35m +0.038 0.553 -473us 424us | ||
315 | 1277 | tethys.hot-chilli.net 25 11 32m -0.094 0.110 -864us 88us | ||
316 | 1278 | 66-232-97-8.static.hvvc.> 20 11 35m -0.116 0.165 +1561us 109us | ||
317 | 1279 | 85.199.214.102 26 11 35m -0.054 0.390 +129us 343us | ||
318 | 1280 | 46-243-26-34.tangos.nl 25 16 32m +0.129 0.297 -307us 198us | ||
319 | 1281 | pugot.canonical.com 25 14 34m -0.271 0.176 -143us 135us | ||
320 | 1282 | alphyn.canonical.com 17 11 1100 -0.087 0.360 -1749us 114us | ||
321 | 1283 | golem.canonical.com 23 12 30m +0.057 0.370 -988us 229us | ||
322 | 1284 | chilipepper.canonical.com 25 18 34m -0.084 0.224 -1116us 169us | ||
323 | 1285 | </computeroutput> | ||
324 | 1208 | </screen> | 1286 | </screen> |
326 | 1209 | 1287 | <para> | |
327 | 1288 | Certain chronyc commands are privileged and can not be run via the network without explicitly allowing them. | ||
328 | 1289 | See section <emphasis>Command and monitoring access</emphasis> in <command>man chrony.conf</command> for more details. | ||
329 | 1290 | A local admin can use <application>sudo</application> as usually as this will grant him access to the local admin socket <filename>/var/run/chrony/chronyd.sock</filename>. | ||
330 | 1291 | </para> | ||
331 | 1210 | </sect3> | 1292 | </sect3> |
332 | 1211 | 1293 | ||
333 | 1212 | <sect3 id="ntp-pps" status="review"> | 1294 | <sect3 id="ntp-pps" status="review"> |
334 | 1213 | <title>PPS Support</title> | 1295 | <title>PPS Support</title> |
335 | 1214 | <para> | 1296 | <para> |
338 | 1215 | Since 16.04 ntp supports PPS discipline which can be used to augment ntp with local timesources for better accuracy. | 1297 | Chrony supports various PPS types natively. It can use kernel PPS API as well as PTP hardware clock. |
339 | 1216 | For more details on configuration see the external pps ressource listed below. | 1298 | Most general GPS receivers can be leveraged via <application>GPSD</application>. |
340 | 1299 | The latter (and potentially more) can be accessed via <emphasis>SHM</emphasis> or via a <emphasis>socket</emphasis> (recommended). | ||
341 | 1300 | All of the above can be used to augment chrony with additional high quality time sources for better accuracy, jitter, drift, longer-or-short term accuracy (Usually each kind of clock type is good at one of those, but non-perfect at the others). | ||
342 | 1301 | For more details on configuration see some of the external PPS/GPSD resource listed below. | ||
343 | 1217 | </para> | 1302 | </para> |
344 | 1218 | </sect3> | 1303 | </sect3> |
345 | 1219 | </sect2> | 1304 | </sect2> |
346 | @@ -1225,7 +1310,7 @@ | |||
347 | 1225 | <itemizedlist> | 1310 | <itemizedlist> |
348 | 1226 | <listitem> | 1311 | <listitem> |
349 | 1227 | <para> | 1312 | <para> |
351 | 1228 | See the <ulink url="https://help.ubuntu.com/community/UbuntuTime">Ubuntu Time</ulink> wiki page for more information. | 1313 | <ulink url="https://chrony.tuxfamily.org/faq.html">Chrony FAQ</ulink> |
352 | 1229 | </para> | 1314 | </para> |
353 | 1230 | </listitem> | 1315 | </listitem> |
354 | 1231 | <listitem> | 1316 | <listitem> |
355 | @@ -1235,6 +1320,11 @@ | |||
356 | 1235 | </listitem> | 1320 | </listitem> |
357 | 1236 | <listitem> | 1321 | <listitem> |
358 | 1237 | <para> | 1322 | <para> |
359 | 1323 | <ulink url="http://www.pool.ntp.org/">The pool.ntp.org projecti, being a big virtual cluster of timeservers.</ulink> | ||
360 | 1324 | </para> | ||
361 | 1325 | </listitem> | ||
362 | 1326 | <listitem> | ||
363 | 1327 | <para> | ||
364 | 1238 | <ulink url="https://www.freedesktop.org/software/systemd/man/timedatectl.html">Freedesktop.org info on timedatectl</ulink> | 1328 | <ulink url="https://www.freedesktop.org/software/systemd/man/timedatectl.html">Freedesktop.org info on timedatectl</ulink> |
365 | 1239 | </para> | 1329 | </para> |
366 | 1240 | </listitem> | 1330 | </listitem> |
367 | @@ -1245,7 +1335,12 @@ | |||
368 | 1245 | </listitem> | 1335 | </listitem> |
369 | 1246 | <listitem> | 1336 | <listitem> |
370 | 1247 | <para> | 1337 | <para> |
372 | 1248 | <ulink url="http://www.ntp.org/ntpfaq/NTP-s-config-adv.htm#S-CONFIG-ADV-PPS">ntp.org faq on configuring PPS</ulink> | 1338 | <ulink url="http://www.catb.org/gpsd/gpsd-time-service-howto.html#_feeding_chrony_from_gpsd">Feeding chrony from GPSD</ulink> |
373 | 1339 | </para> | ||
374 | 1340 | </listitem> | ||
375 | 1341 | <listitem> | ||
376 | 1342 | <para> | ||
377 | 1343 | See the <ulink url="https://help.ubuntu.com/community/UbuntuTime">Ubuntu Time</ulink> wiki page for more information. | ||
378 | 1249 | </para> | 1344 | </para> |
379 | 1250 | </listitem> | 1345 | </listitem> |
380 | 1251 | </itemizedlist> | 1346 | </itemizedlist> |
thanks very much.