{"id":954,"date":"2017-03-20T15:03:01","date_gmt":"2017-03-20T07:03:01","guid":{"rendered":"http:\/\/www.siediyer.cn\/?p=954"},"modified":"2017-03-20T15:03:19","modified_gmt":"2017-03-20T07:03:19","slug":"%e7%ba%bf%e4%b8%8a%e6%9c%8d%e5%8a%a1%e7%9b%91%e6%8e%a7%e4%b8%8e%e6%8a%a5%e8%ad%a6%e6%96%b9%e6%a1%88","status":"publish","type":"post","link":"https:\/\/www.siediyer.cn\/?p=954","title":{"rendered":"\u7ebf\u4e0a\u670d\u52a1\u76d1\u63a7\u4e0e\u62a5\u8b66\u65b9\u6848"},"content":{"rendered":"<h2>\u4e00\u3001\u80cc\u666f<\/h2>\n<h3>1\u3001\u4e0a\u7ebf\u671f\u95f4\u670d\u52a1\u7a33\u5b9a\u6027\u89c2\u5bdf\u8f83\u56f0\u96be<\/h3>\n<p>\u4e00\u4e2a\u529f\u80fd\u4e0a\u7ebf\u540e\uff0c\u5176\u5b9e\u7814\u53d1\u5fc3\u91cc\u6839\u672c\u6ca1\u5e95\u513f\uff0c\u4e0d\u77e5\u9053\u8fd9\u4e2a\u529f\u80fd\u4e0a\u7ebf\u4ee5\u540e\u662f\u4e0d\u662f\u771f\u7684\u6ca1\u95ee\u9898\uff1b\u6709\u7ecf\u9a8c\u4e00\u4e9b\u8001\u540c\u5b66\u8fd8\u77e5\u9053\u76f4\u63a5\u767b\u5f55\u7ebf\u4e0a\u673a\u5668\u53bb<code>tail -f<a class=\"replace_word\" title=\"PHP\u77e5\u8bc6\u5e93\" href=\"http:\/\/lib.csdn.net\/base\/php\" target=\"_blank\">PHP<\/a>.error.log<\/code>\uff0c\u4f46\u662f\u5bf9\u4e8e\u65b0\u540c\u5b66\u6765\u8bf4\uff0c\u57fa\u672c\u5c31\u53ea\u80fd\u7b49\u7740<code>\u88ab\u901a\u77e5<\/code>\u670d\u52a1\u6545\u969c\u3002<\/p>\n<p>\u9000\u4e00\u6b65\u8bf4\uff0c\u5373\u4fbf\u662f\u80fd\u53bb\u7ebf\u4e0a\u53bb<code>tail -f<\/code>\u67e5\u770b\u9519\u8bef\u65e5\u5fd7\uff0c\u4f46\u662f\u7ebf\u4e0a\u662f\u591a\u96c6\u7fa4\u90e8\u7f72\u7684\uff0c\u670d\u52a1\u5668\u90fd\u7279\u522b\u591a\uff0c\u7814\u53d1\u4e0d\u53ef\u80fd\u5728\u6bcf\u4e00\u53f0\u673a\u5668\u4e0a\u90fd\u80fd\u770b\u5230\u65e5\u5fd7\uff1b\u5373\u4fbf\u662f\u6709\u65e5\u5fd7\u6536\u96c6\u673a\u5668\uff0c\u4e5f\u5f97\u5728\u5404\u4e2a\u96c6\u7fa4\u4e0b\u5206\u522b<code>tail -f<\/code>\uff0c\u5b9a\u4f4d\u95ee\u9898\u5f88\u4e0d\u65b9\u4fbf\uff01<\/p>\n<p>\u518d\u9000\u4e00\u6b65\u8bf4\uff0c\u5373\u4fbf\u662f\u5728\u7ebf\u4e0a\u673a\u5668\u770b\u5230\u4e86php\u9519\u8bef\u65e5\u5fd7\uff0c\u4e5f\u5e76\u6ca1\u6709\u8db3\u591f\u591a\u7684\u4fe1\u606f\u8f85\u52a9\u4fe1\u606f\u80fd\u591f\u8fc5\u901f\u5b9a\u4f4d\u51fa\u6765\uff0c\u600e\u6837\u7684\u4e00\u6b21\u8bbf\u95ee\u8bf7\u6c42\uff0c\u5bfc\u81f4\u4e86\u8fd9\u4e2a\u9519\u8bef\u3002\u56e0\u4e3aphp\u8bb0\u5f55\u7684\u65e5\u5fd7\u4e00\u822c\u90fd\u662f\u8fd9\u4e2a\u683c\u5f0f\uff1a<\/p>\n<pre class=\"lang:default decode:true \">[22-Oct-2015 18:39:04 Asia\/Shanghai] PHP Fatal error:  Call to a member function prepare() on null in \/home\/work\/phplib\/db\/Database.class.php on line 238<\/pre>\n<h3>2\u3001\u5e73\u65f6\u7ebf\u4e0a\u670d\u52a1\u7a33\u5b9a\u6027\u65e0\u6cd5\u5bdf\u89c9<\/h3>\n<p>\u771f\u6b63\u7ebf\u4e0a\u51fa\u95ee\u9898\u8f83\u591a\u7684\uff0c\u5176\u5b9e\u8fd8\u662f\u7cfb\u7edf\u8fd0\u884c\u8fc7\u7a0b\u4e2d\uff1b\u6bd4\u5982\u6d41\u91cf\u7a81\u7136\u589e\u52a0\u5bfc\u81f4\u63a5\u53e3\u5904\u7406\u51fa\u9519\u3001\u6240\u4f9d\u8d56\u7684\u7b2c\u4e09\u65b9\u670d\u52a1\u5b95\u6389\u5bfc\u81f4\u7684\u7a0b\u5e8f\u9519\u8bef\u3001\u7f51\u7edc\u539f\u56e0\u5bfc\u81f4\u63a5\u53e3\u4e0d\u80fd\u6b63\u5e38\u5de5\u4f5c\uff0c\u7b49\u7b49\u3002\u56e0\u4e3a\u5e73\u65f6\u7cfb\u7edf\u8fd0\u884c\u4e2d\uff0c\u5927\u5bb6\u4e0d\u4f1a\u6709\u4e13\u95e8\u7684\u4eba\u53bb\u7ebf\u4e0a\u65e5\u5fd7\u673a\u5668\u4e00\u76f4<code>tail -f<\/code>\u8fdb\u884c\u89c2\u5bdf\uff0c\u6548\u7387\u4f4e\uff0c\u4e14\u4e0d\u73b0\u5b9e\u3002<\/p>\n<h3>3\u3001\u63a5\u53e3\u6027\u80fd\u95ee\u9898\u65e0\u4eba\u5173\u6ce8<\/h3>\n<p>\u4e00\u4e2a\u63a5\u53e3\uff0c\u53ef\u80fd\u56e0\u4e3a\u4ea7\u54c1\u4e0a\u7684\u5404\u79cd\u539f\u56e0\uff0c\u7814\u53d1\u4f1a\u4e0d\u505c\u5730\u5f80\u4e0a\u9762\u6253\u8865\u4e01\u8fdb\u884c\u5b9e\u73b0\uff0c\u5f88\u591a\u60c5\u51b5\u4e0b\uff0c\u4f1a\u56e0\u4e3a\u529f\u80fd\u4e0a\u7ebf\u6bd4\u8f83\u7d27\u5f20\uff0c\u6240\u4ee5\u5b9e\u73b0\u8fc7\u7a0b\u4e2d\u5ffd\u7565\u4e86\u63a5\u53e3\u6027\u80fd\u3002\u5728\u4e00\u6bb5\u65f6\u95f4\u5185\uff0c\u4e00\u4e2a\u63a5\u53e3\u7684\u54cd\u5e94\u65f6\u95f4\u4ece100ms\u4e0a\u5347\u5230300ms\uff0c\u63a5\u53e3\u53ef\u7528\u6027\u4ece99.99\u4e0b\u964d\u523090.00\uff1b\u4e5f\u8bb8\u5728\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u4e0d\u4f1a\u611f\u77e5\u5230\u9010\u6e10\u6539\u9020\u540e\u7684\u63a5\u53e3\u5bf9\u7ebf\u4e0a\u9020\u6210\u4e86\u4ec0\u4e48\u5f71\u54cd\uff0c\u4f46\u5176\u5b9e\u4e0d\u7136\uff0c\u63a5\u53e3<code>SLA<\/code>\u975e\u5e38\u91cd\u8981\uff01\u53ef\u662f\uff0c\u8fd9\u4e9b\u4fe1\u606f\u6211\u4eec\u901a\u8fc7\u4ec0\u4e48\u6837\u7684\u65b9\u5f0f\u624d\u80fd\u5f97\u77e5\u5462\uff0c\u771f\u6b63\u80fd\u63d0\u4f9b\u8fd9\u4e9b\u4fe1\u606f\u7684\u540c\u5b66\uff0c\u5e76\u4e0d\u591a\uff01<\/p>\n<h3>4\u3001\u8c01\u6765\u8ddf\u8fdb\u5df2\u53d1\u73b0\u7684\u95ee\u9898<\/h3>\n<p>\u8fd8\u6709\u4e00\u4e9b\u60c5\u51b5\u662f\uff0c\u7ebf\u4e0a\u51fa\u4e86\u95ee\u9898\uff0c\u4e14\u5176\u4ed6\u7ec4\u7684\u540c\u5b66\u5e2e\u52a9\u5b9a\u4f4d\u5230\u5927\u81f4\u7684\u95ee\u9898\u8303\u56f4\uff0c\u629b\u5230\u7814\u53d1\u7fa4\u4ee5\u540e\uff0c\u6ca1\u4eba\u4e3b\u52a8\u54cd\u5e94\uff1b\u5927\u5bb6\u90fd\u4f1a\u89c9\u5f97<code>\u6211\u6ca1\u6539\u8fc7\u8fd9\u4e2a\u4e1c\u897f<\/code>\uff0c\u6240\u4ee5\u5ffd\u7565\u4e86\uff1b\u4e8e\u662f\u4e00\u4e2a\u7ebf\u4e0a\u95ee\u9898\u5c31\u53ea\u80fd\u7b49\u7740Leader\u6765\u5b89\u6392\u8ddf\u8fdb\uff0c\u5426\u5219\u5c31\u77f3\u6c89\u5927\u6d77\uff0c\u957f\u671f\u5f71\u54cd\u7528\u6237\u4f7f\u7528\u3002<\/p>\n<p><strong>\u7efc\u4e0a\uff0c\u6211\u4eec\u5fc5\u987b\u8981\u6709\u4e00\u5957\u81ea\u52a8\u5316\u7684\u7ebf\u4e0a\u670d\u52a1\u76d1\u63a7\u548c\u9884\u8b66\u65b9\u6848\uff0c\u4e3b\u52a8\u53d1\u73b0\uff0c\u53ca\u65f6\u8ddf\u8fdb\uff01<\/strong><\/p>\n<h2>\u4e8c\u3001\u76d1\u63a7\u8303\u56f4<\/h2>\n<p>\u4e3a\u4e86\u80fd\u5bf9\u7ebf\u4e0a\u670d\u52a1\u72b6\u51b5\u4e86\u5982\u6307\u638c\uff0c\u6211\u4eec\u9700\u8981\u76d1\u63a7\u7684\u5185\u5bb9\u4e00\u5b9a\u5f97\u662f\u5f88\u5168\u7684\uff0c\u4f46\u4e00\u5f00\u59cb\u5f97\u6709\u4e00\u4e2a\u91cd\u70b9\u76d1\u63a7\u7684\u8303\u56f4\uff0c\u4e5f\u662f\u5e73\u65f6\u6700\u5bb9\u6613\u51fa\u95ee\u9898\u7684\u5730\u65b9\uff1a<\/p>\n<ul>\n<li>\u7f16\u7801\u7c97\u5fc3\u5bfc\u81f4\u7684PHP Syntax\/Parse Error<\/li>\n<li>\u7a0b\u5e8f\u4ee3\u7801\u4e2d\u7684PHP Fatal Error<\/li>\n<li>\u7a0b\u5e8f\u4ee3\u7801\u4e2d\u7684PHP Warning<\/li>\n<li>\u6570\u636e\u5e93\u8bbf\u95ee\u5bfc\u81f4\u7684DB Error\/Timeout\u7b49<\/li>\n<li>\u7f13\u5b58\u7cfb\u7edfRedis\u76f8\u5173\u7684\u9519\u8bef<\/li>\n<li>\u7f13\u5b58\u7cfb\u7edfMemcache\u76f8\u5173\u7684\u9519\u8bef<\/li>\n<li>\u7ebf\u4e0a\u63a5\u53e3\u7684\u53ef\u7528\u6027\u76d1\u63a7<\/li>\n<li>\u7ebf\u4e0a\u63a5\u53e3\u7684\u54cd\u5e94\u65f6\u95f4\u76d1\u63a7<\/li>\n<\/ul>\n<h2>\u4e09\u3001\u5b9e\u73b0\u65b9\u6848\u3010\u5982\u4f55\uff1a\u91c7\u3011<\/h2>\n<h3>1\u3001PHP\u76f8\u5173\u9519\u8bef\u76d1\u63a7<\/h3>\n<p>\u5305\u62ec\u8bed\u6cd5\u9519\u8bef\u3001\u4ee5\u53ca\u8fd0\u884c\u671f\u95f4\u7684Fatal\u3001Warning\u7b49\uff0c\u90fd\u53ef\u4ee5\u501f\u52a9PHP\u63d0\u4f9b\u7684<code>register_sutdown_function<\/code>\u548c<code>set_error_handler<\/code>\u7ec4\u5408\u7684\u5f62\u5f0f\u6765\u5b9e\u73b0\uff1a<\/p>\n<pre class=\"lang:default decode:true \">\/**\r\n * \u7edf\u4e00\u622a\u83b7\u5e76\u5904\u7406\u9519\u8bef\r\n * @return bool\r\n *\/\r\npublic static function registErrorHandler() {\r\n    $e_types = array (\r\n        E_ERROR   =&gt; 'PHP Fatal',\r\n        E_WARNING =&gt; 'PHP Warning',\r\n        E_PARSE   =&gt; 'PHP Parse Error',\r\n        E_NOTICE  =&gt; 'PHP Notice'\r\n    );\r\n    register_shutdown_function(function () use ($e_types) {\r\n        $error = error_get_last();\r\n        if ($error['type'] != E_NOTICE &amp;&amp; !empty($error['message'])) {\r\n            $error['trace'] = self::getStackTrace();\r\n            self::error_handler($error);\r\n        }\r\n    });\r\n    set_error_handler(function ($type, $message, $file, $line) use ($e_types) {\r\n        if ($type != E_NOTICE &amp;&amp; !empty($message)) {\r\n            $error = array (\r\n                'type'    =&gt; $type,\r\n                'message' =&gt; $message,\r\n                'file'    =&gt; $file,\r\n                'line'    =&gt; $line,\r\n                'trace'   =&gt; self::getStackTrace()\r\n            );\r\n\r\n            self::error_handler($error);\r\n            \/\/ \u88ab\u622a\u83b7\u7684\u9519\u8bef\uff0c\u91cd\u65b0\u8f93\u51fa\u5230\u9519\u8bef\u6587\u4ef6\r\n            error_log(($e_types[$type] ?: 'Unknown Problem') . ' :  ' . $message . ' in ' . $file . ' on line ' . $line . \"\\n\");\r\n        }\r\n    }, E_ALL);\r\n}<\/pre>\n<p>\u5f53\u7136\uff0c\u8fd9\u4e2a\u9700\u8981\u5728\u7a0b\u5e8f\u7684\u5165\u53e3\u5904\u8fdb\u884c\u6ce8\u518c\uff0c\u4fdd\u8bc1\u6bcf\u4e00\u6b21\u7684\u7a0b\u5e8f\u6267\u884c\uff0c\u90fd\u80fd\u6210\u529f\u6355\u83b7\u9519\u8bef\uff1a<\/p>\n<pre class=\"lang:default decode:true \">\/\/ \u5168\u5c40\u5f02\u5e38\u6355\u83b7\r\nMonitorManager::registErrorHandler();<\/pre>\n<p>\u901a\u8fc7\u8fd9\u4e2a\u65b9\u5f0f\uff0c\u6211\u4eec\u5728\u4e1a\u52a1\u5c42\u5c31\u80fd\u5b8c\u5168\u6355\u83b7\u63a5\u53e3\u6267\u884c\u8fc7\u7a0b\u4e2d\u7684\u4efb\u610f\u9519\u8bef\u3002<\/p>\n<h3>2\u3001DB\u3001Memcache\u3001Redis\u76f8\u5173\u9519\u8bef\u7684\u76d1\u63a7<\/h3>\n<p>\u5728\u5404\u4e2a<code>SDK<\/code>\u5185\u90e8\uff0c\u5c06\u6267\u884c\u8fc7\u7a0b\u4e2d\u7684\u5f02\u5e38\u90fd\u5411\u4e0a\u629b\u51fa\uff08<code>throw new Exception<\/code>\uff09\uff0c\u5185\u5bb9\u5c3d\u53ef\u80fd\u8be6\u7ec6\uff0c\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>DB\u9519\u8bef\n<ul>\n<li>\u5177\u4f53\u7684SQL<\/li>\n<li>\u5177\u4f53\u7684DB\u3001Table<\/li>\n<li>\u9519\u8bef\u6808<\/li>\n<li>\u5bf9\u5e94\u7684\u63a5\u53e3\u540d\u79f0<\/li>\n<li>\u670d\u52a1\u5668IP<\/li>\n<\/ul>\n<\/li>\n<li>Memcache\u3001Redis\u9519\u8bef\n<ul>\n<li>\u5177\u4f53\u9519\u8bef\u53f7\uff08\u5185\u5bb9\uff09<\/li>\n<li>\u51fa\u9519\u7684Memcache Key<\/li>\n<li>\u9519\u8bef\u6808<\/li>\n<li>\u5bf9\u5e94\u7684\u63a5\u53e3\u540d\u79f0<\/li>\n<li>\u670d\u52a1\u5668IP<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u540c\u65f6\uff0c\u6211\u4eec\u901a\u8fc7\u4e00\u4e2a\u7edf\u4e00\u5de5\u5177\u65b9\u6cd5\u8fdb\u884c\u6536\u96c6\u9519\u8bef\u65e5\u5fd7\uff0c\u4e0b\u9762\u8bf4\u5982\u4f55<code>\u6536\u96c6<\/code>\u3002<\/p>\n<h2>\u56db\u3001\u5b9e\u73b0\u65b9\u6848\u3010\u5982\u4f55\uff1a\u96c6\u3011<\/h2>\n<p>\u6240\u6709\u7684\u9519\u8bef\u4e0d\u91c7\u53d6\u76f4\u63a5\u4e0a\u62a5\uff0c\u56e0\u4e3a\u8fd9\u5fc5\u7136\u4f1a\u76f4\u63a5\u5f71\u54cd\u5f53\u524d\u63a5\u53e3\u7684\u6027\u80fd\uff0c\u6240\u4ee5\u91c7\u53d6\u961f\u5217\u65b9\u5f0f\u8fdb\u884c\u6536\u96c6\uff0c\u5373\uff1a\u4e1a\u52a1\u5c42\u6216SDK\u4e2d\u6709\u9519\u8bef\u4ea7\u751f\u65f6\uff0c\u7edf\u4e00\u901a\u8fc7\u4e00\u4e2a\u5de5\u5177\u65b9\u6cd5\u8fdb\u884c\u6536\u96c6\uff0c\u6536\u96c6\u4e4b\u540e\uff0c\u5c06\u8be5\u9519\u8bef\u5185\u5bb9\u76f4\u63a5\u5165\u961f\u5217\uff0c\u53e6\u5916\u5f00\u542f\u4e00\u4e2a\u961f\u5217\u5b9e\u65f6\u6d88\u8017\u8fdb\u7a0b\uff0c\u5c06\u961f\u5217\u4e2d\u7684\u9519\u8bef\u65e5\u5fd7\u6570\u636e\u4e0a\u62a5\u5230\u670d\u52a1\u5668\u8fdb\u884c\u5904\u7406\u3002<\/p>\n<h3>1\u3001\u65e5\u5fd7\u6536\u96c6\u7684\u5de5\u5177\u65b9\u6cd5<\/h3>\n<pre class=\"lang:default decode:true \">\/**\r\n * \u6dfb\u52a0\u76d1\u63a7\u65e5\u5fd7\uff0c\u65e5\u5fd7\u4f1a\u88ab\u5f02\u6b65\u6536\u96c6\u5230\u65e5\u5fd7\u5e73\u53f0\u8fdb\u884c\u5c55\u793a\r\n *\r\n * @param $type\r\n * @param $content\r\n *\/\r\npublic static function collect($type, $content) {\r\n    \/\/ \u7ebf\u4e0a\u96c6\u7fa4\uff0c\u5e76\u4e14\u5f00\u5173\u5904\u4e8e\u6253\u5f00\u72b6\u6001\uff0c\u624d\u8fdb\u884c\u6536\u96c6\r\n    if (Utilities::isOnlineCluster() &amp;&amp; SwitchManager::getSwitch('collect', SwitchManager::SWITCH_MONITOR)) {\r\n        \/\/ \u68c0\u67e5\u5f53\u524d\u8fd9\u79cd\u76d1\u63a7\u7c7b\u578b\u662f\u5426\u652f\u6301\r\n        if (self::support($type) &amp;&amp; !self::checkWhiteList($type, $content)) {\r\n            self::queueInstance()-&gt;enQueue(json_encode(array (\r\n                'type'    =&gt; $type,\r\n                'data'    =&gt; $content,\r\n                'cluster' =&gt; Utilities::getClusterName(),\r\n                'reqtime' =&gt; isset($_SERVER['REQUEST_TIME']) ? $_SERVER['REQUEST_TIME'] : time(),\r\n                'extinfo' =&gt; array (\r\n                    'domain'    =&gt; $_SERVER['SERVER_NAME'],\r\n                    'path'      =&gt; isset($_SERVER['QUERY_STRING']) ? str_replace('?' . $_SERVER['QUERY_STRING'], '', $_SERVER['REQUEST_URI']) : 'script',\r\n                    'userAgent' =&gt; isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '',\r\n                    'referer'   =&gt; isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '',\r\n                    'serverIp'  =&gt; Utilities::getServerPhpIP(),\r\n                    'reqData'   =&gt; json_encode($_REQUEST, true)\r\n                )\r\n            ), true));\r\n        }\r\n    }\r\n}<\/pre>\n<p>\u4ece\u4e0a\u9762\u7684\u65b9\u6cd5\u53ef\u770b\u51fa\uff0c\u9664\u4e86\u5177\u4f53\u7684\u9519\u8bef\u65e5\u5fd7\uff0c\u6211\u4eec\u8fd8\u4e00\u5e76\u6536\u96c6\u4e86\u4e00\u4e9b\u975e\u5e38\u91cd\u8981\u7684\u8f85\u52a9\u4fe1\u606f\uff0c\u6bd4\u5982\u5f53\u524d\u96c6\u7fa4\u3001\u51fa\u95ee\u9898\u7684\u57df\u540d\u3001\u5bf9\u5e94\u63a5\u53e3\u3001userAgent\u3001\u8bf7\u6c42\u53c2\u6570\u3001\u63a5\u53e3\u4ece\u54ea\u513f\u6765\u7684\u7b49\u7b49\u3002<\/p>\n<h3>2\u3001\u961f\u5217\u5b9e\u65f6\u6d88\u8017\u811a\u672c<\/h3>\n<pre class=\"lang:default decode:true \">&lt;?php\r\nnamespace Mlservice\\Script\\Monitor;\r\n\r\nuse Framework\\Libs\\Monitor\\MonitorManager;\r\nuse Framework\\Libs\\Util\\Utilities;\r\n\r\n\/**\r\n * \u4eceMC\u961f\u5217\u4e2d\uff0c\u5c06\u5404\u79cd\u9519\u8bef\u65e5\u5fd7\u4e0a\u62a5\u5230\u65e5\u5fd7\u5e73\u53f0\u8fdb\u884c\u6c47\u603b\u76d1\u63a7\u3001\u62a5\u8b66\u7b49\r\n * Class Collect\r\n * @package Mlservice\\Script\\Monitor\r\n * @author  xianliezhao\r\n *\/\r\nclass Collect extends \\Framework\\FrameworkScript {\r\n    private $limit = 5;\r\n    private $interval = 600;\r\n\r\n    public function run() {\r\n        \/\/ \u68c0\u67e5\u811a\u672c\u53ef\u6267\u884c\r\n        $this-&gt;checkCluster();\r\n\r\n        $start = time();\r\n        while (true) {\r\n            $index = 0;\r\n            $params = array ();\r\n\r\n            while (true) {\r\n                $index++;\r\n                $item = MonitorManager::queueInstance()-&gt;deQueue();\r\n                if (!empty($item)) {\r\n                    $params[] = $item;\r\n                } else {\r\n                    \/\/ \u5982\u679c\u6570\u636e\u4e3a\u7a7a\uff0c\u521910\u5206\u949f\u6e05\u7406\u4e00\u6b21\u961f\u5217\uff0c\u505a\u4e00\u6b21\u521d\u59cb\u5316\uff0c\u4e14\u81ea\u6740\u8fdb\u7a0b\r\n                    if (time() - $start &gt; $this-&gt;interval) {\r\n                        MonitorManager::queueInstance()-&gt;makeEmpty();\r\n                        exit(0);\r\n                    }\r\n                    break;\r\n                }\r\n                if ($index &gt;= $this-&gt;limit) {\r\n                    break;\r\n                }\r\n            }\r\n\r\n            \/\/ \u53d1\u9001\u5230\u670d\u52a1\u5668\uff0c\u7edf\u4e00\u6536\u96c6\r\n            if (!empty($params)) {\r\n                Utilities::apiRequest('bizfe', 'feapi\/monitor\/mon\/collect', $params);\r\n            } else {\r\n                sleep(1);\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>\u961f\u5217\u6d88\u8017\u673a\u5236\u505a\u7684\u5f88\u7b80\u5355\uff0c\u4e0d\u9700\u8981\u91c7\u96c6\u5230\u6240\u6709\u7684\u9519\u8bef\uff0c\u53ea\u8981\u4fdd\u8bc1\u7ebf\u4e0a\u6709\u9519\u8bef\u4e86\uff0c\u6211\u4eec\u80fd\u7b2c\u4e00\u65f6\u95f4\u5f97\u77e5\uff0c\u5373\u53ef\u3002 \u65e5\u5fd7\u6bcf\u6700\u591a\u6536\u96c6\u6ee15\u6761\u5c31\u4e0a\u62a5\u4e00\u6b21\uff0c\u901a\u8fc7HTTP\u8bf7\u6c42\u65b9\u5f0f\uff0c\u4e0a\u62a5\u5230<code>bizfe::\/feapi\/monitor\/mon\/collect<\/code>\u00a0\u3002<\/p>\n<h2>\u4e94\u3001\u5b9e\u73b0\u65b9\u6848\u3010\u5982\u4f55\uff1a\u5904\u7406\u3011<\/h2>\n<h3>1\u3001\u6570\u636e\u91c7\u7528MongoDB\u5b58\u50a8<\/h3>\n<p>\u5bf9\u4e8e\u8fd9\u79cd\u5185\u5bb9\u548c\u7ed3\u6784\u7075\u6d3b\u591a\u53d8\u7684\u6570\u636e\uff0c\u91c7\u7528MongoDB\u5b58\u50a8\u518d\u5408\u9002\u4e0d\u8fc7\u4e86\uff0c\u53ea\u9700\u8981\u5b9a\u4e49\u4e00\u4e2a\u7b80\u5355\u7684\u4e00\u7ea7\u8868\u7ed3\u6784\u5373\u53ef\uff1a<\/p>\n<pre class=\"lang:default decode:true \">\/**\r\n * \u9519\u8bef\u65e5\u5fd7\u91c7\u96c6\u7684\u8868\u7ed3\u6784\r\n * @type {*|Model}\r\n *\/\r\nvar monModel = connection.model('monitor', new Schema({\r\n    type: String,\r\n    cluster: String,\r\n    product: String,\r\n    data: Object,\r\n    extinfo: Object,\r\n    reqtime: Number\r\n}, {\r\n    autoIndex: true\r\n}));<\/pre>\n<h3>2\u3001\u6570\u636e\u4fdd\u5b58\u7b56\u7565<\/h3>\n<pre class=\"lang:default decode:true \">\/**\r\n * \u5bf9\u6570\u636e\u8fdb\u884c\u52a0\u5de5\uff0c\u7136\u540e\u4fdd\u5b58\u65e5\u5fd7\u5230db\uff0c\u6279\u91cf\u4fdd\u5b58\u6210\u529f\u4ee5\u540e\u518d\u8fdb\u884c\u62a5\u8b66\u68c0\u6d4b\r\n * @param messageModel\r\n *\/\r\nfunction save(messageModel) {\r\n    return function (reqParams, callback) {\r\n        var params = [];\r\n        for (var i in reqParams) {\r\n            var item = JSON.parse(reqParams[i]);\r\n            \/\/ \u5ffd\u7565\u6765\u81ea\u6807\u51c6\u73af\u5883\u7684\u4efb\u4f55\u9519\u8bef\r\n            if (item.extinfo.domain.indexOf('rdlab') &gt; 0) {\r\n                continue;\r\n            }\r\n            \/\/ \u4ece\u57df\u540d\u4e2d\u8bb0\u5f55\u4e0b\u51fa\u95ee\u9898\u7684\u6a21\u5757\u540d\u79f0\r\n            item.product = item.extinfo.domain.split('\\.')[0];\r\n            item = cleanParams(messageModel, item);\r\n            params.push(item);\r\n        }\r\n\r\n        var count = params.length;\r\n        if (count == 0) {\r\n            callback();\r\n        }\r\n        var saveData = [];\r\n        var done = 0;\r\n        \/\/ \u6279\u91cf\u4fdd\u5b58\r\n        params.forEach(function (item) {\r\n            new messageModel(item).save(function (err, product, effectRows) {\r\n                !err &amp;&amp; (item._id = product._id);\r\n                saveData.push(item);\r\n                if (++done == count) {\r\n                    \/\/ \u5f53\u6240\u6709\u7684\u9519\u8bef\u65e5\u5fd7\u90fd\u8fdb\u5165db\u6210\u529f\u4ee5\u540e\uff0c\u5f00\u59cb\u8fdb\u884c\u62a5\u8b66\u68c0\u6d4b\uff08\u5185\u5b58\u4e2d\u4f1a\u7ef4\u62a4\u4e00\u4e2a\u9519\u8bef\u6c60\uff09\r\n                    alarm.addAndCheckPool(saveData);\r\n                    if (err) {\r\n                        callback(err, null);\r\n                    } else {\r\n                        callback(null, {error_code: 0, data: {}});\r\n                    }\r\n                }\r\n            });\r\n        });\r\n    };\r\n}<\/pre>\n<h3>3\u3001\u62a5\u8b66\u68c0\u6d4b\u673a\u5236<\/h3>\n<p>\u901a\u8fc7<code>alarm.addAndCheckPool<\/code>\u4f1a\u5728\u5185\u5b58\u4e2d\u7ef4\u62a4\u4e00\u4e2a\u65e5\u5fd7\u9519\u8bef\u6c60\uff0c\u53ea\u9700\u8981\u5f00\u542f\u4e00\u4e2a\u5b50\u8fdb\u7a0b\u6bcf\u79d2\u68c0\u6d4b\u9519\u8bef\u6c60\u4e2d\u7684\u6570\u636e\uff0c\u8fdb\u884c\u9608\u503c\u68c0\u6d4b\u5373\u53ef\u3002<\/p>\n<pre class=\"lang:default decode:true \">\/**\r\n * \u6bcf\u79d2\u68c0\u6d4b\u4e00\u6b21\uff0c\u5404\u4e2a\u9519\u8bef\u7c7b\u578b\u53ea\u8981\u8fbe\u5230\u90ae\u4ef6\u6216\u8005\u77ed\u4fe1\u7684\u6700\u5927\u9608\u503c\uff0c\u5219\u8fdb\u884c\u62a5\u8b66\r\n *\/\r\nvar doAlarm = function () {\r\n    var INTERVAL_TIME = 1000;\r\n\r\n    \/\/ \u542f\u7528\u76d1\u63a7\r\n    if (!alarmListenIng) {\r\n        alarmListenIng = true;\r\n    } else {\r\n        return false;\r\n    }\r\n\r\n    setInterval(function () {\r\n        \/\/ \u904d\u5386\u6240\u6709\u7c7b\u578b\uff0c\u5224\u65ad\u662f\u5426\u8fdb\u884c\u62a5\u8b66\r\n        Object.keys(cachePool).forEach(function (type) {\r\n\r\n            \/\/ \u5f53\u524d\u65f6\u95f4\r\n            var nowTime = (new Date()).getTime();\r\n            \/\/ \u63a7\u5236\u6bcf\u5206\u949f\u6700\u591a\u53ea\u80fd\u62a5\u8b66N\u6b21\r\n            var alarmCount = cachePool[type]['alarmCount'];\r\n            if (alarmCount === undefined) {\r\n                initCacheByType(type, 1);\r\n            } else {\r\n                var lastMtime = cachePool[type]['lastMtime'];\r\n                if ((nowTime - lastMtime) \/ 1000 &gt; 60) {\r\n                    \/\/ \u8d85\u8fc71\u5206\u949f\uff0c\u76f4\u63a5\u8fdb\u884c\u6570\u636e\u91cd\u65b0\u521d\u59cb\u5316\r\n                    initCacheByType(type, 1);\r\n                } else if (alarmCount &gt;= cachePool[type]['alarmCpm']) {\r\n                    \/\/ \u5982\u679c\u6bcf\u5206\u949f\u7684\u62a5\u8b66\u6b21\u6570\u8d85\u8fc7\u9608\u503c\uff0c\u5c31\u4e0d\u62a5\u8b66\u4e86\r\n                    return false;\r\n                }\r\n            }\r\n\r\n            \/\/ \u63a7\u5236\u6bcfN\u79d2\u5185\u62a5\u8b66\u4e00\u6b21\r\n            var lastAlarmTime = cachePool[type]['lastAlarmTime'];\r\n            if (lastAlarmTime === undefined) {\r\n                cachePool[type]['lastAlarmTime'] = nowTime;\r\n            } else if (Math.ceil((nowTime - lastAlarmTime) \/ 1000) &gt;= cachePool[type]['timeInterval']) {\r\n                cachePool[type]['lastAlarmTime'] = nowTime;\r\n\r\n                \/\/ \u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u624d\u8868\u660e\u9700\u8981\u62a5\u8b66\r\n                if (cachePool[type]['alarms'] &amp;&amp; cachePool[type]['alarms']['total'] &gt;= cachePool[type]['maxNumForMail']) {\r\n                    cachePool[type]['type'] = type;\r\n                    cachePool[type]['alarmCount'] += 1;\r\n\r\n                    var theAlarmData = cachePool[type];\r\n                    theAlarmData.theTime = Math.ceil((nowTime - lastAlarmTime) \/ 1000) || 1;\r\n\r\n                    \/\/ \u90ae\u4ef6\u62a5\u8b66\r\n                    sendEmail(buildEmailAlarmContent(theAlarmData));\r\n\r\n                    \/\/ \u5982\u679c\u662f\u51fa\u9519\u91cf\u6bd4\u8bbe\u5b9a\u7684\u77ed\u4fe1\u9608\u503c\u8fd8\u5927\uff0c\u5219\u77ed\u4fe1\u62a5\u8b66\r\n                    if (cachePool[type]['maxNumForSms'] &lt;= cachePool[type]['alarms']['total']) {\r\n                        sendSmsMessage(buildSmsAlarmContent(theAlarmData));\r\n                    }\r\n\r\n                    \/\/ \u6e05\u7a7a\r\n                    initCacheByType(type, 0);\r\n                }\r\n            }\r\n        });\r\n    }, INTERVAL_TIME);\r\n};<\/pre>\n<p>\u5f53\u7136\uff0c\u5404\u79cd\u9519\u8bef\u7684\u4e0d\u540c\u9608\u503c\u4e3a\u4e86\u65e5\u540e\u7684\u7ef4\u62a4\uff0c\u4e5f\u62bd\u79bb\u6210\u914d\u7f6e\u5355\u72ec\u7ba1\u7406\uff0c\u66f4\u4e3a\u5408\u9002\uff1a<\/p>\n<pre class=\"lang:default decode:true \">    \/**\r\n     * \u62a5\u8b66\u9608\u503c\u8bbe\u5b9a\r\n     *\/\r\n    alarmLimits: {\r\n        db_log: {\r\n            timeInterval: 3, \/\/ \u6bcf\u96943s\u76d1\u63a7\u4e00\u6b21\r\n            maxNumForMail: 10, \/\/ \u90ae\u4ef6\u62a5\u8b66\u9608\u503c\r\n            maxNumForSms: 50, \/\/ \u77ed\u4fe1\u62a5\u8b66\u9608\u503c\r\n            alarmCpm: 5 \/\/ \u8868\u793a\u6bcf\u5206\u949f\u6700\u591a\u62a5\u8b665\u6b21\r\n        },\r\n        redis_log: {\r\n            timeInterval: 3,\r\n            maxNumForMail: 10,\r\n            maxNumForSms: 50,\r\n            alarmCpm: 5\r\n        },\r\n        mc_log: {\r\n            timeInterval: 3,\r\n            maxNumForMail: 5,\r\n            maxNumForSms: 20,\r\n            alarmCpm: 5\r\n        },\r\n        mq_error: {\r\n            timeInterval: 3,\r\n            maxNumForMail: 10,\r\n            maxNumForSms: 30,\r\n            alarmCpm: 5\r\n        },\r\n        php_error: {\r\n            timeInterval: 3,\r\n            maxNumForMail: 5,\r\n            maxNumForSms: 20,\r\n            alarmCpm: 5\r\n        },\r\n        php_warning: {\r\n            timeInterval: 3,\r\n            maxNumForMail: 10,\r\n            maxNumForSms: 50,\r\n            alarmCpm: 5\r\n        }\r\n    }<\/pre>\n<h2>\u516d\u3001\u63a5\u6536\u62a5\u8b66<\/h2>\n<p>\u6309\u7167\u8fd9\u5957\u6d41\u7a0b\u4e0b\u6765\uff0c\u7ebf\u4e0a\u53ea\u8981\u51fa\u4efb\u4f55\u9519\u8bef\uff0c\u90fd\u4f1a\u88ab\u5b9e\u65f6\u4e0a\u62a5\u5230\u65e5\u5fd7\u670d\u52a1\u5668\uff0c\u4ee5<code>php_error<\/code>\u4e3a\u4f8b\uff0c\u6bcf\u96943\u79d2\u68c0\u6d4b\u4e00\u6b21\uff0c\u5982\u679c\u7d2f\u79ef\u51fa\u73b05\u6b21\u9519\u8bef\uff0c\u5219\u91c7\u53d6\u90ae\u4ef6\u65b9\u5f0f\u8fdb\u884c\u62a5\u8b66\uff0c\u5982\u679c\u7d2f\u79ef\u51fa\u73b020\u6b21\u9519\u8bef\uff0c\u5219\u53ef\u7406\u89e3\u4e3a\u9519\u8bef\u8f83\u4e25\u91cd\uff0c\u8fdb\u884c\u77ed\u4fe1\u62a5\u8b66\uff01<\/p>\n<p>\u5bf9\u4e8e\u4e0d\u540c\u7c7b\u578b\u7684\u9519\u8bef\u62a5\u8b66\uff0c\u4f1a\u53d1\u9001\u7ed9\u4e0d\u540c\u7684\u63a5\u6536\u4eba\uff0c\u6284\u9001\u7ed9\u5927\u7ec4\uff0c\u4fdd\u8bc1\u8be5\u6b21\u62a5\u8b66\u4e00\u5b9a\u4e0d\u4f1a\u88ab\u5ffd\u7565\u3002\u540c\u65f6\u63d0\u4f9b\u4e00\u4e2aWeb\u5e73\u53f0\uff0c\u5bf9\u65e5\u5fd7\u8fdb\u884c\u5206\u6790\u5c55\u73b0\uff0c\u53ef\u67e5\u8be2\u67d0\u4e2a\u9519\u8bef\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5feb\u901f\u5206\u6790\u51fa\u95ee\u9898\u51fa\u73b0\u5728\u4ec0\u4e48\u5730\u65b9\uff1b\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u901a\u8fc7\u8be5\u5e73\u53f0\u7684\u65e5\u5fd7\u8be6\u60c5\u9875\uff0c\u53ef\u4ee5\u4e00\u773c\u5c31\u5224\u65ad\u51fa\u6765\u8be5\u9519\u8bef\u5e94\u8be5\u91c7\u53d6\u4ec0\u4e48\u65b9\u5f0f\u53bb\u4fee\u590d\u3002<\/p>\n<h2>\u4e03\u3001\u63a5\u53e3\u53ef\u7528\u6027\u4e0e\u54cd\u5e94\u65f6\u95f4\u76d1\u63a7<\/h2>\n<h3>1\u3001\u6570\u636e\u6765\u6e90\u5206\u6790<\/h3>\n<p>\u8fd9\u90e8\u5206\u7684\u6570\u636e\uff0c\u53ef\u4ee5\u76f4\u63a5\u4ece<code>Nginx\u65e5\u5fd7<\/code>\u4e2d\u8fdb\u884c\u63d0\u53d6\uff0c\u9996\u5148\uff0c\u6211\u4eec\u53ef\u4ee5\u6765\u770b\u770b\u4e00\u6761\u5b8c\u6574\u7684Nginx\u65e5\u5fd7\u5305\u542b\u7684\u5185\u5bb9\uff1a<\/p>\n<pre class=\"lang:default decode:true \">[x.x.x.x] [-] [23\/Oct\/2015:14:59:59 +0800] [GET \/goods\/goods_info?goods_id=276096349&amp;fields=platform_type%2Cgoods_id%2Cgoods_param%2Cgoods_detail%2Cshop_id%2Cfirst_sort_id%2Csize%2Cgoods_desc HTTP\/1.1] [200] [1957] [xxx.com\/share\/goods_details] [Snake Connect] [-] [0.010] [y.y.y.y:9999] [0.010] [-] [uid:0;ip:0.0.0.0;v:0;master:0;is_mob:0]<\/pre>\n<p>\u57fa\u672c\u5c31\u662f\u8fd9\u4e2a\u683c\u5f0f\uff1a<\/p>\n<pre class=\"lang:default decode:true \">[$remote_addr] [$remote_user] [$time_local] [$request] [$status] [$body_bytes_sent] [$http_referer] [$http_user_agent] [$http_user_agent] [$http_x_forwarded_for] [$request_time] [$upstream_addr] [$upstream_response_time] [$request_body]<\/pre>\n<p>\u5f53\u7136\uff0cNginx\u65e5\u5fd7\u6536\u96c6\u7684\u683c\u5f0f\uff0c\u662f\u53ef\u4ee5\u5728Nginx\u914d\u7f6e\u6587\u4ef6\u4e2d\u8fdb\u884c\u81ea\u5b9a\u4e49\u7684\uff0c\u5177\u4f53\u770b\u4e1a\u52a1\u5c42\u9700\u8981\u600e\u4e48\u5206\u6790\u3002<\/p>\n<p>\u57fa\u4e8e\u4e0a\u9762\u5df2\u7ecf\u4ea7\u751f\u7684\u8fd9\u4e2a\u65e5\u5fd7\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u8fd9\u51e0\u4e2a\u6570\u636e\u6765\u505a\u63a5\u53e3\u6027\u80fd\u76d1\u63a7\uff1a<\/p>\n<ul>\n<li><code>$request<\/code>\u00a0\u5177\u4f53\u7684\u63a5\u53e3\u540d\u79f0<\/li>\n<li><code>$status<\/code>\u00a0\u8be5\u8bf7\u6c42\u5bf9\u5e94\u7684\u6267\u884c\u72b6\u6001\uff08200\uff1a\u6210\u529f\uff1b499\uff1a\u8d85\u65f6\uff1b502\uff1a\u670d\u52a1\u6302\u4e86\uff1b500\uff1a\u53ef\u80fd\u662f\u6709Fatal&#8230;\uff09\uff0c\u901a\u8fc7\u8fd9\u4e2a\u4fe1\u606f\u6765\u8861\u91cf\u63a5\u53e3\u7684<code>\u53ef\u7528\u6027<\/code><\/li>\n<li><code>$request_time<\/code>\u00a0\u4e00\u4e2a\u63a5\u53e3\u7684\u5b8c\u6574\u6267\u884c\u65f6\u95f4\uff0c\u901a\u8fc7\u8fd9\u4e2a\u503c\u6765\u8861\u91cf\u63a5\u53e3\u7684<code>\u54cd\u5e94\u65f6\u95f4<\/code><\/li>\n<\/ul>\n<h3>2\u3001\u76d1\u63a7\u5bf9\u8c61\u4ee5\u53ca\u6570\u636e\u91c7\u96c6<\/h3>\n<p>\u5bf9\u4e8e\u9700\u8981\u76d1\u63a7\u7684\u5bf9\u8c61\uff0c\u53ef\u4ee5\u901a\u8fc7\u767d\u540d\u5355\u7684\u65b9\u5f0f\uff0c\u6307\u5b9a\u5bf9\u67d0\u4e9b\u63a5\u53e3\u8fdb\u884c\u76d1\u63a7\uff0c\u4f46\u662f\u8fd9\u6837\u4e0d\u591f\u7075\u6d3b\uff0c\u5c24\u5176\u662f\u4e00\u4e2a\u670d\u52a1\u4e0b\u7684\u63a5\u53e3\u5728\u4e0d\u65ad\u589e\u52a0\uff0c\u7ecf\u5e38\u66f4\u65b0\u76d1\u63a7\u7684\u63a5\u53e3\u5217\u8868\uff0c\u7ef4\u62a4\u6210\u672c\u8f83\u9ad8\u3002<\/p>\n<p>\u8fd8\u6709\u6bd4\u8f83\u667a\u80fd\u7684\u65b9\u6cd5\uff0c\u5c31\u662f\u6839\u636e\u67d0\u4e2a\u63a5\u53e3\u7684\u8bbf\u95ee\u91cf\uff0c\u53d6\u524dN\u4e2a\u8fdb\u884c\u76d1\u63a7\uff0c\u6bd4\u5982\u53ef\u4ee5\u901a\u8fc7\u8fd9\u6837\u7684\u65b9\u5f0f\u6765\u83b7\u53d6\u76d1\u63a7\u63a5\u53e3\u5217\u8868\uff1a<\/p>\n<pre class=\"lang:default decode:true \"># \u65e5\u671f\r\ndate_time=$(date -d \"-1 hours\" \"+%Y%m%d%H\")\r\n# \u6587\u4ef6\u4f4d\u7f6e\r\nfile_name=\"\/home\/service\/nginx\/log\/xxx.mlservice.access.${date_time}.log\"\r\n# \u83b7\u53d6\u76d1\u63a7\u5217\u8868\r\napi_list=$(awk '{print $6}' ${file_name} | grep -v 'your_filter_api_here' | sed -e \"s\/\\?.*\/\/\" -e \"s\/^\\\/\/\/\" | tr '[A-Z]' '[a-z]' | sort | uniq -c | sort -nr | head -n 20 | awk '{print $2}') ;<\/pre>\n<p>\u8fd9\u91cc\u7684<code>api_list<\/code>\u5c31\u662f\u662f\u52a8\u6001\u83b7\u53d6\u5230\u7684\u76d1\u63a7\u5bf9\u8c61\u4e86\uff0c\u7ed3\u679c\u5f62\u5982\uff1a<\/p>\n<pre class=\"lang:default decode:true \">goods\/goods_info\r\ngoods\/campaign_info\r\ninventory\/get_skuinfo\r\ninventory\/set_inventory\r\ncampaign\/update_campaign\r\ncampaign\/goods_info\r\ninventory\/spu_set\r\ninventory\/inventory_decr\r\n...<\/pre>\n<p>\u5bf9\u4e8e\u6570\u636e\u7684\u91c7\u96c6\uff0c\u5c31\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7\u4e0a\u9762\u7684\u76d1\u63a7\u5bf9\u8c61\uff0c\u5229\u7528<code>grep<\/code>\u63d0\u53d6\u6240\u6709\u76f8\u5173\u7684\u6570\u636e\uff0c\u7136\u540e\u901a\u8fc7<code>awk<\/code>\u9010\u6761\u8fdb\u884c\u5206\u6790\uff0c\u6700\u7ec8\u5f97\u51fa\u5e73\u5747\u503c\uff0c\u8f93\u51fa\u7ed3\u679c\u3002\u800c\u5bf9\u6570\u636e\u7ed3\u679c\u7684\u4e0a\u62a5\uff0c\u76f4\u63a5\u901a\u8fc7<code>curl<\/code>\u65b9\u5f0f\u53d1\u9001\u5230bizfe\u5e73\u53f0\u8fdb\u884c\u7edf\u4e00\u5b58\u50a8\u4ee5\u53ca\u96c6\u4e2d\u5c55\u73b0\u3002<\/p>\n<h3>3\u3001\u51e0\u5f20\u6548\u679c\u56fe\u7247<\/h3>\n<h4>1\uff09\u3001\u62a5\u8b66\u90ae\u4ef6<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-955\" src=\"http:\/\/www.siediyer.cn\/wp-content\/uploads\/2017\/03\/2015-10-26_17-18-10_7.png\" width=\"900\" height=\"570\" alt=\"mail.png\" srcset=\"https:\/\/qiniu.shijitianchen.com\/2017\/03\/2015-10-26_17-18-10_7.png 900w, https:\/\/qiniu.shijitianchen.com\/2017\/03\/2015-10-26_17-18-10_7-300x190.png 300w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<h4>2\uff09\u3001\u5e73\u53f0\u4e2d\u5c55\u73b0\u6240\u6709\u76d1\u63a7\u65e5\u5fd7<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-956\" src=\"http:\/\/www.siediyer.cn\/wp-content\/uploads\/2017\/03\/2015-10-26_17-17-22_2.png\" width=\"900\" height=\"270\" alt=\"list.png\" srcset=\"https:\/\/qiniu.shijitianchen.com\/2017\/03\/2015-10-26_17-17-22_2.png 900w, https:\/\/qiniu.shijitianchen.com\/2017\/03\/2015-10-26_17-17-22_2-300x90.png 300w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<h4>3\uff09\u3001\u9519\u8bef\u8be6\u60c5<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-957\" src=\"http:\/\/www.siediyer.cn\/wp-content\/uploads\/2017\/03\/2015-10-26_17-18-54_9.png\" width=\"900\" height=\"533\" alt=\"detail.png\" srcset=\"https:\/\/qiniu.shijitianchen.com\/2017\/03\/2015-10-26_17-18-54_9.png 900w, https:\/\/qiniu.shijitianchen.com\/2017\/03\/2015-10-26_17-18-54_9-300x178.png 300w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<h4>4\uff09\u3001\u5e73\u53f0\u4e2d\u5c55\u73b0\u63a5\u53e3\u6027\u80fd<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-958\" src=\"http:\/\/www.siediyer.cn\/wp-content\/uploads\/2017\/03\/2015-10-26_17-19-26_9.png\" width=\"900\" height=\"547\" alt=\"sla.png\" srcset=\"https:\/\/qiniu.shijitianchen.com\/2017\/03\/2015-10-26_17-19-26_9.png 900w, https:\/\/qiniu.shijitianchen.com\/2017\/03\/2015-10-26_17-19-26_9-300x182.png 300w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<h2>\u516b\u3001\u7ed3\u8bed<\/h2>\n<p>\u7ebf\u4e0a\u670d\u52a1\u51fa\u73b0\u4efb\u4f55\u95ee\u9898\uff0c\u4f5c\u4e3a\u4e00\u7ebf\u7814\u53d1\uff0c\u90fd\u5e94\u8be5\u7b2c\u4e00\u65f6\u95f4\u77e5\u9053\u51fa\u4e86\u4ec0\u4e48\u95ee\u9898\u3001\u95ee\u9898\u51fa\u5728\u54ea\u513f\u3001\u5927\u81f4\u7684\u5f71\u54cd\u8303\u56f4\u662f\u4ec0\u4e48\u3001\u5927\u81f4\u5982\u4f55\u4fee\u590d\u7b49\u3002\u7edd\u5bf9\u4e0d\u662f\u7b49\u7740\u7528\u6237\u6765\u53cd\u9988\u4e86\uff0c\u6211\u4eec\u624d\u88ab\u52a8\u7684\u53bb\u627e<code>\u7528\u6237\u62a5\u7684\u95ee\u9898\uff0c\u5982\u4f55\u590d\u73b0\uff1f<\/code>\uff01<\/p>\n<p>\u5f53\u7136\uff0c\u6211\u4eec\u4e5f\u4e0d\u80fd\u6210\u4e3a<code>\u76d1\u63a7\u62a5\u8b66\u7684\u91cd\u5ea6\u60a3\u8005<\/code>\uff0c\u51e1\u4e8b\u4e5f\u5f97\u6709\u4e2a\u5ea6\uff0c\u5982\u679c\u7ebf\u4e0a\u4e0d\u7ba1\u662f\u4ec0\u4e48\u6837\u7684log\u90fd\u901a\u8fc7\u62a5\u8b66\u7684\u65b9\u5f0f\u53d1\u51fa\u6765\uff0c\u5c31\u771f\u6210\u4e86<code>\u6270\u6c11<\/code>\u4e86\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u80cc\u666f 1\u3001\u4e0a\u7ebf\u671f\u95f4\u670d\u52a1\u7a33\u5b9a\u6027\u89c2\u5bdf\u8f83\u56f0\u96be \u4e00\u4e2a\u529f\u80fd\u4e0a\u7ebf\u540e\uff0c\u5176\u5b9e\u7814\u53d1\u5fc3\u91cc\u6839\u672c\u6ca1\u5e95\u513f\uff0c\u4e0d\u77e5\u9053\u8fd9\u4e2a\u529f\u80fd\u4e0a\u7ebf\u4ee5\u540e\u662f\u4e0d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":955,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-954","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts\/954","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=954"}],"version-history":[{"count":1,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts\/954\/revisions"}],"predecessor-version":[{"id":959,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts\/954\/revisions\/959"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/media\/955"}],"wp:attachment":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}