{"id":206725,"date":"2025-06-12T14:08:58","date_gmt":"2025-06-12T06:08:58","guid":{"rendered":"https:\/\/server.hk\/cnblog\/206725\/"},"modified":"2025-06-12T14:08:58","modified_gmt":"2025-06-12T06:08:58","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88%e5%9c%a8-node-%e8%8a%82%e7%82%b9%e4%b8%8a%e7%94%a8-netstat-%e7%9c%8b%e4%b8%8d%e5%88%b0-nodeport-%e7%b1%bb%e5%9e%8b-service-%e7%9a%84%e7%ab%af%e5%8f%a3%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/206725\/","title":{"rendered":"\u4e3a\u4ec0\u4e48\u5728 Node \u8282\u70b9\u4e0a\u7528 netstat \u770b\u4e0d\u5230 NodePort \u7c7b\u578b Service \u7684\u7aef\u53e3\uff1f"},"content":{"rendered":"<p>\u672c\u7bc7\u6587\u7ae0\u4e3b\u8981\u662f\u7ed3\u5408\u6211\u4e4b\u524d\u9762\u8bd5\u7684\u5404\u79cd\u7ecf\u5386\u548c\u5b9e\u6218\u5f00\u53d1\u4e2d\u9047\u5230\u7684\u95ee\u9898\u89e3\u51b3\u7ecf\u9a8c\u6574\u7406\u7684\uff0c\u5e0c\u671b\u8fd9\u7bc7\u300a\u4e3a\u4ec0\u4e48\u5728 Node \u8282\u70b9\u4e0a\u7528 netstat \u770b\u4e0d\u5230 NodePort \u7c7b\u578b Service \u7684\u7aef\u53e3\uff1f\u300b\u5bf9\u4f60\u6709\u5f88\u5927\u5e2e\u52a9\uff01\u6b22\u8fce\u6536\u85cf\uff0c\u5206\u4eab\u7ed9\u66f4\u591a\u7684\u9700\u8981\u7684\u670b\u53cb\u5b66\u4e60~,<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241120\/1732103519673dcd5fa3707.jpg\" class=\"aligncenter\">,<br \/>\n<strong>NodePort\u7c7b\u578bService\u5728Node\u8282\u70b9\u4e0aNetstat\u770b\u4e0d\u5230NodePort\u7aef\u53e3\u7684\u539f\u56e0<\/strong>,\u5c3d\u7ba1\u521b\u5efa\u4e86\u7c7b\u578b\u4e3aNodePort\u7684Service\uff0c\u5e76\u5728Kubernetes\u96c6\u7fa4\u4e2d\u6307\u5b9a\u4e86NodePort\u4e3a31002\uff0c\u4f46\u662f\u901a\u8fc7netstat\u547d\u4ee4\u4ecd\u7136\u65e0\u6cd5\u5728Node\u8282\u70b9\u4e0a\u89c2\u5bdf\u5230\u8fd9\u4e2aNodePort\u3002\u8fd9\u662f\u56e0\u4e3a\uff1a,NodePort\u7c7b\u578b\u7684Service\u5b9e\u9645\u4e0a\u4e0d\u4f1a\u5728Node\u8282\u70b9\u4e0a\u76d1\u542c\u6307\u5b9a\u7684NodePort\u3002\u76f8\u53cd\uff0cKubernetes\u901a\u8fc7iptables\u89c4\u5219\u5c06\u8fd9\u4e2a\u7aef\u53e3\u8f6c\u53d1\u5230\u5b9e\u9645\u8fd0\u884c\u8be5\u670d\u52a1\u4e2d\u7684Pod\u7684IP\u5730\u5740\u548c\u7aef\u53e3\u4e0a\u3002\u8fd9\u662f\u4e3a\u4e86\u8ba9\u5916\u90e8\u6d41\u91cf\u80fd\u591f\u901a\u8fc7NodePort\u8bbf\u95eeService\u3002,\u56e0\u6b64\uff0c\u5f53\u901a\u8fc7netstat\u547d\u4ee4\u68c0\u67e5Node\u8282\u70b9\u65f6\uff0c\u4e0d\u4f1a\u627e\u5230NodePort\u5bf9\u5e94\u7684\u76d1\u542c\u8fdb\u7a0b\u3002\u8fd9\u662f\u56e0\u4e3a\u5728\u8fd9\u4e2a\u7aef\u53e3\u4e0a\u6ca1\u6709\u5b9e\u9645\u7684\u8fdb\u7a0b\u5728\u76d1\u542c\uff0c\u6240\u6709\u6d41\u91cf\u90fd\u88ab\u8f6c\u53d1\u5230\u4e86Pod\u4e0a\u3002,\u672c\u7bc7\u5173\u4e8e\u300a\u4e3a\u4ec0\u4e48\u5728 Node \u8282\u70b9\u4e0a\u7528 netstat \u770b\u4e0d\u5230 NodePort \u7c7b\u578b Service \u7684\u7aef\u53e3\uff1f\u300b\u7684\u4ecb\u7ecd\u5c31\u5230\u6b64\u7ed3\u675f\u5566\uff0c\u4f46\u662f\u5b66\u65e0\u6b62\u5883\uff0c\u60f3\u8981\u4e86\u89e3\u5b66\u4e60\u66f4\u591a\u5173\u4e8eGOLANG\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u8bf7\u5173\u6ce8GOLANG\u516c\u4f17\u53f7\uff01,NodePort\u7c7b\u578bService\u5728Node\u8282\u70b9\u4e0aNetstat\u770b\u4e0d\u5230NodePort\u7aef\u53e3\u7684\u539f\u56e0,\u672c\u7bc7\u6587\u7ae0\u4e3b\u8981\u662f\u7ed3\u5408\u6211\u4e4b\u524d\u9762\u8bd5\u7684\u5404\u79cd\u7ecf\u5386\u548c\u5b9e\u6218\u5f00\u53d1\u4e2d\u9047\u5230\u7684\u95ee\u9898\u89e3\u51b3\u7ecf\u9a8c\u6574\u7406\u7684\uff0c\u5e0c\u671b\u8fd9\u7bc7\u300a\u4e3a\u4ec0\u4e48\u5728 Node \u8282\u70b9\u4e0a\u7528 netstat \u770b\u4e0d\u5230 NodePort \u7c7b\u578b Service \u7684\u7aef\u53e3\uff1f\u300b\u5bf9\u4f60\u6709\u5f88\u5927\u5e2e\u52a9\uff01\u6b22\u8fce\u6536\u85cf\uff0c\u5206\u4eab\u7ed9\u66f4\u591a\u7684\u9700\u8981\u7684\u670b\u53cb\u5b66\u4e60~,<br \/>\n<b><\/b> <\/p>\n<p>\u5f53\u524d\u4f4d\u7f6e\uff1a <span>&gt;<\/span>  <span>&gt;<\/span>  <span>&gt;<\/span>  <span>&gt;<\/span> <span>\u4e3a\u4ec0\u4e48\u5728 Node \u8282\u70b9\u4e0a\u7528 netstat \u770b\u4e0d\u5230 NodePort \u7c7b\u578b Service \u7684\u7aef\u53e3\uff1f<\/span><\/p>\n<h1>\u4e3a\u4ec0\u4e48\u5728 Node \u8282\u70b9\u4e0a\u7528 netstat \u770b\u4e0d\u5230 NodePort \u7c7b\u578b Service \u7684\u7aef\u53e3\uff1f<\/h1>\n<p><span>2024-11-20 19:52:15<\/span><br \/>\n<span><i><\/i>0\u6d4f\u89c8<\/span><br \/>\n<span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p>\u672c\u7bc7\u6587\u7ae0\u4e3b\u8981\u662f\u7ed3\u5408\u6211\u4e4b\u524d\u9762\u8bd5\u7684\u5404\u79cd\u7ecf\u5386\u548c\u5b9e\u6218\u5f00\u53d1\u4e2d\u9047\u5230\u7684\u95ee\u9898\u89e3\u51b3\u7ecf\u9a8c\u6574\u7406\u7684\uff0c\u5e0c\u671b\u8fd9\u7bc7\u300a\u4e3a\u4ec0\u4e48\u5728 Node \u8282\u70b9\u4e0a\u7528 netstat \u770b\u4e0d\u5230 NodePort \u7c7b\u578b Service \u7684\u7aef\u53e3\uff1f\u300b\u5bf9\u4f60\u6709\u5f88\u5927\u5e2e\u52a9\uff01\u6b22\u8fce\u6536\u85cf\uff0c\u5206\u4eab\u7ed9\u66f4\u591a\u7684\u9700\u8981\u7684\u670b\u53cb\u5b66\u4e60~<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241120\/1732103519673dcd5fa3707.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>NodePort\u7c7b\u578bService\u5728Node\u8282\u70b9\u4e0aNetstat\u770b\u4e0d\u5230NodePort\u7aef\u53e3\u7684\u539f\u56e0<\/strong><\/p>\n<p>\u5c3d\u7ba1\u521b\u5efa\u4e86\u7c7b\u578b\u4e3aNodePort\u7684Service\uff0c\u5e76\u5728Kubernetes\u96c6\u7fa4\u4e2d\u6307\u5b9a\u4e86NodePort\u4e3a31002\uff0c\u4f46\u662f\u901a\u8fc7netstat\u547d\u4ee4\u4ecd\u7136\u65e0\u6cd5\u5728Node\u8282\u70b9\u4e0a\u89c2\u5bdf\u5230\u8fd9\u4e2aNodePort\u3002\u8fd9\u662f\u56e0\u4e3a\uff1a<\/p>\n<p>NodePort\u7c7b\u578b\u7684Service\u5b9e\u9645\u4e0a\u4e0d\u4f1a\u5728Node\u8282\u70b9\u4e0a\u76d1\u542c\u6307\u5b9a\u7684NodePort\u3002\u76f8\u53cd\uff0cKubernetes\u901a\u8fc7iptables\u89c4\u5219\u5c06\u8fd9\u4e2a\u7aef\u53e3\u8f6c\u53d1\u5230\u5b9e\u9645\u8fd0\u884c\u8be5\u670d\u52a1\u4e2d\u7684Pod\u7684IP\u5730\u5740\u548c\u7aef\u53e3\u4e0a\u3002\u8fd9\u662f\u4e3a\u4e86\u8ba9\u5916\u90e8\u6d41\u91cf\u80fd\u591f\u901a\u8fc7NodePort\u8bbf\u95eeService\u3002<\/p>\n<p>\u56e0\u6b64\uff0c\u5f53\u901a\u8fc7netstat\u547d\u4ee4\u68c0\u67e5Node\u8282\u70b9\u65f6\uff0c\u4e0d\u4f1a\u627e\u5230NodePort\u5bf9\u5e94\u7684\u76d1\u542c\u8fdb\u7a0b\u3002\u8fd9\u662f\u56e0\u4e3a\u5728\u8fd9\u4e2a\u7aef\u53e3\u4e0a\u6ca1\u6709\u5b9e\u9645\u7684\u8fdb\u7a0b\u5728\u76d1\u542c\uff0c\u6240\u6709\u6d41\u91cf\u90fd\u88ab\u8f6c\u53d1\u5230\u4e86Pod\u4e0a\u3002<\/p>\n<p>\u672c\u7bc7\u5173\u4e8e\u300a\u4e3a\u4ec0\u4e48\u5728 Node \u8282\u70b9\u4e0a\u7528 netstat \u770b\u4e0d\u5230 NodePort \u7c7b\u578b Service \u7684\u7aef\u53e3\uff1f\u300b\u7684\u4ecb\u7ecd\u5c31\u5230\u6b64\u7ed3\u675f\u5566\uff0c\u4f46\u662f\u5b66\u65e0\u6b62\u5883\uff0c\u60f3\u8981\u4e86\u89e3\u5b66\u4e60\u66f4\u591a\u5173\u4e8eGOLANG\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u8bf7\u5173\u6ce8GOLANG\u516c\u4f17\u53f7\uff01<\/p>\n<dl>\n<dt>\n <\/dt>\n<dd>\n   Spring Data JPA \u6d41\u67e5\u8be2\u65b9\u6cd5\n <\/dd>\n<\/dl>\n<dl>\n<dt>\n <\/dt>\n<dd>\n   \u7535\u8111C\u76d8\u91cd\u88c5\uff1a\u4f60\u9700\u8981\u77e5\u9053\u7684\u5168\u90e8\u6b65\u9aa4\u548c\u6ce8\u610f\u4e8b\u9879\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u7bc7\u6587\u7ae0\u4e3b\u8981\u662f\u7ed3\u5408\u6211\u4e4b\u524d\u9762\u8bd5\u7684\u5404&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-206725","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/206725","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=206725"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/206725\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=206725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=206725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=206725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}