{"id":138813,"date":"2019-04-03T08:49:03","date_gmt":"2019-04-03T00:49:03","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=138813"},"modified":"2019-03-28T09:48:35","modified_gmt":"2019-03-28T01:48:35","slug":"go-code-bug","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/go-code-bug.html","title":{"rendered":"\u719f\u8bfb\u8fd95\u4e2a\u5f00\u6e90\u9879\u76ee\u5c31\u662f\u5408\u683c\u7684GO\u8bed\u8a00\u5de5\u7a0b\u5e08\uff01"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5199\u4ee3\u7801\u540c\u5199\u6587\u7ae0\u4e00\u6837\uff0c\u65e2\u662f\u6280\u672f\u6d3b\uff0c\u53c8\u662f\u827a\u672f\u6d3b\u3002\u4e0d\u662f\u61c2\u4e86\u8bed\u6cd5\u80fd\u591f\u5199\u51fa\u4f18\u79c0\u7684\u4ee3\u7801\uff0c\u4e5f\u6b63\u5982\u4e0d\u662f\u8ba4\u8bc6\u5b57\u5c31\u80fd\u591f\u5199\u51fa\u4f18\u7f8e\u7684\u6587\u7ae0\u4e00\u6837\u3002\u90a3\u4e2a\u4f5c\u5bb6\u9971\u8bfb\u53f2\u4e66\uff0c\u90a3\u4e2a\u67b6\u6784\u5e08\u4e0d\u662f\u5728\u4ee3\u7801\u5806\u91cc\u548cBug\u5806\u91cc\u6ce1\u51fa\u6765\u7684\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u56e0\u6b64\uff0c\u7a0b\u5e8f\u5458\u521a\u5165\u95e8\u9664\u4e86\u8bfb\u4e66\u5916\uff0c\u9605\u8bfb\u597d\u7684\u4ee3\u7801\u5f88\u91cd\u8981\u3002\u9605\u8bfb\u4f18\u79c0\u7684\u4ee3\u7801\u53ef\u4ee5\u4e86\u89e3\u5927\u725b\u5f00\u53d1\u7684\u601d\u8def\uff0c\u8f6f\u4ef6\u67b6\u6784\u548c\u8bed\u8a00\u6280\u5de7\u7b49\u3002\u56e0\u6b64\uff0c\u672c\u6587\u9488\u5bf9Go\u8bed\u8a00\uff0c\u63a8\u8350\u5927\u5bb65\u4e2a\u975e\u5e38\u4f18\u79c0\u7684\u5f00\u6e90\u9879\u76ee\uff0c\u8fd9\u4e9b\u5f00\u6e90\u9879\u76ee\u4e0d\u4ec5\u5e94\u7528\u5e7f\u6cdb\uff0c\u800c\u4e14\u5176\u4e2d\u6240\u7528\u7684\u6280\u672f\u6709\u5f88\u591a\u57fa\u7840\u6280\u672f\uff0c\u662f\u505a\u5176\u5b83\u4efb\u4f55\u9879\u76ee\u90fd\u4e0d\u53ef\u6216\u7f3a\u7684\u3002<\/p>\n

\"\"<\/p>\n

Codis<\/strong><\/div>\n

Codis\u662f\u4e00\u4e2a\u5206\u5e03\u5f0fRedis\u89e3\u51b3\u65b9\u6848\uff0c\u4e0e\u5b98\u65b9\u7684\u7eafP2P\u6a21\u5f0f\u4e0d\u540c\uff0cCodis\u91c7\u7528\u7684\u662fProxy-based\u7684\u65b9\u6848\u3002\u53ef\u4ee5\u5c06Codis\u7406\u89e3\u6210\u4e3aWeb\u670d\u52a1\u9886\u57df\u7684Nginx\uff0c\u5b83\u5b9e\u73b0\u4e86\u5bf9Redis\u7684\u53cd\u5411\u4ee3\u7406\u548c\u8d1f\u8f7d\u5747\u8861\u3002Redis\u672c\u8eab\u5c31\u662f\u5c31\u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u7684\u7f13\u5b58\u7cfb\u7edf\uff0c\u53ef\u89c1Codis\u7684\u6027\u80fd\u66f4\u662f\u6ca1\u6cd5\u8bf4\u3002<\/p>\n

\"\"<\/p>\n

\u63a8\u8350\u9605\u8bfb\u8be5\u5f00\u6e90\u9879\u76ee\u6e90\u4ee3\u7801\u7684\u539f\u56e0\u5728\u4e8e\u5e94\u7528\u5e7f\u6cdb\u3001\u9ad8\u6027\u80fd\u548c\u7f51\u7edc\u534f\u8bae\u3002\u901a\u8fc7\u5b66\u4e60\u5176\u4ee3\u7801\u76f8\u4fe1\u5bf9Go\u8bed\u8a00\u7684\u5982\u4e0b\u65b9\u9762\u80fd\u6709\u5f88\u5927\u7684\u63d0\u5347\uff1a
\n\u7f51\u7edc\u7f16\u7a0b\uff1a Codis\u672c\u8eab\u5c31\u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u7f51\u7edc\u8f6f\u4ef6\uff0c\u56e0\u6b64\u9605\u8bfb\u5176\u4ee3\u7801\u5bf9\u4e8eGo\u8bed\u8a00\u4e0b\u7684\u7f51\u7edc\u7f16\u7a0b\u4f1a\u6709\u5f88\u5927\u7684\u5e2e\u52a9
\n\u534f\u7a0b\uff1a \u4f5c\u4e3a\u7f51\u7edc\u8f6f\u4ef6\uff0c\u5728Go\u8bed\u8a00\u534f\u7a0b\u4f7f\u7528\u4e0a\u53d1\u6325\u7684\u6dcb\u6f13\u5c3d\u81f4\uff0c\u5145\u5206\u4f7f\u7528\u4e86\u5176\u534f\u7a0b\u7684\u7279\u6027
\n\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5\uff1a Codis\u4e3a\u4e86\u914d\u5408Redis\u7684\u591a\u79cd\u6570\u636e\u7c7b\u578b\u652f\u6301\uff0c\u5728\u5185\u90e8\u5b9e\u73b0\u4e0a\u5145\u5206\u4f7f\u7528\u4e86\u73b0\u6709\u7684\u6570\u636e\u7ed3\u6784<\/p>\n

Etcd<\/strong><\/div>\n

Etcd\u662fCoreOS\u56e2\u961f\u4e8e2013\u5e746\u6708\u53d1\u8d77\u7684\u5f00\u6e90\u9879\u76ee\uff0c\u5b83\u7684\u76ee\u6807\u662f\u6784\u5efa\u4e00\u4e2a\u9ad8\u53ef\u7528\u7684\u5206\u5e03\u5f0f\u952e\u503c(key-value)\u6570\u636e\u5e93\u3002Etcd\u5185\u90e8\u91c7\u7528raft\u534f\u8bae\u4f5c\u4e3a\u4e00\u81f4\u6027\u7b97\u6cd5\uff0cetcd\u57fa\u4e8eGo\u8bed\u8a00\u5b9e\u73b0\u3002\u9605\u8bfb\u5176\u4ee3\u7801\u5bf9\u7406\u89e3Go\u8bed\u8a00\u4e2d\u7684\u7f51\u7edc\u7f16\u7a0b\u3001\u5206\u5e03\u5f0f\u7b97\u6cd5\u548c\u6570\u636e\u7ed3\u6784\u7b49\u65b9\u9762\u7684\u5185\u5bb9\u6709\u975e\u5e38\u5927\u7684\u5e2e\u52a9\u3002\u53ef\u4ee5\u4e86\u89e3\u4e16\u754c\u7ea7\u5927\u725b\u7684\u5f00\u53d1\u601d\u8def\u548c\u7f16\u7801\u98ce\u683c\u3002<\/p>\n

\"\"<\/p>\n

Kubernetes<\/strong><\/div>\n

\u76f8\u4fe1\u505a\u8fc7Web\u5f00\u53d1\u6216\u8005\u73a9\u8fc7\u5bb9\u5668\u7684\u540c\u5b66\u90fd\u63a5\u89e6\u8fc7\uff0c\u6700\u8d77\u7801\u542c\u8fc7\u8fd9\u4e2a\u8f6f\u4ef6\u3002\u8fd9\u4e2a\u8f6f\u4ef6\u662f\u7eafGo\u8bed\u8a00\u5f00\u53d1\u3002\u8fd9\u91cc\u5c31\u4e0d\u8fc7\u591a\u4ecb\u7ecd\u4e86\uff0cGoogle\u8bbe\u8ba1\u5e76\u5f00\u53d1\u7684\u4e1c\u4e1c\uff0c\u76f8\u4fe1\u80fd\u4ece\u4e2d\u5b66\u5230\u5f88\u591a\u5185\u5bb9\u3002\u8fd9\u91cc\u5c31\u4e0d\u8fc7\u591a\u4ecb\u7ecd\u4e86\u3002<\/p>\n

Caddy<\/strong><\/div>\n

Caddy\u670d\u52a1\u5668\uff08\u6216\u8005CaddyWeb\uff09\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\uff0c\u4f7f\u7528Golang \u7f16\u5199\uff0c\u652f\u6301HTTP\/2 \u7684Web \u670d\u52a1\u7aef\u3002 \u5b83\u4f7f\u7528Golang \u6807\u51c6\u5e93\u63d0\u4f9bHTTP \u529f\u80fd\u3002 Caddy \u4e00\u4e2a\u663e\u8457\u7684\u7279\u6027\u662f\u9ed8\u8ba4\u542f\u7528HTTPS\u3002 \u5b83\u662f\u7b2c\u4e00\u4e2a\u65e0\u9700\u989d\u5916\u914d\u7f6e\u5373\u53ef\u63d0\u4f9bHTTPS \u7279\u6027\u7684Web \u670d\u52a1\u5668\u3002\u5b66\u4e60\u8be5\u8f6f\u4ef6\u7684\u4ee3\u7801\u5bf9\u9ad8\u6027\u80fd\u67b6\u6784\u3001\u7f51\u7edc\u7f16\u7a0b\u548cHTTP\u534f\u8bae\u4f1a\u6709\u66f4\u52a0\u6df1\u5165\u7684\u7406\u89e3\u3002<\/p>\n

\"\"<\/p>\n

Go-MySQL<\/strong><\/div>\n

\u7a0b\u5e8f\u5f00\u53d1\u65e0\u975e\u4e1a\u52a1\u3001\u6570\u636e\u7ed3\u6784\u7b97\u6cd5\u3001\u7f51\u7edc\u548c\u5b58\u50a8\uff0c\u524d\u9762\u4ecb\u7ecd\u4e86\u5f88\u591a\u6570\u636e\u7ed3\u6784\u548c\u7f51\u7edc\u7684\u5f00\u6e90\u8f6f\u4ef6\uff0c\u672c\u8f6f\u4ef6\u662f\u6700\u540e\u4e00\u90e8\u5206\u3002\u672c\u8f6f\u4ef6\u662fGo\u8bed\u8a00\u5b9e\u73b0\u7684\u5904\u7406MySQL\u7f51\u7edc\u534f\u8bae\u548c\u590d\u5236\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u4f5c\u4e3aMySQL\u7684\u4ece\u7aef\uff0c\u5b9e\u73b0\u6570\u636e\u7684\u8fdb\u4e00\u6b65\u7684\u5904\u7406\u3002\u5b66\u4e60\u672c\u8f6f\u4ef6\u7684\u4ee3\u7801\u5bf9MySQL\u4f1a\u6709\u66f4\u52a0\u6df1\u5165\u7684\u7406\u89e3\uff0c\u53e6\u5916\u5bf9\u6570\u636e\u4e2d\u5fc3\u5bb9\u707e\u4e5f\u4f1a\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n

\"\"<\/p>\n","protected":false},"excerpt":{"rendered":"

\u56e0\u6b64\uff0c\u7a0b\u5e8f\u5458\u521a\u5165\u95e8\u9664\u4e86\u8bfb\u4e66\u5916\uff0c\u9605\u8bfb\u597d\u7684\u4ee3\u7801\u5f88\u91cd\u8981\u3002\u9605\u8bfb\u4f18\u79c0\u7684\u4ee3\u7801\u53ef\u4ee5\u4e86\u89e3\u5927\u725b\u5f00\u53d1\u7684\u601d\u8def\uff0c\u8f6f\u4ef6\u67b6\u6784\u548c\u8bed\u8a00\u6280\u5de7\u7b49\u3002 […]<\/p>\n","protected":false},"author":310,"featured_media":138838,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-138813","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\/138813","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\/310"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=138813"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/138813\/revisions"}],"predecessor-version":[{"id":141335,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/138813\/revisions\/141335"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/138838"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=138813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=138813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=138813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}