{"id":1415,"date":"2012-02-14T11:35:45","date_gmt":"2012-02-14T03:35:45","guid":{"rendered":"http:\/\/doophp.sinaapp.com\/?p=1415"},"modified":"2012-02-14T12:05:31","modified_gmt":"2012-02-14T04:05:31","slug":"ntpd-ntpdate","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/linux\/ntpd-ntpdate.html","title":{"rendered":"Linux\u65f6\u95f4\u540c\u6b65\uff1antpd\u3001ntpdate"},"content":{"rendered":"
ntpd VS ntpdate<\/strong><\/p>\n \u4e24\u8005\u6709\u4e2a\u6bd4\u8f83\u5b9e\u8d28\u6027\u7684\u5dee\u5f02\u662f\uff0cntpd\u5728\u5b9e\u9645\u540c\u6b65\u65f6\u95f4\u65f6\u662f\u4e00\u70b9\u70b9\u7684\u6821\u51c6\u8fc7\u6765\u65f6\u95f4\u7684\uff0c\u6700\u7ec8\u628a\u65f6\u95f4\u6162\u6162\u7684\u6821\u6b63\u5bf9\u3002\u800cntpdate\u4e0d\u4f1a\u8003\u8651\u5176\u4ed6\u7a0b\u5e8f\u662f\u5426\u4f1a\u9635\u75db\uff0c\u76f4\u63a5\u8c03\u6574\u65f6\u95f4.\u4e00\u4e2a\u662f\u6821\u51c6\uff0c\u4e00\u4e2a\u662f\u8c03\u6574\u3002\u53e6\u5916ntpd \u5728\u548c\u65f6\u95f4\u670d\u52a1\u5668\u7684\u540c\u6b65\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u628a BIOS \u8ba1\u65f6\u5668\u7684\u632f\u8361\u9891\u7387\u504f\u5dee\u2014\u2014\u6216\u8005\u8bf4 Local Clock \u7684\u81ea\u7136\u6f02\u79fb(drift)\u2014\u2014\u8bb0\u5f55\u4e0b\u6765\u3002\u8fd9\u6837\u5373\u4f7f\u7f51\u7edc\u6709\u95ee\u9898\uff0c\u672c\u673a\u4ecd\u7136\u80fd\u7ef4\u6301\u4e00\u4e2a\u76f8\u5f53\u7cbe\u786e\u7684\u8d70\u65f6\u3002<\/p>\n \u4f7f\u7528ntpd\u8fd8\u9700\u8981\u8003\u8651\u5230\u4e00\u4e2a\u7ec6\u8282\u662f\uff0c\u5982\u679cclient\u4e0eserver\u65f6\u5dee\u5f02\u5e38\u5927\u6216\u8fc7\u5c0f\uff0cntpd\u5c06\u4f1a\u62d2\u7eddserver\u53c2\u8003\u65f6\u95f4\u3002<\/p>\n \u53e6\u5916\u8fd8\u6709\u4e2a\u672a\u7ecf\u8bc1\u5b9e\u7684\u7ecf\u9a8c\uff0c\u5728\u670d\u52a1\u5668\u538b\u529b\u7279\u522b\u5927\u7684\u60c5\u51b5\u4e0b\uff0cntpdate\u4f1a\u628a\u65f6\u95f4\u5bf9\u9519\uff0c\u6bd4\u5982\u53d8\u62101970-1-1.\u5f15\u7528<\/a><\/small><\/p>\n \u4e00\u822c\u6765\u8bb2\uff0c\u5c3d\u91cf\u4f7f\u7528ntpd\u4ee3\u66ffntpdate\u6765\u540c\u6b65\u65f6\u95f4\uff0c\u5c3d\u7ba1ntpdate\u6709\u5982\u6b64\u8bdf\u75c5\uff08\u751a\u81f3\u4e00\u4e9b\u7ae5\u978b\u558a\u51fa\u4e0d\u62db\u8058\u6216\u8005\u88c1\u6389\u7528ntpdate\u4ee3\u66ffntpd\u7684\u61d2\u4eba:)\uff09\uff0c\u4f46\u662f\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u8fd8\u662f\u53ef\u4ee5\u8003\u8651ntpdate\u7684\uff1a<\/p>\n \u7528ntpdate\u8c03\u6574\u65f6\u95f4\u7684\u65b9\u5f0f\uff0c\u4f1a\u6709\u51e0\u4e2a\u975e\u5e38\u660e\u663e\u7684\u95ee\u9898\uff1a<\/p>\n \u8bb8\u591a\u5e94\u7528\u7a0b\u5e8f\u4f9d\u8d56\u8fde\u7eed\u7684\u65f6\u949f\uff0c\u53d6\u5f97\u7684\u65f6\u95f4\u662f\u7ebf\u6027\u7684\u3002\u4f8b\u5982\u6570\u636e\u5e93\u4e8b\u52a1\uff0c\u901a\u5e38\u4f1a\u5730\u4f9d\u8d56\u8fd9\u6837\u7684\u4e8b\u5b9e\uff1a\u65f6\u95f4\u4e0d\u4f1a\u5f80\u56de\u8df3\u8dc3\u3002<\/p>\n \u6211\u4eec\u53ef\u4ee5\u60f3\u8c61\u4ee5\u4e0b\uff0c\u5047\u5982Oracle\u670d\u52a1\u5668\u7684\u65f6\u95f4\u662f01:00 AM,\u6807\u51c6\u65f6\u95f4\u662f00:30 AM,\u5f88\u660e\u663eOracle\u670d\u52a1\u5668\u7ecf\u8fc7\u4ed6\u81ea\u5df1\u7684\u65f6\u95f400:40 AM\u3002\u5047\u82e5\u6b64\u65f6\u76f4\u63a5\u4f7f\u7528ntpdate\u5c06\u670d\u52a1\u5668\u4e0e\u6807\u51c6\u65f6\u95f4\u540c\u6b65\uff0c\u90a3\u4e48\u610f\u5473\u7740Oracle\u670d\u52a1\u5668\u5c06\u5728\u540c\u4e00\u5929\u7ecf\u8fc7\u4e24\u4e2a00:40 AM,\u8fd9\u5bf9\u4e8e\u67d0\u4e9b\u8ba1\u5212\u4efb\u52a1\u6765\u8bf4\u53ef\u80fd\u662f\u81f4\u547d\u7684\u3002<\/p>\n \u56e0\u800c\uff0c\u552f\u4e00\u4e00\u4e2a\u53ef\u4ee5\u4ee4\u65f6\u95f4\u53d1\u751f\u8df3\u53d8\u7684\u70b9\uff0c\u662f\u8ba1\u7b97\u673a\u521a\u521a\u542f\u52a8\uff0c\u4f46\u8fd8\u6ca1\u6709\u542f\u52a8\u5f88\u591a\u670d\u52a1\u7684\u90a3\u4e2a\u65f6\u5019\u3002\u5176\u4f59\u7684\u65f6\u5019\uff0c\u7406\u60f3\u7684\u505a\u6cd5\u662f\u4f7f\u7528ntpd\u6765\u6821\u51c6\u65f6\u949f\uff0c\u800c\u4e0d\u662f\u8c03\u6574\u8ba1\u7b97\u673a\u65f6\u949f\u4e0a\u7684\u65f6\u95f4\u3002<\/p>\n<\/div>\n \u5e38\u7528\u76d1\u6d4bntpd\u540c\u6b65\u72b6\u6001\u547d\u4ee4<\/strong><\/p>\n \u901a\u5e38\u91c7\u7528ntpdate\u540c\u6b65\u65f6\u95f4\u65f6\u662f\u8bbe\u7f6e\u4e00\u4e2acrontab\u4efb\u52a1\uff0c\u4e00\u4e2a\u5468\u671f\u5185\u91cd\u590d\u6267\u884c\u540c\u6b65\u547d\u4ee4\uff0c\u800cntpd\u4fa7\u662f\u5b88\u62a4\u8fdb\u7a0b\uff0c\u8fd0\u884c\u72b6\u6001\u53ef\u4ee5\u968f\u65f6\u76d1\u63a7\uff08\u9ed8\u8ba4\u65e5\u5fd7\u6587\u4ef6\u662fsystem log\uff0c\u53ef\u914d\u7f6e\uff09<\/p>\n ntpstat<\/p>\n ntptrace<\/p>\n ntpq -p<\/p>\n \u914d\u7f6e\u6587\u4ef6<\/strong><\/p>\n\n
\n