{"id":2401,"date":"2017-06-29T13:43:06","date_gmt":"2017-06-29T05:43:06","guid":{"rendered":"http:\/\/cn.hostease.com\/xueyuan\/?p=2401"},"modified":"2017-06-29T13:43:06","modified_gmt":"2017-06-29T05:43:06","slug":"centos6-x-%e6%9e%b6%e8%ae%bentp%e6%97%b6%e9%97%b4%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/cn.hostease.com\/xueyuan\/uncategorized\/centos6-x-%e6%9e%b6%e8%ae%bentp%e6%97%b6%e9%97%b4%e6%9c%8d%e5%8a%a1%e5%99%a8\/","title":{"rendered":"CentOS6.x \u67b6\u8bbeNTP\u65f6\u95f4\u670d\u52a1\u5668"},"content":{"rendered":"<p><strong><b>NTP\u7b80\u4ecb<\/b><\/strong><\/p>\n<p>NTP\uff08Network Time Protocol\uff0c\u7f51\u7edc\u65f6\u95f4\u534f\u8bae\uff09\u662f\u7528\u6765\u4f7f\u7f51\u7edc\u4e2d\u7684\u5404\u4e2a\u8ba1\u7b97\u673a\u65f6\u95f4\u540c\u6b65\u7684\u4e00\u79cd\u534f\u8bae\u3002\u5b83\u7684\u7528\u9014\u662f\u628a\u8ba1\u7b97\u673a\u7684\u65f6\u949f\u540c\u6b65\u5230\u4e16\u754c\u534f\u8c03\u65f6UTC\uff0c\u5176\u7cbe\u5ea6\u5728\u5c40\u57df\u7f51\u5185\u53ef\u8fbe0.1ms\uff0c\u5728\u4e92\u8054\u7f51\u4e0a\u7edd\u5927\u591a\u6570\u7684\u5730\u65b9\u5176\u7cbe\u5ea6\u53ef\u4ee5\u8fbe\u52301-50ms\u3002<\/p>\n<p>NTP\u670d\u52a1\u5668\u5c31\u662f\u5229\u7528NTP\u534f\u8bae\u63d0\u4f9b\u65f6\u95f4\u540c\u6b65\u670d\u52a1\u7684\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong><b>NTP\u670d\u52a1\u5668\u5b89\u88c5<\/b><\/strong><\/p>\n<p>\u7cfb\u7edf\u81ea\u5e26ntp<\/p>\n<p># yum -y\u00a0install ntp<\/p>\n<p><strong><b>\u00a0<\/b><\/strong><\/p>\n<p><strong><b>\u914d\u7f6eNTP\u670d\u52a1<\/b><\/strong><\/p>\n<p># vim \/etc\/ntp.conf<\/p>\n<p>#restrict default kod nomodify notrap nopeer noquery<\/p>\n<p>restrict<\/p>\n<p>default nomodify<\/p>\n<p># nomodify\u5ba2\u6237\u7aef\u53ef\u4ee5\u540c\u6b65<\/p>\n<p># \u5c06\u9ed8\u8ba4\u65f6\u95f4\u540c\u6b65\u6e90\u6ce8\u91ca\u6539\u7528\u53ef\u7528\u6e90<\/p>\n<p>#server 0.centos.pool.ntp.org iburst<\/p>\n<p>#server 1.centos.pool.ntp.org iburst<\/p>\n<p>#server 2.centos.pool.ntp.org iburst<\/p>\n<p>#server 3.centos.pool.ntp.org iburst<\/p>\n<p>&nbsp;<\/p>\n<p>server\u00a0ntp1.aliyun.com<\/p>\n<p>server\u00a0time.nist.gov<\/p>\n<p>&nbsp;<\/p>\n<p><strong><b>\u542f\u52a8NTP\u670d\u52a1\u5668<\/b><\/strong><\/p>\n<p># \u5982\u679c\u8ba1\u5212\u4efb\u52a1\u6709\u65f6\u95f4\u540c\u6b65\uff0c\u5148\u6ce8\u91ca\uff0c\u4e24\u79cd\u7528\u6cd5\u4f1a\u51b2\u7a81\u3002<\/p>\n<p># crontab -e<\/p>\n<p># time<\/p>\n<p>sync by oldboy at 2010-2-1<\/p>\n<p>#*\/5 *<\/p>\n<p>* * * \/usr\/sbin\/ntpdate time.nist.gov &gt;\/dev\/null 2&gt;&amp;1<\/p>\n<p>&nbsp;<\/p>\n<p># \/etc\/init.d\/ntpd start<\/p>\n<p>Starting<\/p>\n<p>ntpd:[ \u00a0OK \u00a0]<\/p>\n<p># ntpq -p<\/p>\n<p>remote \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0refid \u00a0\u00a0\u00a0\u00a0\u00a0st t when poll reach \u00a0\u00a0delayoffset \u00a0jitter<\/p>\n<p>==============================================================================<\/p>\n<p>*ntp1.aliyun.com<\/p>\n<p>10.137.38.86 \u00a0\u00a0\u00a0\u00a02 u \u00a0\u00a02264 \u00a0\u00a0\u00a01 \u00a0525.885-42.367 \u00a0\u00a00.000<\/p>\n<p>&nbsp;<\/p>\n<p># ntpstat<\/p>\n<p>synchronised<\/p>\n<p>to NTP server (110.75.186.247) at stratum 3<\/p>\n<p>time correct to within 4257 ms<\/p>\n<p>polling server every 64 s<\/p>\n<p>&nbsp;<\/p>\n<p># ntpdate 10.0.0.9<\/p>\n<p>7 Dec 18:43:07 ntpdate[26950]: the NTP socket<\/p>\n<p>is in use, exiting<\/p>\n<p>&nbsp;<\/p>\n<p><strong><b>\u5ba2\u6237\u673a\u65f6\u95f4\u540c\u6b65<\/b><\/strong><\/p>\n<p>\u5ba2\u6237\u673a\u8981\u7b49\u51e0\u5206\u949f\u518d\u4e0e\u65b0\u542f\u52a8\u7684ntp\u670d\u52a1\u5668\u8fdb\u884c\u65f6\u95f4\u540c\u6b65\uff0c\u5426\u5219\u4f1a\u63d0\u793ano server suitable for synchronization found\u9519\u8bef\u3002<\/p>\n<p># ntpdate 10.0.0.9<\/p>\n<p>7 Dec 18:40:16 ntpdate[1453]: step time server<\/p>\n<p>10.0.0.9 offset 40.880807 sec<\/p>\n<p># \u5c06\u547d\u4ee4\u653e\u5165\u8ba1\u5212\u4efb\u52a1\u5373\u53ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NTP\u7b80\u4ecb NTP\uff08Network Time Protocol\uff0c\u7f51\u7edc\u65f6\u95f4\u534f\u8bae\uff09\u662f\u7528\u6765\u4f7f\u7f51\u7edc\u4e2d\u7684\u5404\u4e2a\u8ba1\u7b97\u673a\u65f6\u95f4\u540c &#8230; <a title=\"CentOS6.x \u67b6\u8bbeNTP\u65f6\u95f4\u670d\u52a1\u5668\" class=\"read-more\" href=\"https:\/\/cn.hostease.com\/xueyuan\/uncategorized\/centos6-x-%e6%9e%b6%e8%ae%bentp%e6%97%b6%e9%97%b4%e6%9c%8d%e5%8a%a1%e5%99%a8\/\" aria-label=\"\u9605\u8bfb CentOS6.x \u67b6\u8bbeNTP\u65f6\u95f4\u670d\u52a1\u5668\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[82,442],"class_list":["post-2401","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-centos","tag-ntp"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/2401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/comments?post=2401"}],"version-history":[{"count":1,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/2401\/revisions"}],"predecessor-version":[{"id":2402,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/2401\/revisions\/2402"}],"wp:attachment":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/media?parent=2401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/categories?post=2401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/tags?post=2401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}