NTP \u6709\u8d85\u8fc7 30 \u5e74\u7684\u5386\u53f2\u4e86\uff0c\u5b83\u662f\u81f3\u4eca\u8fd8\u5728\u4f7f\u7528\u7684\u6700\u8001\u7684\u56e0\u7279\u7f51\u534f\u8bae\u4e4b\u4e00\u3002\u5b83\u7684\u7528\u9014\u662f\u4fdd\u6301\u8ba1\u7b97\u673a\u4e0e\u4e16\u754c\u6807\u51c6\u65f6\u95f4\uff08UTC\uff09\u7684\u540c\u6b65\u3002NTP \u7f51\u7edc\u662f\u5206\u5c42\u7ec4\u7ec7\u7684\uff0c\u5e76\u4e14\u540c\u5c42\u7684\u8bbe\u5907\u662f\u5bf9\u7b49\u7684\u3002\u5c42\u6b21Stratum 0 \u5305\u542b\u4e3b\u62a5\u65f6\u8bbe\u5907\uff0c\u6bd4\u5982\uff0c\u539f\u5b50\u949f\u3002\u5c42\u7ea7 1 \u7684\u65f6\u95f4\u670d\u52a1\u5668\u4e0e\u5c42\u7ea7 0 \u7684\u8bbe\u5907\u540c\u6b65\u3002\u5c42\u7ea7 2 \u7684\u8bbe\u5907\u4e0e\u5c42\u7ea7 1 \u7684\u8bbe\u5907\u540c\u6b65\uff0c\u5c42\u7ea7 3 \u7684\u8bbe\u5907\u4e0e\u5c42\u7ea7 2 \u7684\u8bbe\u5907\u540c\u6b65\u3002NTP \u534f\u8bae\u652f\u6301 16 \u4e2a\u5c42\u7ea7\uff0c\u73b0\u5b9e\u4e2d\u5e76\u6ca1\u6709\u4f7f\u7528\u90a3\u4e48\u591a\u7684\u5c42\u7ea7\u3002\u540c\u4e00\u4e2a\u5c42\u7ea7\u7684\u670d\u52a1\u5668\u662f\u76f8\u4e92\u5bf9\u7b49\u7684\u3002<\/p>\n
\u8fc7\u53bb\u5f88\u957f\u4e00\u6bb5\u65f6\u95f4\u5185\uff0c\u6211\u4eec\u90fd\u4e3a\u5ba2\u6237\u7aef\u9009\u62e9\u914d\u7f6e\u5355\u4e00\u7684 NTP \u670d\u52a1\u5668\uff0c\u800c\u73b0\u5728\u66f4\u597d\u7684\u505a\u6cd5\u662f\u4f7f\u7528 NTP \u670d\u52a1\u5668\u5730\u5740\u6c60\uff0c\u5b83\u4f7f\u7528\u8f6e\u8be2\u7684 DNS \u4fe1\u606f\u53bb\u5171\u4eab\u8d1f\u8f7d\u3002\u6c60\u5730\u5740\u53ea\u662f\u4e3a\u5ba2\u6237\u7aef\u670d\u52a1\u7684\uff0c\u6bd4\u5982\u5355\u4e00\u7684 PC \u548c\u4f60\u7684\u672c\u5730\u5c40\u57df\u7f51 NTP \u670d\u52a1\u5668\u3002\u5f53\u4f60\u8fd0\u884c\u4e00\u53f0\u81ea\u5df1\u7684\u516c\u5171\u670d\u52a1\u5668\u65f6\uff0c\u4f60\u4e0d\u7528\u4f7f\u7528\u8fd9\u4e9b\u6c60\u5730\u5740\u3002<\/p>\n
\n
\u516c\u5171 NTP \u670d\u52a1\u5668\u914d\u7f6e<\/h4>\n<\/div>\n
\u8fd0\u884c\u4e00\u53f0\u516c\u5171 NTP \u670d\u52a1\u5668\u53ea\u6709\u4e24\u6b65\uff1a\u8bbe\u7f6e\u4f60\u7684\u670d\u52a1\u5668\uff0c\u7136\u540e\u7533\u8bf7\u52a0\u5165\u5230 NTP \u670d\u52a1\u5668\u6c60\u3002\u8fd0\u884c\u4e00\u53f0\u516c\u5171\u7684 NTP \u670d\u52a1\u5668\u662f\u4e00\u79cd\u5f88\u9ad8\u5c1a\u7684\u884c\u4e3a\uff0c\u4f46\u662f\u4f60\u5f97\u5148\u77e5\u9053\u8fd9\u610f\u5473\u7740\u4ec0\u4e48\u3002\u52a0\u5165 NTP \u670d\u52a1\u5668\u6c60\u662f\u4e00\u79cd\u957f\u671f\u8d23\u4efb\uff0c\u56e0\u4e3a\u5373\u4f7f\u4f60\u52a0\u5165\u670d\u52a1\u5668\u6c60\u540e\uff0c\u8fd0\u884c\u4e86\u5f88\u77ed\u7684\u65f6\u95f4\u9a6c\u4e0a\u9000\u51fa\uff0c\u7136\u540e\u63a5\u4e0b\u6765\u7684\u5f88\u591a\u5e74\u4f60\u4ecd\u7136\u4f1a\u63a5\u6536\u5230\u8bf7\u6c42\u3002<\/p>\n
\u4f60\u9700\u8981\u4e00\u4e2a\u9759\u6001\u7684\u516c\u5171 IP \u5730\u5740\uff0c\u4e00\u4e2a\u81f3\u5c11 512Kb\/s \u5e26\u5bbd\u7684\u3001\u53ef\u9760\u7684\u3001\u6301\u4e45\u7684\u56e0\u7279\u7f51\u8fde\u63a5\u3002NTP \u4f7f\u7528\u7684\u662f UDP \u7684 123 \u7aef\u53e3\u3002\u5b83\u5bf9\u673a\u5668\u672c\u8eab\u8981\u6c42\u5e76\u4e0d\u9ad8\uff0c\u5f88\u591a\u7ba1\u7406\u5458\u5728\u5176\u5b83\u7684\u9762\u5411\u516c\u5171\u7684\u670d\u52a1\u5668\uff08\u6bd4\u5982\uff0cWeb \u670d\u52a1\u5668\uff09\u4e0a\u987a\u5e26\u67b6\u8bbe\u4e86 NTP \u670d\u52a1\u3002<\/p>\n
\u914d\u7f6e\u4e00\u53f0\u516c\u5171\u7684 NTP \u670d\u52a1\u5668\u4e0e\u914d\u7f6e\u4e00\u53f0\u7528\u4e8e\u5c40\u57df\u7f51\u7684 NTP \u670d\u52a1\u5668\u662f\u4e00\u6837\u7684\uff0c\u53ea\u9700\u8981\u51e0\u4e2a\u914d\u7f6e\u3002\u6211\u4eec\u4ece\u9605\u8bfb \u534f\u8bae\u89c4\u5219 \u5f00\u59cb\u3002\u9075\u5b88\u89c4\u5219\u5e76\u6ce8\u610f\u4f60\u7684\u884c\u4e3a\uff1b\u51e0\u4e4e\u6bcf\u4e2a\u65f6\u95f4\u670d\u52a1\u5668\u7684\u7ef4\u62a4\u8005\u90fd\u662f\u50cf\u4f60\u8fd9\u6837\u7684\u5fd7\u613f\u8005\u3002\u7136\u540e\uff0c\u4ece StratumTwoTimeServers \u4e2d\u9009\u62e9 4 \u5230 7 \u4e2a\u5c42\u7ea7 2 \u7684\u4e0a\u6e38\u670d\u52a1\u5668\u3002\u9009\u62e9\u7684\u65f6\u5019\uff0c\u9009\u53d6\u5730\u7406\u4f4d\u7f6e\u4e0a\u9760\u8fd1\uff08\u5c0f\u4e8e 300 \u82f1\u91cc\u7684\uff09\u4f60\u7684\u56e0\u7279\u7f51\u670d\u52a1\u63d0\u4f9b\u5546\u7684\u4e0a\u6e38\u670d\u52a1\u5668\uff0c\u9605\u8bfb\u4ed6\u4eec\u7684\u8bbf\u95ee\u89c4\u5219\uff0c\u7136\u540e\uff0c\u4f7f\u7528 ping\u548c mtr\u53bb\u627e\u5230\u5ef6\u8fdf\u548c\u8df3\u6570\u6700\u5c0f\u7684\u670d\u52a1\u5668\u3002<\/p>\n
\u4ee5\u4e0b\u7684 \/etc\/ntp.conf\u914d\u7f6e\u793a\u4f8b\u6587\u4ef6\uff0c\u5305\u62ec\u4e86 IPv4 \u548c IPv6\uff0c\u4ee5\u53ca\u57fa\u672c\u7684\u5b89\u5168\u9632\u62a4\uff1a<\/p>\n
# stratum 2 server list\r\nserver servername_1 iburst\r\nserver servername_2 iburst\r\nserver servername_3 iburst\r\nserver servername_4 iburst\r\nserver servername_5 iburst\r\n# access restrictions\r\nrestrict -4default kod noquery nomodify notrap nopeer limited\r\nrestrict -6default kod noquery nomodify notrap nopeer limited\r\n#Allow ntpq and ntpdc queries only from localhost\r\nrestrict 127.0.0.1\r\nrestrict ::1<\/pre>\n\u542f\u52a8\u4f60\u7684 NTP \u670d\u52a1\u5668\uff0c\u8ba9\u5b83\u8fd0\u884c\u51e0\u5206\u949f\uff0c\u7136\u540e\u6d4b\u8bd5\u5b83\u5bf9\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u67e5\u8be2\uff1a<\/p>\n
$ ntpq -p\r\nremote refid st t when poll reach delay offset jitter\r\n=================================================================\r\n+tock.no-such-ag 200.98.196.2122 u 3664798.65488.43965.123\r\n+PBX.cytranet.ne 45.33.84.2083 u 3764772.419113.535129.313\r\n*eterna.binary.n 199.102.46.702 u 3964792.93398.47556.778\r\n+time.mclarkdev.132.236.56.2503 u 37645111.05988.02974.919<\/pre>\n\u76ee\u524d\u8868\u73b0\u5f88\u597d\u3002\u73b0\u5728\u4ece\u53e6\u4e00\u53f0 PC \u4e0a\u4f7f\u7528\u4f60\u7684 NTP \u670d\u52a1\u5668\u540d\u5b57\u8fdb\u884c\u6d4b\u8bd5\u3002\u4ee5\u4e0b\u7684\u793a\u4f8b\u662f\u4e00\u4e2a\u6b63\u786e\u7684\u8f93\u51fa\u3002\u5982\u679c\u6709\u4e0d\u6b63\u786e\u7684\u5730\u65b9\uff0c\u4f60\u5c06\u770b\u5230\u4e00\u4e9b\u9519\u8bef\u4fe1\u606f\u3002<\/p>\n
$ ntpdate -q yourservername\r\nserver 66.96.99.10, stratum 2, offset 0.017690, delay 0.12794\r\nserver 98.191.213.2, stratum 1, offset 0.014798, delay 0.22887\r\nserver 173.49.198.27, stratum 2, offset 0.020665, delay 0.15012\r\nserver 129.6.15.28, stratum 1, offset -0.018846, delay 0.20966\r\n26Jan11:13:54 ntpdate[17293]: adjust time server 98.191.213.2 offset 0.014798 sec\r\n<\/pre>\n\u4e00\u65e6\u4f60\u7684\u670d\u52a1\u5668\u8fd0\u884c\u7684\u5f88\u597d\uff0c\u4f60\u5c31\u53ef\u4ee5\u5411 manage.ntppool.org \u7533\u8bf7\u52a0\u5165\u6c60\u4e2d\u3002<\/p>\n
\u67e5\u770b\u5b98\u65b9\u7684\u624b\u518c \u5206\u5e03\u5f0f\u7f51\u7edc\u65f6\u95f4\u670d\u52a1\u5668\uff08NTP\uff09 \u5b66\u4e60\u6240\u6709\u7684\u547d\u4ee4\u3001\u914d\u7f6e\u9009\u9879\u3001\u4ee5\u53ca\u9ad8\u7ea7\u7279\u6027\uff0c\u6bd4\u5982\uff0c\u7ba1\u7406\u3001\u67e5\u8be2\u3001\u548c\u9a8c\u8bc1\u3002\u8bbf\u95ee\u4ee5\u4e0b\u7684\u7ad9\u70b9\u5b66\u4e60\u5173\u4e8e\u8fd0\u884c\u4e00\u53f0\u65f6\u95f4\u670d\u52a1\u5668\u6240\u9700\u8981\u7684\u4e00\u5207\u4e1c\u897f\u3002<\/p>\n
\n\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/www.linuxidc.com\/Linux\/2018-03\/151568.htm<\/a><\/p>\n\u672c\u6587\u5730\u5740\uff1ahttps:\/\/lrxjmw.cn\/linux-time-service.html<\/a>\u7f16\u8f91\uff1a\u8d3e\u6625\u534e \u00a0 \u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"\u5bfc\u8bfb \u6700\u91cd\u8981\u7684\u516c\u5171\u670d\u52a1\u4e4b\u4e00\u5c31\u662f\u62a5\u65f6timekeeping\uff0c\u4f46\u662f\u5f88\u591a\u4eba\u5e76\u6ca1\u6709\u610f\u8bc6\u5230\u8fd9\u4e00\u70b9\u3002\u5927\u591a\u6570\u516c\u5171\u65f6\u95f4\u670d\u52a1\u5668\u90fd […]<\/p>\n","protected":false},"author":63,"featured_media":98886,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-98903","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/98903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=98903"}],"version-history":[{"count":14,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/98903\/revisions"}],"predecessor-version":[{"id":109287,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/98903\/revisions\/109287"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/98886"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=98903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=98903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=98903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}