{"id":10485,"date":"2023-10-16T09:42:56","date_gmt":"2023-10-16T01:42:56","guid":{"rendered":"https:\/\/nj.transwarp.cn:8180\/?p=10485"},"modified":"2024-08-07T09:14:45","modified_gmt":"2024-08-07T01:14:45","slug":"hdfs-%e7%9a%84%e8%af%bb%e5%86%99%e6%80%a7%e8%83%bd%e6%8e%92%e6%9f%a5%e6%80%9d%e8%b7%af","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=10485","title":{"rendered":"HDFS \u7684\u8bfb\u5199\u6027\u80fd\u6392\u67e5\u601d\u8def"},"content":{"rendered":"<h3>\u6982\u8981\u63cf\u8ff0<\/h3>\n<p>hdfs \u4f5c\u4e3a hyperbase\u3001inceptor \u7684\u6587\u4ef6\u5b58\u50a8\u7cfb\u7edf\uff0c\u5f53\u51fa\u73b0 hyperbase\u3001inceptor \u8bfb\u5199\u6162\u7684\u60c5\u51b5\u65f6\uff0c\u9700\u8981\u8003\u8651 hdfs \u7684\u8bfb\u5199\u6027\u80fd\u662f\u5426\u51fa\u73b0\u95ee\u9898\uff0c\u672c\u6587\u4e3b\u8981\u4ecb\u7ecd HDFS \u7684\u8bfb\u5199\u6027\u80fd\u6392\u67e5\u601d\u8def\u3002<\/p>\n<h3>\u8be6\u7ec6\u8bf4\u660e<\/h3>\n<ol>\n<li>\u65e5\u5fd7\u5173\u952e\u5b57<\/li>\n<li>\u7f51\u7edc\u76d1\u63a7<\/li>\n<li>\u78c1\u76d8io<\/li>\n<\/ol>\n<h4>\u7f51\u7edc\u76d1\u63a7<\/h4>\n<h4>\u65e5\u5fd7\u5173\u952e\u5b57<\/h4>\n<h5>hdfs \u6027\u80fd\u65e5\u5fd7<\/h5>\n<p>\u4f7f\u7528 egrep \u8fc7\u6ee4 Slow \u5173\u952e\u8bcd\uff0c\u5e76\u7edf\u8ba1\u6bcf\u79cd\u60c5\u51b5\u7684\u5177\u4f53\u6570\u91cf\uff1a<\/p>\n<p><code>egrep -o &quot;Slow.*?(took|cost)&quot; hadoop-hdfs-datanode*.log | sort | uniq -c<\/code><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2023\/07\/image-1688614891354.png\" alt=\"file\" \/><\/p>\n<p>\u603b\u7ed3\u4e00\u4e0b\u51e0\u79cd\u60c5\u51b5\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u65e5\u5fd7<\/th>\n<th>\u539f\u56e0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Slow BlockReceiver write packet to mirror<\/td>\n<td>\u8fd9\u8868\u660e\u5728\u7f51\u7edc\u4e0a\u5199\u5165\u5757\u65f6\u6709\u5ef6\u8fdf<\/td>\n<\/tr>\n<tr>\n<td>Slow BlockReceiver write data to disk cost<\/td>\n<td>\u8fd9\u8868\u793a\u5728\u5c06\u5757\u5199\u5165OS\u7f13\u5b58\u6216\u78c1\u76d8\u65f6\u5b58\u5728\u5ef6\u8fdf<\/td>\n<\/tr>\n<tr>\n<td>Slow flushOrSync<\/td>\n<td>\u8fd9\u8868\u793a\u5728\u5c06\u5757\u5199\u5165OS\u7f13\u5b58\u6216\u78c1\u76d8\u65f6\u5b58\u5728\u5ef6\u8fdf<\/td>\n<\/tr>\n<tr>\n<td>Slow manageWriterOsCache<\/td>\n<td>\u8fd9\u8868\u793a\u5728\u5c06\u5757\u5199\u5165OS\u7f13\u5b58\u6216\u78c1\u76d8\u65f6\u5b58\u5728\u5ef6\u8fdf<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u65f6\uff0c\u8fd9\u4e9b\u65e5\u5fd7\u4fe1\u606f\u5728\u6b63\u5e38\u96c6\u7fa4\u4e0a\u4e5f\u6709\u53ef\u80fd\u51fa\u73b0\uff1b\u53ea\u6709\u5f53\u8fd9\u4e9b\u9519\u8bef\u4fe1\u606f\u5f02\u5e38\u591a\uff0c\u6216\u8005\u5355\u8282\u70b9\u4e2a\u522b\u65f6\u95f4\u6bb5\u5185\u6570\u91cf\u5f02\u5e38\u591a\uff0c\u6216\u8005\u591a\u8282\u70b9\u5bf9\u6bd4\u53d1\u73b0\u4e2a\u522b\u8282\u70b9\u6570\u91cf\u5f02\u5e38\u65f6\uff0c\u624d\u7b97\u662f\u5f02\u5e38\u60c5\u51b5\uff1b<\/p>\n<p>\u5f53\u5355\u4e2a\u8282\u70b9\u5177\u6709\u6bd4\u6b63\u5e38\u60c5\u51b5\u66f4\u591a\u7684\u4e0a\u8ff0WARN\u6d88\u606f\u65f6\uff0c\u8868\u660e\u5b58\u5728\u5e95\u5c42\u786c\u4ef6\u95ee\u9898\u3002\u7136\u540e\u7ed3\u5408dmesg -T | grep -i error \u67e5\u770b\u786c\u4ef6\u4fe1\u606f\u786e\u5b9a\u662f\u5426\u5b58\u5728\u786c\u4ef6\u6545\u969c\u3002<\/p>\n<h5>\u9519\u8bef\u65e5\u5fd7<\/h5>\n<p>\u68c0\u67e5hdfs datanode\u8fd0\u884c\u65e5\u5fd7\uff0c\u641c\u7d22\u5173\u952e\u8bcd\uff1aIOException\u3001error\u3001fatal\u7b49\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u65e5\u5fd7<\/th>\n<th>\u539f\u56e0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>IOExceptionxceiver count 4097 exceeds the limit of concurrent xcievers hdfs datanode<\/td>\n<td>\u6587\u4ef6\u8bfb\u5199\u7ebf\u7a0b\u6570\u4e0d\u591f\uff0c\u96c6\u7fa4\u5e76\u53d1\u8bfb\u5199\u9ad8\uff0c\u4efb\u52a1\u6279\u5904\u7406\u591a\u3002<\/td>\n<\/tr>\n<tr>\n<td>java.net.SocketTimeoutException Read timed out<\/td>\n<td>\u5ba2\u6237\u7aef\u64cd\u4f5cdatanode socket \u8d85\u65f6\uff0c\u53ef\u80fd\u662f\u7ebf\u7a0b\u6570\u4e0d\u591f\uff0c\u6216\u8005\u5185\u5b58GC\u4e0d\u591f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5>1\u3001\u811a\u672c nettyThroughputCheck.sh<\/h5>\n<p><code>\/usr\/lib\/inspection\/bin\/nettyThroughputCheck.sh<\/code><\/p>\n<p>\u811a\u672c\u4f7f\u7528\u8bf4\u660e\uff1a<\/p>\n<p>1.1 \u524d\u7f6e\u6587\u4ef6\uff1a \/usr\/lib\/inspection\/lib\/inspectionAgent-x.x.x.jar<\/p>\n<p>\u9700\u8981\u518d\u6bcf\u4e2a\u670d\u52a1\u5668\u4e0a\u521b\u5efa \/usr\/lib\/inspection\/lib\/ \u7ed9\u666e\u901a\u6743\u9650\u5373\u53ef<\/p>\n<p>\u6bcf\u4e2a\u8282\u70b9 \/usr\/lib\/inspection\/lib\/ \u653e\u7f6e inspectionAgent-*.jar<\/p>\n<p>1.2 \u914d\u7f6e\uff1a<\/p>\n<p>\u5c06\u811a\u672c nettyThroughputCheck.sh \u4e2d\u7684 inspectionAgent-x.x.x.jar \u4fee\u6539\u4e3a\u73b0\u6709\u7248\u672c;<\/p>\n<ol>\n<li>ipList\uff1a\u5fc5\u987b\u81f3\u5c11\u5305\u542b\u96c6\u7fa4\u4e00\u4e2a\u975e Manager \u8282\u70b9;<\/li>\n<li>nodeUser\uff1a\u4f7f\u7528\u5de1\u68c0\u5de5\u5177\u5e73\u65f6\u5de1\u68c0\u7684\u7528\u6237<\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2023\/07\/image-1688625636179.png\" alt=\"file\" \/><\/p>\n<p>1.3 \u6267\u884c\u7f51\u7edc\u5de1\u68c0<br \/>\nsudo sh -x \/usr\/lib\/inspection\/bin\/nettyThroughputCheck.sh<\/p>\n<p>\u9ed8\u8ba4\u7ed3\u679c\u4e2d\u63a5\u8fd1100MB\/s \uff0c\u7f51\u7edc\u5373\u4e3a\u65e0\u95ee\u9898<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2023\/07\/image-1688625558173.png\" alt=\"file\" \/><\/p>\n<p><strong>PS\uff1a\u811a\u672c\u4f7f\u7528\u524d\u7f6e\u6761\u4ef6\u6bd4\u8f83\u590d\u6742\uff0c\u53ef\u4ee5\u8003\u8651\u6539\u9020\u4e00\u4e0b\u811a\u672c\uff0c\u4f7f\u7528 transwarp \u7684\u5bc6\u94a5cp \u6587\u4ef6\uff1a<\/strong><\/p>\n<pre><code class=\"language-shell\">ssh -p $nodePort -o StrictHostKeyChecking=no -i $nodeRsa $nodeUser@$ip sudo mkdir -p \/usr\/lib\/inspection\/lib\/\nscp -i $nodeRsa -r $jarPath $nodeUser@$ip:\/tmp\/\nssh -p $nodePort -o StrictHostKeyChecking=no -i $nodeRsa $nodeUser@$ip sudo mv \/tmp\/inspectionAgent-1.2.8.jar \/usr\/lib\/inspection\/lib\/<\/code><\/pre>\n<h4>\u78c1\u76d8 io<\/h4>\n<p><code>iostat -xmd 2 10<\/code><\/p>\n<p>%util: \u91c7\u7528\u5468\u671f\u5185\u7528\u4e8eIO\u64cd\u4f5c\u7684\u65f6\u95f4\u6bd4\u7387\uff0c\u5373\u4e00\u79d2\u4e2d\u6709\u767e\u5206\u4e4b\u591a\u5c11\u7684\u65f6\u95f4\u7528\u4e8e I\/O\uff1b<\/p>\n<p>\u5982\u679c%util\u63a5\u8fd1100%\uff0c\u8bf4\u660e\u4ea7\u751f\u7684I\/O\u8bf7\u6c42\u592a\u591a\uff0cI\/O\u7cfb\u7edf\u5df2\u7ecf\u6ee1\u8d1f\u8377\uff1b<\/p>\n<p>\u786e\u8ba4\u78c1\u76d8 io \u4f7f\u7528\u7387\u63a5\u8fd1 100% \u65f6\uff0c\u5219\u67e5\u770b\u5177\u4f53\u5360\u7528 io \u7684\u8fdb\u7a0b\u4fe1\u606f\uff1a<\/p>\n<p><code>pidstat -dl -T ALL 3<\/code><\/p>\n<p>\u67e5\u770b\u5177\u4f53\u5360\u7528\u78c1\u76d8 io \u7684\u8fdb\u7a0b\u662f\u54ea\u4e9b\uff1b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981\u63cf\u8ff0 hdfs \u4f5c\u4e3a hyperbase\u3001inceptor \u7684\u6587\u4ef6\u5b58\u50a8\u7cfb\u7edf\uff0c\u5f53\u51fa\u73b0 hyperbase\u3001i ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=10485\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-10485","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/10485","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10485"}],"version-history":[{"count":3,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/10485\/revisions"}],"predecessor-version":[{"id":13888,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/10485\/revisions\/13888"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10485"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}