{"id":1078,"date":"2024-09-03T14:21:07","date_gmt":"2024-09-03T06:21:07","guid":{"rendered":"https:\/\/www.madbull.site\/?p=1078"},"modified":"2025-06-17T10:28:46","modified_gmt":"2025-06-17T02:28:46","slug":"chrony%e5%ae%9e%e7%8e%b0ntp%e6%97%b6%e9%97%b4%e5%90%8c%e6%ad%a5","status":"publish","type":"post","link":"https:\/\/www.madbull.site\/?p=1078","title":{"rendered":"chrony\u5b9e\u73b0NTP\u65f6\u949f\u540c\u6b65"},"content":{"rendered":"\n<p>\u76f8\u5173\u6587\u6863\u53ef\u4ee5\u53c2\u8003\uff1a<a href=\"https:\/\/chrony-project.org\/documentation.html\">https:\/\/chrony-project.org\/documentation.html<\/a><\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>\u7b2c\u4e00\u6b65\uff1a\u5b89\u88c5chrony<\/strong><\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>yum install chrony \u6216\u8005 apt install chrony<\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>\u7b2c\u4e8c\u6b65\uff1a\u4fee\u6539\u914d\u7f6e<\/strong><\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u6253\u5f00\u914d\u7f6e\u6587\u4ef6\uff1a\/etc\/chrony\/chrony.conf<\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-large-font-size\"><strong>2.1 \u6dfb\u52a0\u65f6\u949f<\/strong><strong>\u540c\u6b65\u7684\u670d\u52a1\u5668<\/strong><\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>pool \u9009\u9879\u8bbe\u7f6e \u4ece\u54ea\u4e2aNTP\u670d\u52a1\u6c60\u4e0a\u540c\u6b65\u65f6\u95f4\uff0c\u4f8b\u5982\u4ece \u963f\u91cc\u4e91 \u4e0a\u540c\u6b65\u65f6\u95f4\u53ef\u5982\u4e0b\u56fe\u8bbe\u7f6e\u3002\u5176\u4e2diburst\u53ef\u5728\u521d\u6b21\u8fde\u63a5\u65f6\u52a0\u901f\u65f6\u95f4\u540c\u6b65\u3002\u57df\u540d \u6216\u8005 IP\u90fd\u53ef\u4ee5\u914d\u7f6e\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"245\" height=\"34\" src=\"https:\/\/www.madbull.site\/wp-content\/uploads\/2024\/09\/\u56fe\u7247-3.png\" alt=\"\" class=\"wp-image-1079\"\/><\/figure>\n\n\n\n<p>\u53ef\u4ee5\u914d\u7f6e\u591a\u4e2aNTP\u65f6\u95f4\u6e90\uff0c\u4ee5\u9632\u6b62\u67d0\u4e00\u4e2a\u65f6\u95f4\u6e90\u65e0\u6cd5\u8fde\u63a5\u6216\u8005\u4e0d\u5de5\u4f5c\u3002\u6bcf\u884c\u4e00\u4e2apool \u914d\u7f6e\u9879\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u662f\u5355\u53f0\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4e0d\u7528 <strong>pool<\/strong> \u4f5c\u4e3a\u5173\u952e\u8bcd\uff0c\u7528 <strong>server<\/strong> \u4e5f\u662f\u53ef\u4ee5\u7684\u3002<\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-large-font-size\"><strong>2.2 \u914d\u7f6e\u5141\u8bb8\u8bbf\u95ee\u7684 \u7f51\u6bb5<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"174\" height=\"28\" src=\"https:\/\/www.madbull.site\/wp-content\/uploads\/2024\/09\/\u56fe\u7247-4.png\" alt=\"\" class=\"wp-image-1080\" style=\"width:174px;height:auto\"\/><\/figure>\n\n\n\n<p>\u589e\u52a0\u6b64\u914d\u7f6e\u9879\uff0c\u5219 chrony \u670d\u52a1\u53ef\u4f5c\u4e3a\u4e00\u4e2a\u65f6\u95f4\u6e90\uff0c\u7ed9\u5176\u4ed6\u7cfb\u7edf\u63d0\u4f9b\u65f6\u95f4\u540c\u6b65\u670d\u52a1\u3002<\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>\u7b2c\u4e09\u6b65\uff1a\u542f\u52a8\uff0c\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8<\/strong><\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>systemctl start chronyd<\/p>\n\n\n\n<p>systemctl enable chronyd<\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--50);margin-bottom:var(--wp--preset--spacing--50);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--20);margin-bottom:var(--wp--preset--spacing--20);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>\u5176\u4ed6\u77e5\u8bc6\u70b9<\/strong><\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u6d4b\u8bd5\u670d\u52a1\u662f\u5426\u53ef\u7528\uff1a<\/p>\n\n\n\n<p><strong>ntpdate -q xx.xx.xx.xx<\/strong><\/p>\n\n\n\n<p>\u5411 xx.xx.xx.xx \u83b7\u53d6\u53ef\u4fe1\u65f6\u95f4\u5e76\u8fdb\u884c\u65f6\u95f4\u540c\u6b65<\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u5f3a\u5236\u540c\u6b65\u4e00\u6b21\u65f6\u949f<\/p>\n\n\n\n<p><strong>chronyc -a makestep<\/strong><\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u67e5\u770b\u8ddf\u8e2a\u72b6\u6001<\/p>\n\n\n\n<p><strong>chronyc tracking<\/strong><\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u68c0\u67e5\u65f6\u949f\u6e90\u8bbe\u7f6e\u4e86\u54ea\u4e9b<\/p>\n\n\n\n<p><strong>chronyc sources -v<\/strong><\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u5982\u679c\u662f\u5c40\u57df\u7f51\uff0c\u65e0\u6cd5\u548c\u5916\u90e8\u7684\u65f6\u949f\u505a\u540c\u6b65\uff0c\u53c8\u9700\u8981\u591a\u53f0\u8bbe\u5907\u65f6\u949f\u540c\u6b65\uff0c\u8fd9\u5c31\u9700\u8981\u62ff\u5176\u4e2d\u4e00\u53f0\u4f5c\u4e3a\u6807\u51c6\uff0c\u5176\u4ed6\u8bbe\u5907\u4ece\u6b64\u8bbe\u5907\u540c\u6b65\u65f6\u95f4\u3002\u9700\u8981\u5bf9\u8fd9\u53f0\u8bbe\u5907\u7684chrony.conf\u914d\u7f6e\u6587\u4ef6\u4e2d\u589e\u52a0\u914d\u7f6e\uff1a<\/p>\n\n\n\n<p><strong>local stratum 10<\/strong><\/p>\n\n\n\n<p><strong>local<\/strong>\uff1a\u6307\u5b9a\u4ee5\u81ea\u5df1\u8bbe\u5907\u7684\u65f6\u95f4\u4f5c\u4e3a\u53ef\u4fe1\u65f6\u95f4\u6e90\u3002<\/p>\n\n\n\n<p><strong>stratum 10<\/strong>\uff1a\u901a\u5e38 Stratum \u7684\u8303\u56f4\u662f 1 \u5230 15\uff0c\u5176\u4e2d 1 \u8868\u793a\u76f4\u63a5\u8fde\u63a5\u5230\u539f\u5b50\u949f\u6216\u5176\u4ed6\u9ad8\u7cbe\u5ea6\u65f6\u95f4\u6e90\uff0c\u6570\u503c\u8d8a\u5927\u8868\u793a\u79bb\u6e90\u5934\u8d8a\u8fdc\u3002\u8bbe\u7f6e\u4e3a 10 \u53ef\u4ee5\u9632\u6b62\u7531\u4e8e\u7f51\u7edc\u95ee\u9898\u5bfc\u81f4\u7684\u4e0d\u53ef\u7528\u60c5\u51b5\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u4e0d\u914d\u7f6e\u672c\u5730\u662f\u53ef\u4fe1\u65f6\u95f4\u6e90\uff0c\u6293123\u7aef\u53e3\u6d41\u91cf\uff0c\u670d\u52a1\u7aef\u7684\u56de\u590d\u5982\u4e0b\u56fe\u3002\u5ba2\u6237\u7aef\u4f1a\u8ba4\u4e3a\u4e0d\u53ef\u4fe1\uff0c\u9ed8\u8ba4\u4e0d\u4f1a\u540c\u6b65\u65f6\u949f\u3002<\/p>\n\n\n\n<div style=\"margin-top:var(--wp--preset--spacing--10);margin-bottom:var(--wp--preset--spacing--10);height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"830\" height=\"469\" src=\"https:\/\/www.madbull.site\/wp-content\/uploads\/2024\/09\/1111.png\" alt=\"\" class=\"wp-image-2142\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c\u4e00\u6b65\uff1a\u5b89\u88c5chrony<\/p>\n<p>yum install chrony \u6216\u8005 apt install chrony<\/p>\n<p>\u7b2c\u4e8c\u6b65\uff1a\u4fee\u6539\u914d\u7f6e<\/p>\n<p>\u6253\u5f00\u914d\u7f6e\u6587\u4ef6\uff1a\/etc\/chrony\/chrony.conf<\/p>\n<p>2.1 \u6dfb\u52a0\u65f6\u95f4\u540c\u6b65\u7684\u670d\u52a1\u5668<\/p>\n<p>pool \u9009\u9879\u8bbe\u7f6e \u4ece\u54ea\u4e2aNTP\u670d\u52a1\u6c60\u4e0a\u540c\u6b65\u65f6\u95f4\uff0c\u4f8b\u5982\u4ece \u963f\u91cc\u4e91 \u4e0a\u540c\u6b65\u65f6\u95f4\u53ef\u5982\u4e0b\u56fe\u8bbe\u7f6e\u3002\u5176\u4e2diburst\u53ef\u5728\u521d\u6b21\u8fde\u63a5\u65f6\u52a0\u901f\u65f6\u95f4\u540c\u6b65\u3002\u57df\u540d \u6216\u8005 IP\u90fd\u53ef\u4ee5\u914d\u7f6e\u3002<\/p>\n","protected":false},"author":1,"featured_media":450,"comment_status":"open","ping_status":"open","sticky":false,"template":"single-with-sidebar","format":"standard","meta":{"footnotes":""},"categories":[135,131],"tags":[424,423,425,152],"class_list":["post-1078","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-131","tag-chrony","tag-ntp","tag-425","tag-152"],"_links":{"self":[{"href":"https:\/\/www.madbull.site\/index.php?rest_route=\/wp\/v2\/posts\/1078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.madbull.site\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.madbull.site\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.madbull.site\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.madbull.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1078"}],"version-history":[{"count":6,"href":"https:\/\/www.madbull.site\/index.php?rest_route=\/wp\/v2\/posts\/1078\/revisions"}],"predecessor-version":[{"id":2143,"href":"https:\/\/www.madbull.site\/index.php?rest_route=\/wp\/v2\/posts\/1078\/revisions\/2143"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.madbull.site\/index.php?rest_route=\/wp\/v2\/media\/450"}],"wp:attachment":[{"href":"https:\/\/www.madbull.site\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1078"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.madbull.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1078"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.madbull.site\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}