{"id":8714,"date":"2020-03-08T16:39:12","date_gmt":"2020-03-08T08:39:12","guid":{"rendered":"https:\/\/jpuyy.com\/?p=8714"},"modified":"2020-05-08T19:22:40","modified_gmt":"2020-05-08T11:22:40","slug":"%e6%8e%a5%e5%85%a5-k8s-%e9%81%87%e5%88%b0%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=8714","title":{"rendered":"\u63a5\u5165 k8s \u9047\u5230\u7684\u95ee\u9898"},"content":{"rendered":"<p>\u4ece\u4f20\u7edf\u5bb9\u5668\u63a5\u5165 k8s \u8fc7\u7a0b\u4e2d\u9047\u5230\u7684\u95ee\u9898\uff1a<\/p>\n<p>1. \u67d0 sdk \u8981\u5347\u7ea7\uff08\u4f4e\u7248\u672c\u7684\u4f1a\u5bfc\u81f4 istio \u5bb9\u5668\u6302\u6389\uff09<br \/>\n\u62a5\u9519\u4e3a Caused by: java.io.IOException: Cannot bind to URL [rmi:\/\/\/jmxrmi]: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is<\/p>\n<p>2. \u5ba2\u6237\u7aef HTTP \u5bf9\u5916\u8bf7\u6c42\u88ab envoy rule deny 400( bad request ),  \u539f\u56e0 HTTP header \u91cc\u51fa\u73b0\u4e86\u7a7a\u7684 key:value\uff0c\u5ba2\u6237\u7aef\u4fee\u590d\u540e\uff0c\u95ee\u9898\u6d88\u5931\u3002\u4ee5\u4e0b\u662f\u6293\u5305\uff0c\u89c1 Content-Type \u548c Accept \u4e2d\u95f4\u7684\u4e00\u884c<br \/>\n14:08:37.918970 IP 10.18.19.98.51604 &gt; lb008-dev.http: Flags [P.], seq 1:489, ack 1, win 229, options [nop,nop,TS val 1596856343 ecr 1593089157], length 488: HTTP: POST \/ws\/rs\/domain\/domain\/init HTTP\/1.1<br \/>\nE&#8230;.J@.?&#8230;<br \/>\n..b<br \/>\n..7&#8230;P. .].*&#8230;&#8230;+\\&#8230;..<br \/>\n_&#8230;^&#8230;POST \/ws\/rs\/domain\/domain\/init HTTP\/1.1<br \/>\nContent-Type: application\/json<br \/>\n:<br \/>\nAccept: application\/json<br \/>\napi-uuid: 02ac3ebe-f212-4ca8-998e-4a4ab576018c<br \/>\napi-control-request-type: ANONYMOUS<br \/>\nUser-Agent: Apache CXF 3.1.4<br \/>\nCache-Control: no-cache<br \/>\nPragma: no-cache<br \/>\nHost: uniauthserver-dev<br \/>\nConnection: keep-alive<br \/>\nContent-Length: 407<br \/>\n\u89e3\u51b3\uff1a\u4fee\u590d\u4e0a\u9762 : k,v \u90fd\u662f\u7a7a\u7684\u884c<\/p>\n<p>3. \u5982\u679c\u60f3\u8981\u4f7f\u7528 jaeger \u8fdb\u884c\u5206\u5e03\u5f0f tracing\uff0c\u53ef\u4ee5\u53c2\u8003 https:\/\/istio.io\/zh\/docs\/tasks\/telemetry\/distributed-tracing\/overview\/<\/p>\n<p>4. kiali \u51fa\u73b0 unknown \u7684\u8c03\u7528\u94fe \uff1a\u6ca1\u6709\u901a\u8fc7 service mesh \u7684\u8c03\u7528\uff0c\u4f1a\u663e\u793a unknown<\/p>\n<p>5. k8snode kernel \u7248\u672c\u95ee\u9898<br \/>\nkernel\u7248\u672c\u8fc7\u4f4e\u4f1a\u5bfc\u81f4docker\u62a5\u9519\uff0ckernel:unregister_netdevice: waiting for eth0 to become free. Usage count = 1<br \/>\n\u4f1a\u5bfc\u81f4\u7cfb\u7edfcpu\u5360\u7528\u8fc7\u9ad8\uff0cdocker\u5bb9\u5668\u90fd\u4f1a\u5361\u4f4f\u3002<br \/>\nObserved kernel versions with this issue<br \/>\nRHEL7 3.10.0-862<br \/>\n4.15.0<br \/>\n4.20.0<br \/>\nKernel versions claimed not triggering this issue<br \/>\nRHEL7 3.10.0-957.10.1<br \/>\n4.19.12<br \/>\n4.17.0<br \/>\n4.17.11<br \/>\nRelated kernel commits<br \/>\ntorvalds\/linux@f186ce6 &#8211; since 4.12<br \/>\ntorvalds\/linux@4ee806d &#8211; since 4.15<br \/>\ntorvalds\/linux@ee60ad2 &#8211; since 5.1<\/p>\n<p>\u53e6\u4e00\u4e2a\u8868\u73b0\u4e3a kubectl get pods &#8211;all-namespace -o wide \u53d1\u73b0 pods \u957f\u65f6\u95f4\u4e00\u76f4 Terminating\uff0c\u5220\u4e0d\u6389<\/p>\n<p>\u89e3\u51b3\uff1a yum update ( \u5347\u7ea7 kernel \u548c\u64cd\u4f5c\u7cfb\u7edf\u81f3\u6700\u65b0\u7248 kernel 3.10.0-957.21.3.el7)<\/p>\n<p>6. \u8bf7\u6c42\u7684 url \u51fa\u73b0  no healthy upstream( http 503 \u9519\u8bef) \u68c0\u67e5\u662f\u5426\u53d1\u5e03\u6210\u529f<\/p>\n<p>7. \u8bf7\u6c42 url \u51fa\u73b0 404 \uff08\u4e1a\u52a1\u53d1\u5e03\u662f\u6210\u529f\u7684) \uff0c\u68c0\u67e5 k8s \u5185\u90e8\u7684 virtual service \u548c ingress gateway \u662f\u5426\u914d\u7f6e\u6b63\u786e<\/p>\n<p>8. node \u7a0b\u5e8f\u56e0\u4e3a k8s \u6ce8\u5165\u7684\u73af\u5883\u53d8\u91cf\u592a\u591a\uff08k8s\u670d\u52a1\u53d1\u73b0\u673a\u5236)\uff0c\u5bfc\u81f4 node process.env \u957f\u5ea6\u592a\u957f\uff0c\u62a5\u9519\u542f\u52a8\u5931\u8d25 \u3002<\/p>\n<p>\u76ee\u524d\u9047\u5230\u95ee\u9898\u7684\u6709 frontend-main, market-solution-activity-web\u3002\u8fd8\u6ca1\u627e\u5230\u4e0d\u6539\u7a0b\u5e8f\u7684\u89e3\u51b3\u529e\u6cd5\u3002\u6539\u7a0b\u5e8f\u7684\u89e3\u51b3\u529e\u6cd5\u662f\u53ea\u53d6\u81ea\u5df1\u9700\u7684 process.env https:\/\/zhuanlan.zhihu.com\/p\/74056339<\/p>\n<p>[2019-07-30 16:54:13] PM2 error: Trace: { Error: spawn E2BIG<br \/>\nat exports._errnoException (util.js:1024:11)<br \/>\nat ChildProcess.spawn (internal\/child_process.js:325:11)<br \/>\nat exports.spawn (child_process.js:493:9)<br \/>\nat exports.fork (child_process.js:99:10)<br \/>\nat createWorkerProcess (internal\/cluster\/master.js:127:10)<br \/>\nat EventEmitter.cluster.fork (internal\/cluster\/master.js:161:25)<br \/>\nat Object.nodeApp (\/opt\/nodeapp\/node_modules\/pm2\/lib\/God\/ClusterMode.js:52:21)<br \/>\nat Object.executeApp (\/opt\/nodeapp\/node_modules\/pm2\/lib\/God.js:159:9)<br \/>\nat inject (\/opt\/nodeapp\/node_modules\/pm2\/lib\/God.js:418:18)<br \/>\nat Object.injectVariables (\/opt\/nodeapp\/node_modules\/pm2\/lib\/God.js:530:10) code: &#8216;E2BIG&#8217;, errno: &#8216;E2BIG&#8217;, syscall: &#8216;spawn&#8217; }<br \/>\nat Object.God.logAndGenerateError (\/opt\/nodeapp\/node_modules\/pm2\/lib\/God\/Methods.js:36:15)<br \/>\nat Object.nodeApp (\/opt\/nodeapp\/node_modules\/pm2\/lib\/God\/ClusterMode.js:54:11)<br \/>\nat Object.executeApp (\/opt\/nodeapp\/node_modules\/pm2\/lib\/God.js:159:9)<br \/>\nat inject (\/opt\/nodeapp\/node_modules\/pm2\/lib\/God.js:418:18)<br \/>\nat Object.injectVariables (\/opt\/nodeapp\/node_modules\/pm2\/lib\/God.js:530:10)<br \/>\nat \/opt\/nodeapp\/node_modules\/pm2\/lib\/God.js:416:9<br \/>\nat \/opt\/nodeapp\/node_modules\/pm2\/node_modules\/async\/dist\/async.js:1135:9<br \/>\nat replenish (\/opt\/nodeapp\/node_modules\/pm2\/node_modules\/async\/dist\/async.js:1011:17)<br \/>\nat \/opt\/nodeapp\/node_modules\/pm2\/node_modules\/async\/dist\/async.js:1016:9<br \/>\nat _asyncMap (\/opt\/nodeapp\/node_modules\/pm2\/node_modules\/async\/dist\/async.js:1133:5)<br \/>\n[2019-07-30 16:54:13] PM2 error: spawn E2BIG<\/p>\n<p>9. \u7528 flannel + host-gw \u963f\u91cc\u4e91\u4e0d\u652f\u6301\u81ea\u5df1\u5b9a\u4e49\u7684 route \uff0c\u5426\u5219\u9700\u8981\u624b\u52a8\u6dfb\u52a0\u8def\u7531\uff0c\u6362\u4e3a vxlan<\/p>\n<p>[root@kubespray001-infra.idc1 kubespray]# ansible all -i inventory\/k8s_prod_aliyun-cn-shanghai-b_006\/inventory.ini -m shell -a &#8220;ping -c 3  10.36.3.4&#8221;<br \/>\n[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details<br \/>\nk8snode034-prod.aliyun-cn-shanghai-b | CHANGED | rc=0 &gt;&gt;<br \/>\nPING 10.36.3.4 (10.36.3.4) 56(84) bytes of data.<br \/>\n64 bytes from 10.36.3.4: icmp_seq=1 ttl=64 time=0.066 ms<br \/>\n64 bytes from 10.36.3.4: icmp_seq=2 ttl=64 time=0.068 ms<br \/>\n64 bytes from 10.36.3.4: icmp_seq=3 ttl=64 time=0.067 ms<br \/>\n&#8212; 10.36.3.4 ping statistics &#8212;<br \/>\n3 packets transmitted, 3 received, 0% packet loss, time 1999ms<br \/>\nrtt min\/avg\/max\/mdev = 0.066\/0.067\/0.068\/0.000 ms<br \/>\nk8smaster016-prod.aliyun-cn-shanghai-b | FAILED | rc=1 &gt;&gt;<br \/>\nPING 10.36.3.4 (10.36.3.4) 56(84) bytes of data.<br \/>\n&#8212; 10.36.3.4 ping statistics &#8212;<br \/>\n3 packets transmitted, 0 received, 100% packet loss, time 2000msnon-zero return code<br \/>\nk8smaster015-prod.aliyun-cn-shanghai-b | FAILED | rc=1 &gt;&gt;<br \/>\nPING 10.36.3.4 (10.36.3.4) 56(84) bytes of data.<br \/>\n&#8212; 10.36.3.4 ping statistics &#8212;<br \/>\n3 packets transmitted, 0 received, 100% packet loss, time 1999msnon-zero return code<br \/>\nk8smaster014-prod.aliyun-cn-shanghai-b | FAILED | rc=1 &gt;&gt;<br \/>\nPING 10.36.3.4 (10.36.3.4) 56(84) bytes of data.<br \/>\n&#8212; 10.36.3.4 ping statistics &#8212;<br \/>\n3 packets transmitted, 0 received, 100% packet loss, time 2000msnon-zero return code<\/p>\n<p>10. \u6709\u7684\u5e94\u7528\u9700\u8981\u81ea\u5df1\u62e8 vpn \u8fde\u5230\u5176\u4ed6\u7f51\u7edc\uff0c\u6709\u72b6\u6001\uff0c\u4e0d\u80fd\u63a5\u5165<\/p>\n<p>11.  k8s\u91cc\u9762\uff0cjava\u5e94\u7528\u901a\u8fc7 Runtime.getRuntime().availableProcessors()\u62ff\u5230\u7684\u6838\u6570\u4e3a1\uff0c\u8fd9\u6837\u4f7f\u7528\u8fd9\u4e2a\u8bbe\u7f6e\u7ebf\u7a0b\u6c60\u7684\u5927\u5c0f\u4f1a\u53d8\u62101\uff0c\u6309\u7167\u4e4b\u524ddocker\u7684\u60c5\u51b5\u5e94\u8be5\u5e02\u8fd4\u56de\u5bbf\u4e3b\u673a\u6838\u6570<\/p>\n<p>12. \u6709\u7684\u6682\u65f6\u4e0d\u63a5\u5165 k8s \uff0c\u66b4\u9732\u7aef\u53e3\u4e3a tcp (\u975e http )\uff0c\u53d1\u5e03\u7cfb\u7edf\u751f\u6210\u7684 istio \u914d\u7f6e\u5747\u4e3a http\uff0c\u540e\u7eed\u8003\u8651<\/p>\n<p>13. pod STATUS CreateContainerConfigError<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ece\u4f20\u7edf\u5bb9\u5668\u63a5\u5165 k8s \u8fc7\u7a0b\u4e2d\u9047\u5230\u7684\u95ee\u9898\uff1a 1. \u67d0 sdk \u8981\u5347\u7ea7\uff08\u4f4e\u7248\u672c\u7684\u4f1a\u5bfc\u81f4 istio \u5bb9\u5668\u6302\u6389\uff09 \u62a5\u9519\u4e3a Caused by: java.io.IOException: Cannot bind to URL [rmi:\/\/\/jmxrmi]: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is 2. \u5ba2\u6237\u7aef HTTP \u5bf9\u5916\u8bf7\u6c42\u88ab envoy rule deny 400( bad request ), \u539f\u56e0 HTTP header \u91cc\u51fa\u73b0\u4e86\u7a7a\u7684 key:value\uff0c\u5ba2\u6237\u7aef\u4fee\u590d\u540e\uff0c\u95ee\u9898\u6d88\u5931\u3002\u4ee5\u4e0b\u662f\u6293\u5305\uff0c\u89c1 Content-Type \u548c Accept \u4e2d\u95f4\u7684\u4e00\u884c 14:08:37.918970 IP 10.18.19.98.51604 &gt; [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[185],"tags":[],"class_list":["post-8714","post","type-post","status-publish","format-standard","hentry","category-kubernetes"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/8714","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8714"}],"version-history":[{"count":3,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/8714\/revisions"}],"predecessor-version":[{"id":8902,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/8714\/revisions\/8902"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}