NTPと時刻同期サービス
chronyとtimedatectlを使ってLinuxの時刻をNTPで正確に保ち、ネットワークサービスに同期した時刻が不可欠な理由を理解します。
「NTPと時刻同期サービス」はCoddyKit上の無料Linux Networking & TCP/IP for Developersレッスンです。 これはレッスン4/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはLinux Networking & TCP/IP for Developers学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Linux Networking & TCP/IP for Developersコースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
Why Time Matters
Accurate clocks are essential for networked systems. Logs, TLS certificates, authentication tokens, and distributed databases all break when clocks drift apart. The Network Time Protocol (NTP) keeps them aligned.
How NTP Works
NTP clients query time servers, measure the network round-trip, and gradually adjust the local clock. It corrects for delay so even over the internet machines stay within milliseconds.
Stratum Levels
NTP servers are ranked by stratum. Stratum 0 is a reference clock (like GPS), stratum 1 servers connect directly to it, and each layer below is one step further. Lower stratum means closer to the source.
Checking Time Status
The simplest check is timedatectl, which shows the current time, timezone, and whether NTP synchronization is active.
timedatectl statusEnabling NTP
Turn on automatic synchronization with one command. The system then keeps the clock in sync in the background.
sudo timedatectl set-ntp trueMeet chrony
chrony is the modern NTP implementation used by most Linux distributions. It handles intermittent connections and large time jumps better than the older ntpd.
sudo systemctl status chronydViewing Sources
List the time servers chrony is using and how it rates them with chronyc sources. The asterisk marks the currently selected source.
chronyc sources -vMeasuring Accuracy
chronyc tracking shows how far off the clock is and how it is being corrected, including the estimated offset from true time.
chronyc trackingConfiguring Servers
Edit /etc/chrony/chrony.conf to point at preferred pools or internal time servers, then restart the service. Many setups use the public NTP pool.
pool pool.ntp.org iburstTimezone vs Clock
Time synchronization sets the absolute moment (UTC), while the timezone affects how it is displayed. Set the zone separately and keep the hardware clock in UTC.
sudo timedatectl set-timezone Europe/IstanbulForcing a Sync
After a long downtime the clock may be far off. chronyc makestep forces an immediate correction instead of slowly slewing, useful right after boot.
sudo chronyc makestepQuick Check
Test your NTP knowledge.
Recap
You learned to manage time synchronization.
- NTP keeps clocks aligned, which is critical for logs, TLS, and auth.
- Use
timedatectlto check and enable sync; chrony is the modern daemon. chronyc sourcesandtrackingshow servers and accuracy.
AI チューターと学ぶ Linux Networking & TCP/IP for Developers — 無料
ブラウザでリアルコードを書いて実行し、24/7 の AI チューターから瞬時にサポートを受け、ウェブまたはアプリで続きから学習できます。
- コース
- 12
- レッスン
- 48
よくある質問
「NTPと時刻同期サービス」レッスンは無料ですか?
はい。「NTPと時刻同期サービス」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Linux Networking & TCP/IP for Developersコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Linux Networking & TCP/IP for Developersコースには全4レッスンが含まれています。
「NTPと時刻同期サービス」で何を学びますか?
chronyとtimedatectlを使ってLinuxの時刻をNTPで正確に保ち、ネットワークサービスに同期した時刻が不可欠な理由を理解します。 ブラウザで直接実行するハンズオンコードでLinux Networking & TCP/IP for Developersを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Linux Networking & TCP/IP for Developersを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのLinux Networking & TCP/IP for Developersは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン4/4です。
「NTPと時刻同期サービス」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このLinux Networking & TCP/IP for Developersレッスンでコードを書いて実行できますか?
はい。すべてのLinux Networking & TCP/IP for Developersレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- 安全なリモートアクセスのためのSSH
- HTTP/HTTPSウェブサービス
- DHCPとDNSサービス
- NTPと時刻同期サービス