{"id":387,"date":"2013-05-28T09:57:18","date_gmt":"2013-05-28T09:57:18","guid":{"rendered":"https:\/\/shan.info\/new\/centos-ntp\/"},"modified":"2013-05-28T09:57:18","modified_gmt":"2013-05-28T09:57:18","slug":"centos-ntp","status":"publish","type":"post","link":"https:\/\/shan.info\/new\/centos-ntp\/","title":{"rendered":"CentOS\u914d\u7f6e\u65f6\u95f4\u540c\u6b65NTP"},"content":{"rendered":"<h1 class=\"sectionedit1\" style=\"padding: 0.5em 0px 0px; margin: 0px 0px 1em; font-family: Helvetica, \u5fae\u8f6f\u96c5\u9ed1, 'Microsoft YaHei', \u9ed1\u4f53, \u5b8b\u4f53, 'Hiragino Sans GB', STHeiti, Tahoma, SimHei, sans-serif; color: #000000; font-size: 22px; line-height: 33px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #aaaaaa; clear: left;\"><a id=\"centos\u914d\u7f6e\u65f6\u95f4\u540c\u6b65ntp\" name=\"centos\u914d\u7f6e\u65f6\u95f4\u540c\u6b65ntp\" style=\"padding: 0px; margin: 0px; font-size: 18px; line-height: 27px;\"><\/a>CentOS\u914d\u7f6e\u65f6\u95f4\u540c\u6b65NTP<\/h1>\n<div class=\"level1\" style=\"padding: 0px; margin: 0px 0px 0px 3px; color: #000000; font-family: 'Open Sans', \u5fae\u8f6f\u96c5\u9ed1, Helvetica, Arial, SimSun, system, \u5b8b\u4f53, serif; font-size: 14px; line-height: 23px; text-align: justify;\">\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u4e3a\u4ec0\u4e48\u8981\u4f7f\u7528ntpd\u800c\u4e0d\u662fntpdate\uff1f<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u539f\u56e0\u5f88\u7b80\u5355\uff0cntpd\u662f\u6b65\u8fdb\u5f0f\u7684\u9010\u6e10\u8c03\u6574\u65f6\u95f4\uff0c\u800cntpdate\u662f\u65ad\u70b9\u66f4\u65b0\uff0c\u6bd4\u5982\u73b0\u5728\u670d\u52a1\u5668\u65f6\u95f4\u662f9.18\u5206\uff0c\u800c\u6807\u51c6\u65f6\u95f4\u662f9.28\u5206\uff0cntpd\u4f1a\u5728\u4e00\u6bb5\u65f6\u95f4\u5185\u9010\u6e10\u7684\u628a\u65f6\u95f4\u6821\u51c6\u5230\u4e0e\u6807\u51c6\u65f6\u95f4\u76f8\u540c\uff0c\u800cntpdate\u4f1a\u7acb\u523b\u628a\u65f6\u95f4\u8c03\u6574\u52309.28\u5206\uff0c\u5982\u679c\u4f60\u5f80\u6570\u636e\u5e93\u5185\u5199\u5165\u5185\u5bb9\u6216\u5728\u5176\u4ed6\u5bf9\u65f6\u95f4\u6709\u4e25\u683c\u8981\u6c42\u7684\u751f\u4ea7\u73af\u5883\u4e0b\uff0c\u4ea7\u751f\u7684\u540e\u679c\u4f1a\u662f\u5f88\u4e25\u91cd\u7684\u3002\uff08\u6ce8\uff1a\u5f53\u672c\u5730\u65f6\u95f4\u4e0e\u6807\u51c6\u65f6\u95f4\u76f8\u5dee30\u5206\u949f\u4ee5\u4e0a\u662fntpd\u4f1a\u505c\u6b62\u5de5\u4f5c\uff09<\/p>\n<\/div>\n<h2 class=\"sectionedit2\" style=\"padding: 0.5em 0px 0px; margin: 0px 0px 1em 20px; font-family: Helvetica, \u5fae\u8f6f\u96c5\u9ed1, 'Microsoft YaHei', \u9ed1\u4f53, \u5b8b\u4f53, 'Hiragino Sans GB', STHeiti, Tahoma, SimHei, sans-serif; font-weight: bold; font-size: 20px; line-height: 30px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #aaaaaa; color: #000000; clear: left; text-align: justify;\"><a id=\"ntp\u901a\u4fe1\u534f\u8bae\u539f\u7406\" name=\"ntp\u901a\u4fe1\u534f\u8bae\u539f\u7406\" style=\"padding: 0px; margin: 0px;\"><\/a>NTP\u901a\u4fe1\u534f\u8bae\u539f\u7406<\/h2>\n<div class=\"level2\" style=\"padding: 0px; margin: 0px 0px 0px 23px; color: #000000; font-family: 'Open Sans', \u5fae\u8f6f\u96c5\u9ed1, Helvetica, Arial, SimSun, system, \u5b8b\u4f53, serif; font-size: 14px; line-height: 23px; text-align: justify;\">\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">1.\u9996\u5148\u4e3b\u673a\u542f\u52a8NTP\u3002<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">2.\u5ba2\u6237\u7aef\u4f1a\u5411NTP\u670d\u52a1\u5668\u53d1\u9001\u8c03\u6574\u65f6\u95f4\u7684message\u3002<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">3.\u7136\u540eNTP server\u4f1a\u9001\u51fa\u5f53\u524d\u7684\u6807\u51c6\u65f6\u95f4\u7ed9client<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">4.client\u63a5\u53d7\u6765\u81easerver\u7684\u65f6\u95f4\u540e\uff0c\u4f1a\u6839\u636e\u8fd9\u4e2a\u4fe1\u606f\u6765\u8c03\u6574\u81ea\u5df1\u7684\u65f6\u95f4\u3002\u8fd9\u6837\u5c31\u5b9e\u73b0\u4e86\u7f51\u7edc\u5bf9\u65f6\u3002<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">NTP\u8fd9\u4e2adeamon\u91c7\u7528\u4e86123\u7aef\u53e3\u3002\uff08UDP\uff09<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u201c\u5f53\u6211\u4eec\u8981\u5229\u7528Tim server\u6765\u8fdb\u884c\u5b9e\u8df5\u7684\u540c\u6b65\u66f4\u65b0\u65f6\uff0c\u5c31\u9700\u8981\u4f7f\u7528NTP\u8f6f\u4ef6\u63d0\u4f9b\u7684ntpdate\u6765\u8fde\u63a5\u7aef\u53e3123\u201d<\/p>\n<\/div>\n<h2 class=\"sectionedit3\" style=\"padding: 0.5em 0px 0px; margin: 0px 0px 1em 20px; font-family: Helvetica, \u5fae\u8f6f\u96c5\u9ed1, 'Microsoft YaHei', \u9ed1\u4f53, \u5b8b\u4f53, 'Hiragino Sans GB', STHeiti, Tahoma, SimHei, sans-serif; font-weight: bold; font-size: 20px; line-height: 30px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #aaaaaa; color: #000000; clear: left; text-align: justify;\"><a id=\"\u4e0e\u65f6\u95f4\u76f8\u5173\u7684\u4e00\u4e9b\u547d\u4ee4\u548c\u914d\u7f6e\u6587\u4ef6\" name=\"\u4e0e\u65f6\u95f4\u76f8\u5173\u7684\u4e00\u4e9b\u547d\u4ee4\u548c\u914d\u7f6e\u6587\u4ef6\" style=\"padding: 0px; margin: 0px;\"><\/a>\u4e0e\u65f6\u95f4\u76f8\u5173\u7684\u4e00\u4e9b\u547d\u4ee4\u548c\u914d\u7f6e\u6587\u4ef6<\/h2>\n<div class=\"level2\" style=\"padding: 0px; margin: 0px 0px 0px 23px; color: #000000; font-family: 'Open Sans', \u5fae\u8f6f\u96c5\u9ed1, Helvetica, Arial, SimSun, system, \u5b8b\u4f53, serif; font-size: 14px; line-height: 23px; text-align: justify;\">\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"><strong style=\"padding: 0px; margin: 0px;\">1.\/etc\/ntp.conf<\/strong><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">linux\u5404\u7248\u672c\u867d\u7136\u76ee\u5f55\u4e0d\u540c\uff0c\u4f46\u6587\u4ef6\u540d\u76f8\u540c\u3002\u53ef\u4ee5\u7528which ntp.conf \u6216\u8005locate ntp.conf\u6765\u67e5\u627e\u3002\u8fd9\u662fNTP\u552f\u4e00\u7684\u4e00\u4e2a\u8bbe\u7f6e\u6587\u4ef6\u3002<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"><strong style=\"padding: 0px; margin: 0px;\">2.\/usr\/share\/zoneinfo\/<\/strong><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u8fd9\u4e2a\u91cc\u9762\u89c4\u5b9a\u4e86\u8fd9\u4e2a\u4e3b\u8981\u65f6\u533a\u7684\u65f6\u95f4\u8bbe\u7f6e\u6587\u4ef6\u3002<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"><strong style=\"padding: 0px; margin: 0px;\">3.\/etc\/sysconfig\/clock<\/strong><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u8fd9\u4e2a\u6587\u4ef6\u662flinux\u7684\u4e3b\u8981\u65f6\u533a\u8bbe\u7f6e\u6587\u4ef6\uff0c\u6bcf\u6b21\u5f00\u673a\u540elinux\u4f1a\u81ea\u52a8\u8bfb\u53d6\u8fd9\u4e2a\u6587\u4ef6\u6765\u8bbe\u7f6e\u7cfb\u7edf\u6240\u9ed8\u8ba4\u7684\u663e\u793a\u65f6\u95f4\uff0c\u53ef\u4ee5\u770b\u770b\u5b83\u91cc\u9762\u5230\u5e95\u8bbe\u7f6e\u4e86\u4ec0\u4e48\uff1a<\/p>\n<pre class=\"code\" style=\"padding: 0.5em; margin: 0px 0px 1em; font-family: Consolas, Fixedsys, Courier, monospace, sans-serif, monospace; font-size: 12px; border: 1px dashed #aaaaaa; overflow: auto; background-color: #f7f9fa;\">cat \/etc\/sysconfig\/clock \r\n# The ZONE parameter is only evaluated by system-config-date. \r\n# The timezone of the system is defined by the contents of \/etc\/localtime. \r\nZONE=\"Asia\/Shanghai\" \r\nUTC=true \r\nARC=false<\/pre>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"><strong style=\"padding: 0px; margin: 0px;\">4.\/etc\/localtime<\/strong><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u672c\u5730\u7aef\u65f6\u95f4\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"><strong style=\"padding: 0px; margin: 0px;\">5.\/bin\/date<\/strong><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u8fd9\u4e2a\u662f\u65f6\u95f4\u7684\u4fee\u6539\u547d\u4ee4\uff0c\u9664\u4e86\u8f93\u51fa\u65f6\u95f4\uff0c\u8fd8\u53ef\u4ee5\u4fee\u6539\u65f6\u95f4\u3002<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"><strong style=\"padding: 0px; margin: 0px;\">6.\/sbin\/hwclock<\/strong><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u56e0\u4e3alinux\u7cfb\u7edf\u4e0a\u9762BIOS\u65f6\u95f4\u4e0elinux\u7cfb\u7edf\u65f6\u95f4\u662f\u5206\u5f00\u7684\uff0c\u6240\u4ee5\u4f7f\u7528date\u8fd9\u4e2a\u6307\u4ee4\u8c03\u6574\u4e86\u65f6\u95f4\u4e4b\u540e\uff0c\u8fd8\u9700\u8981\u4f7f\u7528hwclock\u624d\u80fd\u5c06\u4fee\u6539\u8fc7\u7684\u65f6\u95f4\u5199\u5165BIOS\u4e2d\u3002<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"><strong style=\"padding: 0px; margin: 0px;\">7.\/usr\/sbin\/ntpd<\/strong><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u8fd9\u662fNTP\u7684daemon\u6587\u4ef6\uff0c\u9700\u8981\u542f\u52a8\u5b83\u624d\u80fd\u63d0\u4f9bNTP\u670d\u52a1\uff0c\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u8bfb\u53d6\/etc\/ntp.conf\u91cc\u9762\u7684\u8bbe\u7f6e\u3002<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"><strong style=\"padding: 0px; margin: 0px;\">8.\/usr\/sbin\/ntpdate<\/strong><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u8fd9\u662fclient\u7528\u6765\u8fde\u63a5NTP Server\u7684\u4e3b\u8981\u6267\u884c\u6587\u4ef6\uff0c\u5982\u679c\u60a8\u4e0d\u60f3\u542f\u7528NTP\uff0c\u53ea\u60f3\u542f\u7528NTP Client\u529f\u80fd\u7684\u8bdd\uff0c\u53ef\u4ee5\u53ea\u5e94\u7528\u6b64\u547d\u4ee4\u3002<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"><strong style=\"padding: 0px; margin: 0px;\">9\uff0c\/usr\/sbin\/ntptrace<\/strong><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u53ef\u4ee5\u7528\u6765\u8ffd\u8e2a\u67d0\u53f0\u65f6\u95f4\u670d\u52a1\u5668\u7684\u65f6\u95f4\u5bf9\u5e94\u5173\u7cfb\u3002<\/p>\n<\/div>\n<h2 class=\"sectionedit4\" style=\"padding: 0.5em 0px 0px; margin: 0px 0px 1em 20px; font-family: Helvetica, \u5fae\u8f6f\u96c5\u9ed1, 'Microsoft YaHei', \u9ed1\u4f53, \u5b8b\u4f53, 'Hiragino Sans GB', STHeiti, Tahoma, SimHei, sans-serif; font-weight: bold; font-size: 20px; line-height: 30px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #aaaaaa; color: #000000; clear: left; text-align: justify;\"><a id=\"\u5b89\u88c5\u4e0e\u914d\u7f6e\" name=\"\u5b89\u88c5\u4e0e\u914d\u7f6e\" style=\"padding: 0px; margin: 0px;\"><\/a>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/h2>\n<div class=\"level2\" style=\"padding: 0px; margin: 0px 0px 0px 23px; color: #000000; font-family: 'Open Sans', \u5fae\u8f6f\u96c5\u9ed1, Helvetica, Arial, SimSun, system, \u5b8b\u4f53, serif; font-size: 14px; line-height: 23px; text-align: justify;\">\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">1\u3001\u8bbe\u7f6e\u65f6\u533a<\/p>\n<pre class=\"code\" style=\"padding: 0.5em; margin: 0px 0px 1em; font-family: Consolas, Fixedsys, Courier, monospace, sans-serif, monospace; font-size: 12px; border: 1px dashed #aaaaaa; overflow: auto; background-color: #f7f9fa;\">cp \/usr\/share\/zoneinfo\/Asia\/Shanghai \/etc\/localtime<\/pre>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">2\u3001\u5b89\u88c5ntpd\u670d\u52a1<\/p>\n<pre class=\"code\" style=\"padding: 0.5em; margin: 0px 0px 1em; font-family: Consolas, Fixedsys, Courier, monospace, sans-serif, monospace; font-size: 12px; border: 1px dashed #aaaaaa; overflow: auto; background-color: #f7f9fa;\">yum -y install ntp<\/pre>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">3\u3001\u914d\u7f6entpd<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">vi \/etc\/ntp.conf<\/p>\n<pre class=\"code\" style=\"padding: 0.5em; margin: 0px 0px 1em; font-family: Consolas, Fixedsys, Courier, monospace, sans-serif, monospace; font-size: 12px; border: 1px dashed #aaaaaa; overflow: auto; background-color: #f7f9fa;\">    \r\nrestrict default kod nomodify notrap nopeer noquery   #\r\nrestrict -6 default kod nomodify notrap nopeer noquery  #\u9488\u5bf9ipv6\u8bbe\u7f6e\r\n\r\n# \u5141\u8bb8\u672c\u5730\u6240\u6709\u64cd\u4f5c\r\nrestrict 127.0.0.1 \r\nrestrict -6 ::1\r\n\r\n# \u5141\u8bb8\u7684\u5c40\u57df\u7f51\u7edc\u6bb5\u6216\u5355\u72ecip\r\nrestrict 10.0.0.0 mask 255.0.0.0 nomodify motrap\r\nrestrict 192.168.0.0 mask 255.255.255.0 nomodify motrap\r\nrestrict 192.168.1.123 mask 255.255.255.255 nomodify motrap\r\n\r\n# \u4f7f\u7528\u4e0a\u5c42\u7684internet ntp\u670d\u52a1\u5668\r\nrestrict cn.pool.ntp.org\r\nrestrict 1.cn.poo.ntp.org\r\nrestrict 0.asia.pool.ntp.org\r\nrestrict 3.asia.pool.ntp.org\r\n\r\nserver cn.pool.ntp.org prefer\r\nserver 1.cn.poo.ntp.org\r\nserver 0.asia.pool.ntp.org\r\nserver 3.asia.pool.ntp.org\r\n\r\n# \u5982\u679c\u65e0\u6cd5\u4e0e\u4e0a\u5c42ntp server\u901a\u4fe1\u4ee5\u672c\u5730\u65f6\u95f4\u4e3a\u6807\u51c6\u65f6\u95f4\r\nserver   127.127.1.0    # local clock\r\nfudge    127.127.1.0 stratum 10    \r\n\r\n# \u8ba1\u7b97\u672cntp server \u4e0e\u4e0a\u5c42ntpserver\u7684\u9891\u7387\u8bef\u5dee\r\ndriftfile \/var\/lib\/ntp\/drift\r\n\r\n# Key file containing the keys and key identifiers used when operating\r\n# with symmetric key cryptography. \r\nkeys \/etc\/ntp\/keys\r\n#\u65e5\u5fd7\u6587\u4ef6\r\nlogfile \/var\/log\/ntp.log<\/pre>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u4fee\u6539\/etc\/sysconfig\/ntpd:<\/p>\n<pre class=\"code\" style=\"padding: 0.5em; margin: 0px 0px 1em; font-family: Consolas, Fixedsys, Courier, monospace, sans-serif, monospace; font-size: 12px; border: 1px dashed #aaaaaa; overflow: auto; background-color: #f7f9fa;\"># Drop root to id 'ntp:ntp' by default. \r\nOPTIONS=\"-u ntp:ntp -p \/var\/run\/ntpd.pid\"\r\n\r\n# Set to 'yes' to sync hw clock after successful ntpdate \r\nSYNC_HWCLOCK=yes #make no into yes; BIOS\u7684\u65f6\u95f4\u4e5f\u4f1a\u8ddf\u7740\u4fee\u6539\r\n\r\n# Additional options for ntpdate \r\nNTPDATE_OPTIONS=\"\"<\/pre>\n<\/div>\n<h2 class=\"sectionedit5\" style=\"padding: 0.5em 0px 0px; margin: 0px 0px 1em 20px; font-family: Helvetica, \u5fae\u8f6f\u96c5\u9ed1, 'Microsoft YaHei', \u9ed1\u4f53, \u5b8b\u4f53, 'Hiragino Sans GB', STHeiti, Tahoma, SimHei, sans-serif; font-weight: bold; font-size: 20px; line-height: 30px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #aaaaaa; color: #000000; clear: left; text-align: justify;\"><a id=\"\u9a8c\u8bc1\u4e0e\u72b6\u6001\u68c0\u67e5\" name=\"\u9a8c\u8bc1\u4e0e\u72b6\u6001\u68c0\u67e5\" style=\"padding: 0px; margin: 0px;\"><\/a>\u9a8c\u8bc1\u4e0e\u72b6\u6001\u68c0\u67e5<\/h2>\n<div class=\"level2\" style=\"padding: 0px; margin: 0px 0px 0px 23px; color: #000000; font-family: 'Open Sans', \u5fae\u8f6f\u96c5\u9ed1, Helvetica, Arial, SimSun, system, \u5b8b\u4f53, serif; font-size: 14px; line-height: 23px; text-align: justify;\">\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"><strong style=\"padding: 0px; margin: 0px;\">\u8fd0\u884cntp<\/strong><\/p>\n<pre class=\"code\" style=\"padding: 0.5em; margin: 0px 0px 1em; font-family: Consolas, Fixedsys, Courier, monospace, sans-serif, monospace; font-size: 12px; border: 1px dashed #aaaaaa; overflow: auto; background-color: #f7f9fa;\">service ntpd start\/stop\/restart<\/pre>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"><strong style=\"padding: 0px; margin: 0px;\">\u67e5\u770bntp\u7684\u7aef\u53e3<\/strong><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u5e94\u8be5\u770b\u5230123\u7aef\u53e3<\/p>\n<pre class=\"code\" style=\"padding: 0.5em; margin: 0px 0px 1em; font-family: Consolas, Fixedsys, Courier, monospace, sans-serif, monospace; font-size: 12px; border: 1px dashed #aaaaaa; overflow: auto; background-color: #f7f9fa;\">netstat -unlnp<\/pre>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"><strong style=\"padding: 0px; margin: 0px;\">\u67e5\u770bntp\u670d\u52a1\u5668\u6709\u65e0\u548c\u4e0a\u5c42\u8fde\u901a<\/strong><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"># ntpstat<\/p>\n<pre class=\"code\" style=\"padding: 0.5em; margin: 0px 0px 1em; font-family: Consolas, Fixedsys, Courier, monospace, sans-serif, monospace; font-size: 12px; border: 1px dashed #aaaaaa; overflow: auto; background-color: #f7f9fa;\">synchronised to NTP server () at stratum 2\r\ntime correct to within 74 ms\r\npolling server every 128 s<\/pre>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u6ce8\u610f\uff1a\u6b64\u547d\u4ee4\u51fa\u73b0\u4e0a\u8ff0synchronised\u7ed3\u679c\u6bd4\u8f83\u6162\uff0c\u6211\u7684\u7528\u4e86\u5927\u69825\u5206\u949f\u3002<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"><strong style=\"padding: 0px; margin: 0px;\">\u67e5\u770bntp\u670d\u52a1\u5668\u4e0e\u4e0a\u5c42\u95f4\u7684\u8054\u7cfb<\/strong><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"># ntptrace -n 127.0.0.1<\/p>\n<pre class=\"code\" style=\"padding: 0.5em; margin: 0px 0px 1em; font-family: Consolas, Fixedsys, Courier, monospace, sans-serif, monospace; font-size: 12px; border: 1px dashed #aaaaaa; overflow: auto; background-color: #f7f9fa;\">127.0.0.1: stratum 3, offset -0.001095, synch distance 0.532610\r\n116.193.83.174: timed out, nothing received<\/pre>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"><strong style=\"padding: 0px; margin: 0px;\">\u67e5\u770bntp\u670d\u52a1\u5668\u4e0e\u4e0a\u5c42ntp\u670d\u52a1\u5668\u7684\u72b6\u6001<\/strong><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"># ntpq -p<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u5176\u4e2d:<\/p>\n<pre class=\"code\" style=\"padding: 0.5em; margin: 0px 0px 1em; font-family: Consolas, Fixedsys, Courier, monospace, sans-serif, monospace; font-size: 12px; border: 1px dashed #aaaaaa; overflow: auto; background-color: #f7f9fa;\">remote - \u672c\u673a\u548c\u4e0a\u5c42ntp\u7684ip\u6216\u4e3b\u673a\u540d\uff0c\u201c+\u201d\u8868\u793a\u4f18\u5148\uff0c\u201c*\u201d\u8868\u793a\u6b21\u4f18\u5148\r\nrefid - \u53c2\u8003\u4e0a\u4e00\u5c42ntp\u4e3b\u673a\u5730\u5740\r\nst - stratum\u9636\u5c42\r\nwhen - \u591a\u5c11\u79d2\u524d\u66fe\u7ecf\u540c\u6b65\u8fc7\u65f6\u95f4\r\npoll - \u4e0b\u6b21\u66f4\u65b0\u5728\u591a\u5c11\u79d2\u540e\r\nreach - \u5df2\u7ecf\u5411\u4e0a\u5c42ntp\u670d\u52a1\u5668\u8981\u6c42\u66f4\u65b0\u7684\u6b21\u6570\r\ndelay - \u7f51\u7edc\u5ef6\u8fdf\r\noffset - \u65f6\u95f4\u8865\u507f\r\njitter - \u7cfb\u7edf\u65f6\u95f4\u4e0ebios\u65f6\u95f4\u5dee<\/pre>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u5982\u679c\u6240\u6709\u8fdc\u7a0b\u670d\u52a1\u5668\u7684jitter\u503c\u662f4000\u5e76\u4e14delay\u548creach\u7684\u503c\u662f0\uff0c\u90a3\u4e48\u8bf4\u660e\u65f6\u95f4\u540c\u6b65\u662f\u6709\u95ee\u9898\u7684<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u53ef\u80fd\u7684\u539f\u56e0\u662f\u9632\u706b\u5899\u963b\u65ad\u4e86\u4e0eserver\u4e4b\u95f4\u7684\u901a\u8baf\uff0c\u5373123\u7aef\u53e3\u662f\u5426\u6b63\u5e38\u5f00\u653e\uff1b<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u6b64\u5916\u6bcf\u6b21\u91cd\u542fNTP\u670d\u52a1\u5668\u4e4b\u540e\u5927\u7ea6\u89813\uff0d5\u5206\u949f\u5ba2\u6237\u7aef\u624d\u80fd\u4e0eserver\u5efa\u7acb\u6b63\u5e38\u7684\u901a\u8baf\u8fde\u63a5\uff0c\u5426\u5219\u4f60\u5728\u5ba2\u6237\u7aef\u6267\u884c\u201cntpdate \u670d\u52a1\u5668ip\u201d\u7684\u65f6\u5019\u5c06\u8fd4\u56de\uff1a<\/p>\n<pre class=\"code\" style=\"padding: 0.5em; margin: 0px 0px 1em; font-family: Consolas, Fixedsys, Courier, monospace, sans-serif, monospace; font-size: 12px; border: 1px dashed #aaaaaa; overflow: auto; background-color: #f7f9fa;\">27 Jun 10:20:17 ntpdate[21920]: no server suitable for synchronization found<\/pre>\n<\/div>\n<h2 class=\"sectionedit6\" style=\"padding: 0.5em 0px 0px; margin: 0px 0px 1em 20px; font-family: Helvetica, \u5fae\u8f6f\u96c5\u9ed1, 'Microsoft YaHei', \u9ed1\u4f53, \u5b8b\u4f53, 'Hiragino Sans GB', STHeiti, Tahoma, SimHei, sans-serif; font-weight: bold; font-size: 20px; line-height: 30px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #aaaaaa; color: #000000; clear: left; text-align: justify;\"><a id=\"\u542f\u52a8ntpd\" name=\"\u542f\u52a8ntpd\" style=\"padding: 0px; margin: 0px;\"><\/a>\u542f\u52a8NTPD<\/h2>\n<div class=\"level2\" style=\"padding: 0px; margin: 0px 0px 0px 23px; color: #000000; font-family: 'Open Sans', \u5fae\u8f6f\u96c5\u9ed1, Helvetica, Arial, SimSun, system, \u5b8b\u4f53, serif; font-size: 14px; line-height: 23px; text-align: justify;\">\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u6211\u91c7\u7528\u4e86\u4e00\u4e2a\u5f88\u7b28\u7684\u529e\u6cd5\u6765\u624b\u52a8\u542f\u52a8ntpd\uff0c\u800c\u4e0d\u662f\u628antpd\u52a0\u5165\u670d\u52a1\uff0c\u5199\u4e00\u4e2a\u7b80\u5355\u7684\u811a\u672c<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">vi ntpstart.sh<\/p>\n<pre class=\"code\" style=\"padding: 0.5em; margin: 0px 0px 1em; font-family: Consolas, Fixedsys, Courier, monospace, sans-serif, monospace; font-size: 12px; border: 1px dashed #aaaaaa; overflow: auto; background-color: #f7f9fa;\">ntpdate cn.pool.ntp.org\r\nntpdate cn.pool.ntp.org\r\nservice ntpd start<\/pre>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u7136\u540e\u52a0\u5165\/etc\/rc.local<\/p>\n<pre class=\"code\" style=\"padding: 0.5em; margin: 0px 0px 1em; font-family: Consolas, Fixedsys, Courier, monospace, sans-serif, monospace; font-size: 12px; border: 1px dashed #aaaaaa; overflow: auto; background-color: #f7f9fa;\">\/shpath\/ntpstart.sh<\/pre>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u8fd9\u662f\u56e0\u4e3a\u6211\u6709\u4e00\u53f0\u670d\u52a1\u5668\u542f\u52a8\u540e\u7684\u65f6\u95f4\u603b\u662f\u4e0e\u6807\u51c6\u65f6\u95f4\u5dee\u522b\u5f88\u5927\uff0c\u6bcf\u6b21\u542f\u52a8\u540entpd\u8981\u82b1\u5f88\u591a\u65f6\u95f4\u624d\u80fd\u628a\u65f6\u95f4\u6821\u51c6\uff0c\u6240\u4ee5\u6211\u662f\u5148\u5728\u7cfb\u7edf\u542f\u52a8\u540entpdate\u66f4\u65b0\u4e24\u6b21\uff0c\u7136\u540e\u518d\u542f\u52a8ntpd\u670d\u52a1\uff0c\u5728freebsd\u91cc\u597d\u50cf\u6709\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\uff0c\u8ba9\u65f6\u95f4\u670d\u52a1\u5668\u5728\u7cfb\u7edf\u542f\u52a8\u4e4b\u524d\u542f\u52a8\u7684\uff0ccentos\u8fd8\u6ca1\u4ed4\u7ec6\u7422\u78e8<\/p>\n<\/div>\n<h2 class=\"sectionedit7\" style=\"padding: 0.5em 0px 0px; margin: 0px 0px 1em 20px; font-family: Helvetica, \u5fae\u8f6f\u96c5\u9ed1, 'Microsoft YaHei', \u9ed1\u4f53, \u5b8b\u4f53, 'Hiragino Sans GB', STHeiti, Tahoma, SimHei, sans-serif; font-weight: bold; font-size: 20px; line-height: 30px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #aaaaaa; color: #000000; clear: left; text-align: justify;\"><a id=\"\u5ba2\u6237\u7aef\u914d\u7f6e\" name=\"\u5ba2\u6237\u7aef\u914d\u7f6e\" style=\"padding: 0px; margin: 0px;\"><\/a>\u5ba2\u6237\u7aef\u914d\u7f6e<\/h2>\n<div class=\"level2\" style=\"padding: 0px; margin: 0px 0px 0px 23px; color: #000000; font-family: 'Open Sans', \u5fae\u8f6f\u96c5\u9ed1, Helvetica, Arial, SimSun, system, \u5b8b\u4f53, serif; font-size: 14px; line-height: 23px; text-align: justify;\">\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u65b9\u6cd51.\u4f7f\u7528ntpdate\u4e0e\u4e0a\u9762\u914d\u7f6e\u7684\u65f6\u95f4\u670d\u52a1\u5668\u5b9a\u65f6\u540c\u6b65\uff0c\u4e0d\u63a8\u8350\u6b64\u65b9\u6cd5<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u65b9\u6cd52.\u5b89\u88c5ntpd\uff0c\u6307\u5b9a\u65f6\u95f4server\u4e3a\u4e0a\u9762\u914d\u7f6e\u7684\u670d\u52a1\u5668\u5730\u5740\uff0c\u63a8\u8350<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u66f4\u8be6\u7ec6\u7684\u4ecb\u7ecd\u53c2\u89c1\u53f0\u6e7e \u9e1f\u54e5\u7684Linux\u79c1\u623f\u83dc<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\"><a class=\"urlextern\" href=\"http:\/\/linux.vbird.org\/linux_server\/0440ntp.php\" target=\"_blank\" title=\"http:\/\/linux.vbird.org\/linux_server\/0440ntp.php\" rel=\"nofollow\" style=\"padding: 1px 0px 1px 16px; margin: 0px; color: purple; background-image: url('http:\/\/www.crsay.com\/wiki\/lib\/tpl\/default\/images\/link_icon.gif'); background-color: transparent; background-position: 0px 1px; background-repeat: no-repeat no-repeat;\">http:\/\/linux.vbird.org\/linux_server\/0440ntp.php<\/a><\/p>\n<\/div>\n<h2 class=\"sectionedit8\" style=\"padding: 0.5em 0px 0px; margin: 0px 0px 1em 20px; font-family: Helvetica, \u5fae\u8f6f\u96c5\u9ed1, 'Microsoft YaHei', \u9ed1\u4f53, \u5b8b\u4f53, 'Hiragino Sans GB', STHeiti, Tahoma, SimHei, sans-serif; font-weight: bold; font-size: 20px; line-height: 30px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #aaaaaa; color: #000000; clear: left; text-align: justify;\"><a id=\"\u9644\u5f55\" name=\"\u9644\u5f55\" style=\"padding: 0px; margin: 0px;\"><\/a>\u9644\u5f55<\/h2>\n<div class=\"level2\" style=\"padding: 0px; margin: 0px 0px 0px 23px; color: #000000; font-family: 'Open Sans', \u5fae\u8f6f\u96c5\u9ed1, Helvetica, Arial, SimSun, system, \u5b8b\u4f53, serif; font-size: 14px; line-height: 23px; text-align: justify;\">\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u4e2d\u56fd\u56fd\u5bb6\u6388\u65f6\u4e2d\u5fc3(\u9655\u897f\u897f\u5b89) 210.72.145.44<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u4e0a\u6d77\uff1a 61.129.66.79 (t2.hshh.org) 61.129.42.44 (ntp.fudan.edu.cn) 202.120.2.101 (ntp.sjtu.edu.cn)<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u6d59\u6c5f 218.75.4.130 (t1.hshh.org)<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u5185\u8499\u53e4 218.21.130.42 (t1.hshh.org)<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u9999\u6e2f: 137.189.11.66 (clock.cuhk.edu.hk ) 137.189.11.128 (ntp.cuhk.edu.hk )<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u53f0\u6e7e: 220.130.158.52(time.stdtime.gov.tw) 220.130.158.72(Clock.stdtime.gov.tw)<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">220.130.158.51(tick.stdtime.gov.tw) 220.130.158.54(watch.stdtime.gov.tw)<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">asia.pool.ntp.org\uff0c \u66f4\u591a\u4e9a\u6d32\u670d\u52a1\u5668\u8bf7\u53c2\u8003\u00a0<a class=\"urlextern\" href=\"http:\/\/www.pool.ntp.org\/zone\/asia\" target=\"_blank\" title=\"http:\/\/www.pool.ntp.org\/zone\/asia\" rel=\"nofollow\" style=\"padding: 1px 0px 1px 16px; margin: 0px; color: purple; background-image: url('http:\/\/www.crsay.com\/wiki\/lib\/tpl\/default\/images\/link_icon.gif'); background-color: transparent; background-position: 0px 1px; background-repeat: no-repeat no-repeat;\">http:\/\/www.pool.ntp.org\/zone\/asia<\/a><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">cn.pool.ntp.org, \u66f4\u591a\u4e2d\u56fd\u670d\u52a1\u5668\u8bf7\u53c2\u8003\u00a0<a class=\"urlextern\" href=\"http:\/\/www.pool.ntp.org\/zone\/cn\" target=\"_blank\" title=\"http:\/\/www.pool.ntp.org\/zone\/cn\" rel=\"nofollow\" style=\"padding: 1px 0px 1px 16px; margin: 0px; color: purple; background-image: url('http:\/\/www.crsay.com\/wiki\/lib\/tpl\/default\/images\/link_icon.gif'); background-color: transparent; background-position: 0px 1px; background-repeat: no-repeat no-repeat;\">http:\/\/www.pool.ntp.org\/zone\/cn<\/a><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">tw.pool.ntp.org, \u66f4\u591a\u4e2d\u56fd\u53f0\u6e7e\u670d\u52a1\u5668\u8bf7\u53c2\u8003\u00a0<a class=\"urlextern\" href=\"http:\/\/www.pool.ntp.org\/zone\/tw\" target=\"_blank\" title=\"http:\/\/www.pool.ntp.org\/zone\/tw\" rel=\"nofollow\" style=\"padding: 1px 0px 1px 16px; margin: 0px; color: purple; background-image: url('http:\/\/www.crsay.com\/wiki\/lib\/tpl\/default\/images\/link_icon.gif'); background-color: transparent; background-position: 0px 1px; background-repeat: no-repeat no-repeat;\">http:\/\/www.pool.ntp.org\/zone\/tw<\/a><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">hk.pool.ntp.org, \u66f4\u591a\u4e2d\u56fd\u9999\u6e2f\u670d\u52a1\u5668\u8bf7\u53c2\u8003\u00a0<a class=\"urlextern\" href=\"http:\/\/www.pool.ntp.org\/zone\/hk\" target=\"_blank\" title=\"http:\/\/www.pool.ntp.org\/zone\/hk\" rel=\"nofollow\" style=\"padding: 1px 0px 1px 16px; margin: 0px; color: purple; background-image: url('http:\/\/www.crsay.com\/wiki\/lib\/tpl\/default\/images\/link_icon.gif'); background-color: transparent; background-position: 0px 1px; background-repeat: no-repeat no-repeat;\">http:\/\/www.pool.ntp.org\/zone\/hk<\/a><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">12\/02\/15\u8865\u5145\uff1a<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u53d6\u6d88ntpd\u81ea\u52a8\u542f\u52a8\uff0c\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\uff0c\u6307\u5b9antpdate\u8fdc\u7a0b\u6807\u51c6\u65f6\u95f4\u670d\u52a1\u5668\u4e24\u6b21\uff0c\u7136\u540eservice ntpd start<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u597d\u50cf\u4e5f\u53ef\u4ee5\u4fee\u6539rc.conf\u6216\u8005\u52a0\u4e0a\u4e00\u5806\u4ec0\u4e48\u53c2\u6570\u6765\u5b9e\u73b0\uff0c\u6211\u5077\u61d2\u7528\u8fd9\u4e2a\u7b28\u529e\u6cd5\u6765\u4fdd\u8bc1\u65f6\u95f4\u7684\u51c6\u786e\u4e86<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u00a0<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 1em;\">\u00a0<a href=\"http:\/\/www.crsay.com\/wiki\/wiki.php\/server\/centos\/ntp-set\">http:\/\/www.crsay.com\/wiki\/wiki.php\/server\/centos\/ntp-set<\/a><\/p>\n<div class=\"noteimportant\" style=\"padding: 12px 10px 12px 50px; margin: 0px; min-height: 18px; clear: both; vertical-align: middle; border-collapse: collapse; border-top-left-radius: 20px; border-top-right-radius: 20px; border-bottom-right-radius: 20px; border-bottom-left-radius: 20px; line-height: 15px; width: 634.890625px; background-color: #ffffcc; background-image: url('http:\/\/www.crsay.com\/wiki\/lib\/plugins\/note\/images\/important.png'); background-position: 13px 50%; background-repeat: no-repeat no-repeat;\">12\/02\/13\u8865\u5145: \u90d1\u91cd\u5efa\u8bae\u4e0d\u518d\u4f7f\u7528ntpdate\u4e86\uff0c\u4ee5\u4e0b\u5185\u5bb9\u4ec5\u4f9b\u53c2\u8003\uff0c\u4e0d\u5efa\u8bae\u4f7f\u7528<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>CentOS\u914d\u7f6e\u65f6\u95f4\u540c\u6b65NTP \u4e3a\u4ec0\u4e48\u8981\u4f7f\u7528ntpd\u800c\u4e0d\u662fntpdate\uff1f \u539f\u56e0\u5f88\u7b80\u5355\uff0cntpd\u662f\u6b65\u8fdb\u5f0f\u7684\u9010\u6e10\u8c03\u6574\u65f6\u95f4\uff0c\u800cntpdate\u662f\u65ad\u70b9\u66f4\u65b0\uff0c\u6bd4\u5982\u73b0\u5728\u670d\u52a1\u5668\u65f6\u95f4\u662f9.18\u5206\uff0c\u800c\u6807\u51c6\u65f6\u95f4\u662f9.28\u5206\uff0cntpd\u4f1a\u5728\u4e00\u6bb5\u65f6\u95f4\u5185\u9010\u6e10\u7684\u628a\u65f6\u95f4\u6821\u51c6\u5230\u4e0e\u6807\u51c6\u65f6\u95f4\u76f8\u540c\uff0c\u800cntpdate\u4f1a\u7acb\u523b\u628a\u65f6\u95f4\u8c03\u6574\u52309.28\u5206\uff0c\u5982\u679c\u4f60\u5f80\u6570\u636e\u5e93\u5185\u5199\u5165\u5185\u5bb9\u6216\u5728\u5176\u4ed6\u5bf9\u65f6\u95f4\u6709\u4e25\u683c\u8981\u6c42\u7684\u751f\u4ea7\u73af\u5883\u4e0b\uff0c\u4ea7\u751f\u7684\u540e\u679c\u4f1a\u662f\u5f88\u4e25\u91cd\u7684\u3002\uff08\u6ce8\uff1a\u5f53\u672c\u5730\u65f6\u95f4\u4e0e\u6807\u51c6\u65f6\u95f4\u76f8\u5dee30\u5206\u949f\u4ee5\u4e0a\u662fntpd\u4f1a\u505c\u6b62\u5de5\u4f5c\uff09 NTP\u901a\u4fe1\u534f\u8bae\u539f\u7406 1.\u9996\u5148\u4e3b\u673a\u542f\u52a8NTP\u3002 2.\u5ba2\u6237\u7aef\u4f1a\u5411NTP\u670d\u52a1\u5668\u53d1\u9001\u8c03\u6574\u65f6\u95f4\u7684message\u3002 3.\u7136\u540eNTP server\u4f1a\u9001\u51fa\u5f53\u524d\u7684\u6807\u51c6\u65f6\u95f4\u7ed9client 4.client\u63a5\u53d7\u6765\u81easerver\u7684\u65f6\u95f4\u540e\uff0c\u4f1a\u6839\u636e\u8fd9\u4e2a\u4fe1\u606f\u6765\u8c03\u6574\u81ea\u5df1\u7684\u65f6\u95f4\u3002\u8fd9\u6837\u5c31\u5b9e\u73b0\u4e86\u7f51\u7edc\u5bf9\u65f6\u3002 NTP\u8fd9\u4e2adeamon\u91c7\u7528\u4e86123\u7aef\u53e3\u3002\uff08UDP\uff09 \u201c\u5f53\u6211\u4eec\u8981\u5229\u7528Tim server\u6765\u8fdb\u884c\u5b9e\u8df5\u7684\u540c\u6b65\u66f4\u65b0\u65f6\uff0c\u5c31\u9700\u8981\u4f7f\u7528NTP\u8f6f\u4ef6\u63d0\u4f9b\u7684ntpdate\u6765\u8fde\u63a5\u7aef\u53e3123\u201d \u4e0e\u65f6\u95f4\u76f8\u5173\u7684\u4e00\u4e9b\u547d\u4ee4\u548c\u914d\u7f6e\u6587\u4ef6 1.\/etc\/ntp.conf linux\u5404\u7248\u672c\u867d\u7136\u76ee\u5f55\u4e0d\u540c\uff0c\u4f46\u6587\u4ef6\u540d\u76f8\u540c\u3002\u53ef\u4ee5\u7528which ntp.conf \u6216\u8005locate ntp.conf\u6765\u67e5\u627e\u3002\u8fd9\u662fNTP\u552f\u4e00\u7684\u4e00\u4e2a\u8bbe\u7f6e\u6587\u4ef6\u3002 2.\/usr\/share\/zoneinfo\/ \u8fd9\u4e2a\u91cc\u9762\u89c4\u5b9a\u4e86\u8fd9\u4e2a\u4e3b\u8981\u65f6\u533a\u7684\u65f6\u95f4\u8bbe\u7f6e\u6587\u4ef6\u3002 3.\/etc\/sysconfig\/clock \u8fd9\u4e2a\u6587\u4ef6\u662flinux\u7684\u4e3b\u8981\u65f6\u533a\u8bbe\u7f6e\u6587\u4ef6\uff0c\u6bcf\u6b21\u5f00\u673a\u540elinux\u4f1a\u81ea\u52a8\u8bfb\u53d6\u8fd9\u4e2a\u6587\u4ef6\u6765\u8bbe\u7f6e\u7cfb\u7edf\u6240\u9ed8\u8ba4\u7684\u663e\u793a\u65f6\u95f4\uff0c\u53ef\u4ee5\u770b\u770b\u5b83\u91cc\u9762\u5230\u5e95\u8bbe\u7f6e\u4e86\u4ec0\u4e48\uff1a cat \/etc\/sysconfig\/clock # The ZONE parameter is only evaluated by system-config-date. # The timezone of the system is defined by the contents of \/etc\/localtime. ZONE=&#8221;Asia\/Shanghai&#8221; UTC=true ARC=false 4.\/etc\/localtime \u672c\u5730\u7aef\u65f6\u95f4\u914d\u7f6e\u6587\u4ef6\u3002 5.\/bin\/date \u8fd9\u4e2a\u662f\u65f6\u95f4\u7684\u4fee\u6539\u547d\u4ee4\uff0c\u9664\u4e86\u8f93\u51fa\u65f6\u95f4\uff0c\u8fd8\u53ef\u4ee5\u4fee\u6539\u65f6\u95f4\u3002 6.\/sbin\/hwclock \u56e0\u4e3alinux\u7cfb\u7edf\u4e0a\u9762BIOS\u65f6\u95f4\u4e0elinux\u7cfb\u7edf\u65f6\u95f4\u662f\u5206\u5f00\u7684\uff0c\u6240\u4ee5\u4f7f\u7528date\u8fd9\u4e2a\u6307\u4ee4\u8c03\u6574\u4e86\u65f6\u95f4\u4e4b\u540e\uff0c\u8fd8\u9700\u8981\u4f7f\u7528hwclock\u624d\u80fd\u5c06\u4fee\u6539\u8fc7\u7684\u65f6\u95f4\u5199\u5165BIOS\u4e2d\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[],"class_list":["post-387","post","type-post","status-publish","format-standard","hentry","category-centos-6"],"_links":{"self":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/comments?post=387"}],"version-history":[{"count":0,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/387\/revisions"}],"wp:attachment":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/media?parent=387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/categories?post=387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/tags?post=387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}