{"id":14601,"date":"2023-08-30T10:22:14","date_gmt":"2023-08-30T02:22:14","guid":{"rendered":"https:\/\/blog.ywdevops.cn\/?p=14601"},"modified":"2023-08-31T08:48:18","modified_gmt":"2023-08-31T00:48:18","slug":"ntp-2","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2023\/08\/30\/ntp-2\/","title":{"rendered":"linux\u65f6\u95f4\u670d\u52a1\u5668NTP\u642d\u5efa"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">NTP\uff08Network Time Protocol\uff0c\u7f51\u7edc\u65f6\u95f4\u534f\u8bae\uff09\u662f\u7528\u4e8e\u540c\u6b65\u8ba1\u7b97\u673a\u7cfb\u7edf\u65f6\u949f\u7684\u534f\u8bae\u3002\u5728\u914d\u7f6e NTP \u65f6\u95f4\u670d\u52a1\u5668\u65f6\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u4f7f\u7528\u516c\u5171\u7684 NTP \u670d\u52a1\u5668\u6216\u8005\u642d\u5efa\u81ea\u5df1\u7684 NTP \u670d\u52a1\u5668<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u662f\u5185\u7f51\u65e0\u6cd5\u4e0a\u7f51\u7684\u673a\u5668\u9700\u8981\u540c\u6b65\u65f6\u95f4\uff0c\u90a3\u4e48\u53ea\u80fd\u901a\u8fc7\u80fd\u4e0a\u7f51\u7684\u673a\u5668\u6765\u81ea\u5df1\u642d\u5efa\u4e00\u5957NTP\u670d\u52a1\u5668\uff0c\u7136\u540e\u5176\u4f59\u670d\u52a1\u5668\u4ece\u6b64\u673a\u5668\u540c\u6b65\u65f6\u95f4<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u73af\u5883\u51c6\u5907\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>IP\uff1a192.168.51.205\uff1aNTP\u670d\u52a1\u7aef\uff0cCentOS7\u7cfb\u7edf<\/li>\n\n\n\n<li>IP\uff1a192.168.51.91\uff1a  NTP\u5ba2\u6237\u7aef\uff0cCentOS7\u7cfb\u7edf<\/li>\n<\/ul>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\u4e00\u3001\u670d\u52a1\u7aef<\/mark><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u9996\u5148\u67e5\u770bNTP\u670d\u52a1\u7aef\u662f\u5426\u5b89\u88c5\u4e86NTP\u670d\u52a1\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"80\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/1-10.png\" alt=\"\" class=\"wp-image-14605\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/1-10.png 707w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/1-10-300x34.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/1-10-600x68.png 600w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u8be2\u4e0d\u5230\u4efb\u4f55\u5185\u5bb9\uff0c\u8bf4\u660e\u5e76\u672a\u5b89\u88c5<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001\u5b89\u88c5NTP\uff0c\u6267\u884c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum -y install ntp<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001\u7f16\u8f91npt\u914d\u7f6e\u6587\u4ef6\uff0c\u914d\u7f6eNTP\u670d\u52a1\u5668\uff0c\u6bcf\u4e2a\u670d\u52a1\u5668\u5355\u72ec\u4e00\u884c\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"117\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/2-11.png\" alt=\"\" class=\"wp-image-14607\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/2-11.png 707w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/2-11-300x50.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/2-11-600x99.png 600w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u9762\u914d\u7f6e\u4e2d\u7684iburst\u662f\u4e00\u4e2a\u53ef\u9009\u9879\uff0c\u662f\u4e00\u4e2a\u7528\u4e8e\u52a0\u901f\u65f6\u95f4\u540c\u6b65\u8fc7\u7a0b\u7684\u9009\u9879\uff0c\u5f53 NTP \u5ba2\u6237\u7aef\u9996\u6b21\u4e0e NTP \u670d\u52a1\u5668\u5efa\u7acb\u8fde\u63a5\u65f6\uff0c\u5b83\u9700\u8981\u901a\u8fc7\u7f51\u7edc\u4f20\u8f93\u548c\u6821\u51c6\u591a\u4e2a\u65f6\u95f4\u6570\u636e\u5305\u6765\u786e\u5b9a\u51c6\u786e\u7684\u65f6\u95f4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cNTP \u5ba2\u6237\u7aef\u4f1a\u4ee5\u6307\u6570\u589e\u52a0\u7684\u65f6\u95f4\u95f4\u9694\uff08\u901a\u5e38\u4e3a\u6bcf 2 \u7684\u5e42\u6b21\u65b9\u79d2\uff09\u53d1\u9001\u8bf7\u6c42\u4ee5\u8fdb\u884c\u540c\u6b65\uff0c\u800c <code>iburst<\/code> \u9009\u9879\u5141\u8bb8 NTP \u5ba2\u6237\u7aef\u5728\u9996\u6b21\u4e0e\u670d\u52a1\u5668\u5efa\u7acb\u8fde\u63a5\u65f6\uff0c\u4ee5\u66f4\u5feb\u7684\u901f\u5ea6\u8fdb\u884c\u65f6\u95f4\u540c\u6b65\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u5f53 <code>iburst<\/code> \u9009\u9879\u88ab\u6fc0\u6d3b\u65f6\uff0cNTP \u5ba2\u6237\u7aef\u5c06\u5728\u6700\u521d\u4e0e\u670d\u52a1\u5668\u5efa\u7acb\u8fde\u63a5\u540e\u7684\u7b2c\u4e00\u79d2\u5185\u53d1\u9001 8 \u4e2a\u65f6\u95f4\u8bf7\u6c42\uff0c\u4ee5\u52a0\u901f\u540c\u6b65\u8fc7\u7a0b\u3002\u968f\u540e\uff0c\u5b83\u5c06\u6309\u7167\u6b63\u5e38\u7684\u95f4\u9694\uff08\u901a\u5e38\u4e3a\u6bcf 2 \u7684\u5e42\u6b21\u65b9\u79d2\uff09\u7ee7\u7eed\u53d1\u9001\u65f6\u95f4\u8bf7\u6c42\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528 <code>iburst<\/code> \u9009\u9879\u53ef\u4ee5\u5e2e\u52a9\u7f29\u77ed\u65f6\u95f4\u540c\u6b65\u6240\u9700\u7684\u65f6\u95f4\uff0c\u5c24\u5176\u662f\u5728\u9996\u6b21\u4e0e\u670d\u52a1\u5668\u5efa\u7acb\u8fde\u63a5\u65f6\u3002\u8fd9\u5bf9\u4e8e\u5ba2\u6237\u7aef\u5728\u542f\u52a8\u65f6\u6216\u8005\u91cd\u65b0\u8fde\u63a5\u5230\u670d\u52a1\u5668\u65f6\u5feb\u901f\u83b7\u53d6\u51c6\u786e\u65f6\u95f4\u975e\u5e38\u6709\u7528<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9664\u4e86server\u914d\u7f6e\u5916\uff0c\u8fd8\u6709\u5f88\u591a\u5176\u4f59\u914d\u7f6e\uff0c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>driftfile\uff1a\u6307\u5b9a\u4fdd\u5b58\u7cfb\u7edf\u65f6\u949f\u504f\u79fb\u503c\u7684\u6587\u4ef6\u8def\u5f84\u3002\u8be5\u6587\u4ef6\u7528\u4e8e\u8bb0\u5f55\u7cfb\u7edf\u65f6\u949f\u7684\u53d8\u5316\u504f\u79fb\u91cf\nrestrict\uff1a \u7528\u4e8e\u9650\u5236\u4e0e NTP \u670d\u52a1\u5668\u4e4b\u95f4\u7684\u8bbf\u95ee\u6743\u9650\u3002\u53ef\u4ee5\u5b9a\u4e49\u5141\u8bb8\u6216\u7981\u6b62\u7684 IP \u5730\u5740\u3001\u5b50\u7f51\u3001\u5173\u952e\u5b57\u7b49<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">4\u3001\u91cd\u542fNTP\u670d\u52a1\u5668\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart ntpd<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"706\" height=\"243\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/3-12.png\" alt=\"\" class=\"wp-image-14611\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/3-12.png 706w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/3-12-300x103.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/3-12-600x207.png 600w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\u4e8c\u3001\u5ba2\u6237\u7aef<\/mark><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u5728\u5ba2\u6237\u7aef\u670d\u52a1\u5668\u4e0a\u5b89\u88c5ntpdate\uff0c\u5982\u679c\u6ca1\u7f51\u7684\u673a\u5668\u53ea\u80fd\u901a\u8fc7\u4e8c\u8fdb\u5236\u6216\u8005rpm\u5b89\u88c5\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"706\" height=\"136\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/4-9.png\" alt=\"\" class=\"wp-image-14612\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/4-9.png 706w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/4-9-300x58.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/4-9-600x116.png 600w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001\u901a\u8fc7ntpdate\u6765\u8fde\u63a5\u670d\u52a1\u7aef\u5730\u5740\u540c\u6b65\u5373\u53ef\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"73\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/5-8.png\" alt=\"\" class=\"wp-image-14613\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/5-8.png 707w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/5-8-300x31.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/5-8-600x62.png 600w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001\u6700\u540e\u5c06\u8fd9\u6761\u547d\u4ee4\u52a0\u5165\u5230crontab\u4e2d\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"107\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/6-9.png\" alt=\"\" class=\"wp-image-14615\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/6-9.png 709w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/6-9-300x45.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/08\/6-9-600x91.png 600w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u56fe\u8bbe\u7f6e\u7684\u662f\u6bcf\u96945\u5206\u949f\u6267\u884c\u4e00\u6b21\u540c\u6b65\uff0c\u53ef\u6839\u636e\u9700\u8981\u81ea\u884c\u8bbe\u5b9a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NTP\uff08Network Time Protocol\uff0c\u7f51\u7edc\u65f6\u95f4\u534f\u8bae\uff09\u662f\u7528\u4e8e\u540c\u6b65\u8ba1\u7b97\u673a\u7cfb\u7edf\u65f6\u949f\u7684\u534f\u8bae\u3002\u5728\u914d\u7f6e NT [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":14602,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-14601","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/14601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/comments?post=14601"}],"version-history":[{"count":8,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/14601\/revisions"}],"predecessor-version":[{"id":14628,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/14601\/revisions\/14628"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/14602"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=14601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=14601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=14601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}