{"id":1615,"date":"2023-03-25T20:51:44","date_gmt":"2023-03-25T12:51:44","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1615"},"modified":"2023-04-27T21:19:03","modified_gmt":"2023-04-27T13:19:03","slug":"amazon-time-sync-service-to-maintain-time-synchronization","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/25\/amazon-time-sync-service-to-maintain-time-synchronization\/","title":{"rendered":"\u5229\u7528 Amazon Time Sync Service \u4fdd\u6301\u65f6\u95f4\u540c\u6b65"},"content":{"rendered":"<p><code>Amazon Time Sync Service<\/code>\u662f\u4e00\u9879\u901a\u8fc7\u7f51\u7edc\u65f6\u95f4\u534f\u8bae (NTP) \u63d0\u4f9b\u7684\u65f6\u95f4\u540c\u6b65\u670d\u52a1\uff0c\u5728\u6bcf\u4e2a\u533a\u57df\u4f7f\u7528\u5197\u4f59\u7684\u536b\u661f\u8fde\u63a5\u548c\u539f\u5b50\u949f\u6765\u63d0\u4f9b\u9ad8\u7cbe\u5ea6\u7684\u53c2\u8003\u65f6\u949f\u3002\u6b64\u9879\u670d\u52a1\u4e0d\u6536\u53d6\u989d\u5916\u8d39\u7528\uff0c\u5e76\u4e14\u7acb\u5373\u5728\u6240\u6709\u516c\u5171 AWS \u533a\u57df\u4e2d\u63d0\u4f9b\u7ed9\u5728 VPC \u4e2d\u8fd0\u884c\u7684\u6240\u6709\u5b9e\u4f8b\u4f7f\u7528\u3002<\/p>\n<p>\u53ef\u4ee5\u901a\u8fc7\u94fe\u63a5\u672c\u5730<code>169.254.169.123<\/code> IP \u5730\u5740\u8bbf\u95ee\u8be5\u670d\u52a1\u3002\u8fd9\u610f\u5473\u7740\u4e0d\u9700\u8981\u914d\u7f6e\u5916\u90e8 Internet \u8bbf\u95ee\uff0c\u5e76\u4e14\u53ef\u4ee5\u4ece\u79c1\u6709\u5b50\u7f51\u5185\u5b89\u5168\u5730\u8bbf\u95ee\u8be5\u670d\u52a1\u3002<\/p>\n<p><!-- more --><\/p>\n<p>\u53c2\u8003\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/aws.amazon.com\/cn\/blogs\/china\/keeping-time-with-amazon-time-sync-service\/\">https:\/\/aws.amazon.com\/cn\/blogs\/china\/keeping-time-with-amazon-time-sync-service\/<\/a><\/p>\n<h2>\u8bbe\u7f6e<\/h2>\n<p>Chrony \u662f\u53e6\u4e00\u4e2a NTP \u5b9e\u65bd\uff0c\u5b83\u6bd4\u4f7f\u7528 ntpd \u7684\u65b9\u5f0f\u66f4\u5feb\uff1b\u5b83\u80fd\u591f\u66f4\u5feb\u5730\u540c\u6b65\u7cfb\u7edf\u65f6\u949f\uff0c\u5e76\u4e14\u51c6\u786e\u5ea6\u6bd4 ntpd \u66f4\u9ad8\u3002\u63a8\u8350\u4f7f\u7528 Chrony\uff0c\u9664\u975e\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\u800c\u9700\u8981\u4f7f\u7528 ntpd\u3002<\/p>\n<p>\u5728 Amazon Linux \u4e0a\u5b89\u88c5\u548c\u914d\u7f6e Chrony \u975e\u5e38\u7b80\u5355\uff1a<\/p>\n<pre><code>sudo sudo yum erase ntp*\nsudo yum -y install chrony\nsudo service chronyd start<\/code><\/pre>\n<p>\u6b64\u5916\uff0c\u53ea\u9700\u6dfb\u52a0\u884c <code>server 169.254.169.123 prefer iburst<\/code>\u5373\u53ef\u4fee\u6539\u73b0\u6709\u7684 NTP \u914d\u7f6e\u3002<\/p>\n<p>\u5728 Windows \u4e0a\uff0c\u53ef\u4ee5\u5728 PowerShell \u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e0b\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>net stop w32time\nw32tm \/config \/syncfromflags:manual \/manualpeerlist:&quot;169.254.169.123&quot;\nw32tm \/config \/reliable:yess\nnet start w32time<\/code><\/pre>\n<h2>\u95f0\u79d2<\/h2>\n<p>\u65f6\u95f4\u5904\u7406\u662f\u975e\u5e38\u590d\u6742\u7684\u3002\u79d1\u5b66\u9886\u57df\u548c\u793e\u4f1a\u4f7f\u7528\u56fd\u9645\u5929\u4f53\u53c2\u7167\u7cfb (ICRF) \u6765\u6d4b\u91cf\u65f6\u95f4\u3002ICRF \u662f\u4f7f\u7528\u8fdc\u8ddd\u79bb\u7c7b\u661f\u4f53\u7684\u957f\u57fa\u7ebf\u5e72\u6d89\u6d4b\u91cf\u6cd5\u3001GPS \u536b\u661f\u8f68\u9053\u548c\u6708\u7403\u7684\u6fc0\u5149\u6d4b\u8ddd (\u975e\u5e38\u9177\uff01) \u8ba1\u7b97\u5f97\u51fa\u7684\u3002\u5730\u7403\u7684\u65cb\u8f6c\u901f\u5ea6\u4e0d\u89c4\u5219\u4f1a\u5bfc\u81f4 UTC \u76f8\u5bf9\u4e8e ICRF \u53d1\u751f\u65f6\u95f4\u6f02\u79fb\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e00\u65f6\u949f\u6f02\u79fb\u95ee\u9898\uff0c\u56fd\u9645\u5730\u7403\u81ea\u8f6c\u548c\u53c2\u8003\u7cfb (IERS) \u5076\u5c14\u4f1a\u5728 UTC \u4e2d\u5f15\u5165\u989d\u5916\u7684\u79d2\u6570\uff0c\u4f7f\u5176\u4e0e\u5b9e\u65f6\u65f6\u95f4\u7684\u65f6\u95f4\u5dee\u4fdd\u6301\u5728 0.9 \u79d2\u5185\u3002<\/p>\n<p>\u95f0\u79d2\u5df2\u77e5\u4f1a\u5bfc\u81f4\u5e94\u7528\u7a0b\u5e8f\u9519\u8bef\uff0c\u8fd9\u53ef\u80fd\u662f\u8bb8\u591a\u777f\u667a\u7684\u5f00\u53d1\u4eba\u5458\u548c\u7cfb\u7edf\u7ba1\u7406\u5458\u6240\u5173\u5fc3\u7684\u95ee\u9898\u3002<code>169.254.169.123<\/code>\u65f6\u949f\u4f1a\u8c03\u6574\u5728\u4e00\u6bb5\u65f6\u95f4\u540e\u5e26\u6765\u7684\u95f0\u79d2\u95ee\u9898 (\u901a\u5e38\u79f0\u4e3a\u201c\u8df3\u79d2\u201d)\uff0c\u8fd9\u4f7f\u5f97\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u8f7b\u677e\u5730\u5904\u7406\u95f0\u79d2\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Amazon Time Sync Service\u662f\u4e00\u9879\u901a\u8fc7\u7f51\u7edc\u65f6\u95f4\u534f\u8bae (NTP) \u63d0\u4f9b\u7684\u65f6\u95f4\u540c\u6b65\u670d\u52a1\uff0c\u5728\u6bcf\u4e2a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[90],"tags":[400],"class_list":["post-1615","post","type-post","status-publish","format-standard","hentry","category-cloud-devops","tag-aws"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1615","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1615"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1615\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}