{"id":19399,"date":"2026-10-20T15:52:11","date_gmt":"2026-10-20T07:52:11","guid":{"rendered":"https:\/\/kbwp.transwarp.cn\/?p=19399"},"modified":"2026-10-20T17:56:34","modified_gmt":"2026-10-20T09:56:34","slug":"shiva%e8%a1%a8%e5%91%8a%e8%ad%a6%e4%b9%8b-unbalanced-tablet","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=19399","title":{"rendered":"shiva\u8868\u544a\u8b66\u4e4b Unbalanced tablet"},"content":{"rendered":"<h2>\u4e00. \u95ee\u9898\u73b0\u8c61<\/h2>\n<p>\u5728 TDDMS Webserver \u9875\u9762\u67e5\u770b Table Warnings \u8be6\u60c5\u65f6\uff0c\u90e8\u5206\u8868\u88ab\u6807\u8bb0\u4e3a <strong>Unbalanced Tablet<\/strong>\uff0c\u70b9\u51fbshiva\u8868\u540d\uff0c\u80fd\u770b\u5230\u5982\u4e0b\u7edf\u8ba1\u6307\u6807\uff1a<\/p>\n<pre><code>Avg = 3,  Min = 0,  Max = 6,  Variance = 9,  Variance Bound = 1<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/10\/image-1792482435816.png\" alt=\"file\" \/><\/p>\n<p>\u5224\u5b9a\u89c4\u5219\uff1a<strong>Variance &gt; Variance Bound\uff08\u9ed8\u8ba41\uff09 \u5373\u5224\u5b9a\u4e3a\u4e0d\u5747\u8861<\/strong>\u3002\u5178\u578b\u8868\u73b0\u4e3a\uff1a<\/p>\n<ul>\n<li>Min = 0\uff1a\u8868\u4e2d\u6709<strong>\u7a7a tablet<\/strong>\uff08\u4e00\u4e2a\u5b57\u8282\u90fd\u6ca1\u6709\uff09\uff1b<\/li>\n<li>Max \u660e\u663e\u5927\u4e8e Avg\uff1a\u4e2a\u522b tablet \u8fdc\u8d85\u5e73\u5747\u5927\u5c0f\uff1b<\/li>\n<li>\u6570\u636e\u53ea\u96c6\u4e2d\u5728\u90e8\u5206 tablet \u4e0a\uff0c\u5176\u4f59 tablet \u5168\u7a7a\u3002<\/li>\n<\/ul>\n<h2>\u4e8c. \u6307\u6807\u662f\u600e\u4e48\u7b97\u51fa\u6765\u7684<\/h2>\n<p>\u9762\u677f\u6307\u6807\u57fa\u4e8e<strong>\u6bcf\u4e2a tablet \u7684\u78c1\u76d8\u5927\u5c0f<\/strong>\uff08\u8f6c\u6210\u6574\u6570 GiB\uff09\u7edf\u8ba1\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u6307\u6807<\/th>\n<th>\u542b\u4e49<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Avg \/ Min \/ Max<\/td>\n<td>\u5168\u90e8 tablet \u5e73\u5747 \/ \u6700\u5c0f \/ \u6700\u5927\u5927\u5c0f\uff08GiB\uff09<\/td>\n<\/tr>\n<tr>\n<td>Variance<\/td>\n<td>tablet \u5927\u5c0f\u7684\u603b\u4f53\u65b9\u5dee\uff0c\u53cd\u6620 tablet \u4e4b\u95f4\u7684\u5dee\u5f02\u7a0b\u5ea6<\/td>\n<\/tr>\n<tr>\n<td>Variance Bound<\/td>\n<td>\u5747\u8861\u5ea6\u9608\u503c\uff08\u914d\u7f6e\u9879\uff0c\u9ed8\u8ba4 1\uff09\uff0c\u4e0d\u662f\u8ba1\u7b97\u51fa\u6765\u7684<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u63a5\u53e3\u83b7\u53d6\u5230\u8868\u7684tablet\u5927\u5c0f\u4fe1\u606f\uff1a<\/p>\n<pre><code class=\"language-shell\">curl -u shiva:shiva -X POST \"<TDDMSWebserverIP>:4567\/api\/shiva\/table\/details\" -d '{\"database\":\"<database>\",\"tableName\":\"<table_name>\"}'<\/code><\/pre>\n<p>\u793a\u4f8b\uff1a\u4e00\u5f20 48 tablet \u7684\u8868\uff0c\u524d 24 \u4e2a\u5404\u7ea6 6.75 GiB\u3001\u540e 24 \u4e2a\u4e3a\u7a7a<\/p>\n<ul>\n<li>Avg=(24\u00d76+24\u00d70)\/48=144\/48 = 3<\/li>\n<li>Min=0\u3001tablet 24\u201347 \u5168\u7a7a<\/li>\n<li>Max=6\u30017247839844 \/ 2^30 = 6.750 \u2192 6\uff08\u6700\u5927 tablet 7280511628 \u2192 6.78 \u2192 6\uff09\uff0c\u53d6\u6574\u540e\u843d\u5728 6<\/li>\n<li>Variance=9\u3001\u603b\u4f53\u65b9\u5dee \u03a3(x\u1d62\u2212\u03bc)\u00b2\/N = [24\u00d7(6\u22123)\u00b2 + 24\u00d7(0\u22123)\u00b2] \/ 48 = 432\/48 = 9\uff08\u4e24\u70b9\u5206\u5e03\u4e0b\u7b49\u4ef7\u4e8e ((Max\u2212Min)\/2)\u00b2 = 9\uff0c\u53ef\u7528\u6765\u5feb\u901f\u6838\u9a8c\uff09<\/li>\n<li>\u6700\u7ec8 Variance=9&gt; 1\uff0c\u5224\u5b9a Unbalanced<\/li>\n<\/ul>\n<p>\u8fd9\u91cc\u63d0\u4f9b\u4e00\u4e2a\u8ba1\u7b97\u811a\u672c <a href=\"https:\/\/fs.transwarp.cn\/?download&weblink=46817183e06277ad8eedd36ee11edf7d&realfilename=Variance_calculate.sh\" title=\"variance_calculate.sh\">variance_calculate.sh<\/a>\uff0c\u53ef\u4ee5\u901a\u8fc7 <code>\/api\/shiva\/table\/details<\/code> \u83b7\u53d6\u8868\u7684tablet\u5927\u5c0f\u4fe1\u606f\uff0c\u8fdb\u800c\u6839\u636e\u4e0a\u9762\u7684\u8ba1\u7b97\u903b\u8f91\u8ba1\u7b97\u51fa <code>Avg\/Min\/Max\/Variance<\/code><\/p>\n<pre><code class=\"language-shell\"># 1. \u9996\u5148\u901a\u8fc7\u63a5\u53e3\u83b7\u53d6 ads.ads_cfuture_tag_record_unstructured \u8868\u7684tablet\u5927\u5c0f\u4fe1\u606f\uff0c\u8f93\u51fa\u5230 ads_cfuture_tag_record_unstructured.txt \u6587\u4ef6\n[root@kv1 ~] curl -u shiva:shiva -X POST \"172.18.131.171:4567\/api\/shiva\/table\/details\" -d '{\"database\":\"default\",\"tableName\":\"ads.ads_cfuture_tag_record_unstructured_9fa252bb-97b1-4a24-9f21-864512d74533\"}' > ads_cfuture_tag_record_unstructured.txt\n\n# 2. \u8fd0\u884c\u811a\u672c\uff0c\u8ba1\u7b97\u51fa Avg\/Min\/Max\/Variance \u7684\u503c\n[root@kv1 ~] sh variance_calculate.sh ads_cfuture_tag_record_unstructured.txt\n\n===== Shiva \u8868 tablet \u5747\u8861\u5ea6 =====\n\u8f93\u5165\u6587\u4ef6      : ads_cfuture_tag_record_unstructured.txt\n\u8868\u5065\u5eb7\u5ea6      : GREEN\ntablet \u6570     : 24      \u526f\u672c\u6570: 72      tabletserver: 14\n\u903b\u8f91\u5927\u5c0f      : 175.38 GiB      \u7269\u7406\u5360\u7528: 525.92 GiB\n\u6709\u6570\u636e tablet : 10 (41.7%)   \u7a7a tablet: 14\n\u6709\u6570\u636e id     : 0 1 2 3 4 5 6 7 8 9\n\n---- \u9762\u677f\u53e3\u5f84\uff1a\u6bcf tablet \u5927\u5c0f\u53d6\u6574 GiB ----\n  Avg = 7\n  Min = 0\n  Max = 17\n  Variance = 70\n  Variance Bound = 1\n  \u5224\u5b9a: 70 > 1  =>  Tablets Unbalanced\n<\/code><\/pre>\n<h2>\u4e09. \u6839\u56e0\u5206\u6790<\/h2>\n<h3>3.1 \u5206\u6876\u3001\u5206\u7247\uff08tablet\uff09\u3001\u78c1\u76d8\u7684\u5bf9\u5e94\u5173\u7cfb<\/h3>\n<p>\u7406\u89e3\u8be5\u95ee\u9898\u7684\u524d\u63d0\u662f\u660e\u786e\u4e09\u8005\u7684\u56fa\u5b9a\u6620\u5c04\u5173\u7cfb\uff1a<\/p>\n<ul>\n<li>1 \u4e2a\u5206\u6876\u7684\u6570\u636e\u4ec5\u5b58\u50a8\u5728 1 \u4e2a\u5206\u7247\uff08tablet\uff09\u4e0a\uff0c\u5206\u6876\u4e0e\u5206\u7247\u7684\u5bf9\u5e94\u5173\u7cfb\u56fa\u5b9a\uff1b<\/li>\n<li>1 \u4e2a\u5206\u7247\u4ec5\u5b58\u50a8\u5728 1 \u5757\u78c1\u76d8\u4e0a\uff1b\u53cd\u8fc7\u6765\uff0c1 \u5757\u76d8\u53ef\u4ee5\u627f\u8f7d\u591a\u4e2a\u4e0d\u540c\u526f\u672c\uff1b<\/li>\n<li>\u4e00\u4e2a\u5206\u533a\u4e0b\u53ef\u80fd\u6709\u591a\u4e2a tablet\uff0c\u4e00\u4e2a tablet \u4e0a\u53ef\u80fd\u6709\u591a\u4efd bucket\uff08\u540c\u4e00\u4e2a tablet \u7684\u6570\u636e\u6587\u4ef6\u843d\u5728\u540c\u4e00\u53f0\u7269\u7406\u673a\u7684\u540c\u4e00\u5757\u78c1\u76d8\u4e0a\uff09\u3002<\/li>\n<\/ul>\n<h3>3.2 \u5927\u5c0f\u5dee\u5f02\u662f\u600e\u4e48\u4ea7\u751f\u7684<\/h3>\n<p>\u7531\u4e0a\u8ff0\u56fa\u5b9a\u6620\u5c04\u53ef\u77e5\uff1a<strong>tablet \u7684\u5927\u5c0f = \u8be5 tablet \u627f\u8f7d\u7684\u6240\u6709 bucket \u6570\u636e\u4e4b\u548c<\/strong>\u3002\u56e0\u6b64\uff0c\u5f53\u51fa\u73b0\u4ee5\u4e0b\u60c5\u51b5\u65f6\uff0ctablet \u5927\u5c0f\u5fc5\u7136\u4ea7\u751f\u5dee\u5f02\uff1a<\/p>\n<ul>\n<li><strong>\u5206\u6876\u6570 &lt; \u5206\u7247\u6570<\/strong>\uff08\u5e38\u89c1\uff09\uff1a\u90e8\u5206 tablet \u5206\u4e0d\u5230\u4efb\u4f55 bucket\uff0c\u6210\u4e3a\u7a7a tablet\u3002<\/li>\n<li><strong>\u5206\u6876\u6570 % \u5206\u7247\u6570 \u6709\u4f59\u6570<\/strong>\uff08\u5c11\u89c1\uff09\uff1a\u5404 tablet \u5206\u5230\u7684 bucket \u6570\u4e0d\u4e00\u81f4\uff0c\u6570\u636e\u91cf\u968f\u4e4b\u62c9\u5f00\u5dee\u8ddd\uff1b<\/li>\n<\/ul>\n<p>\u5e38\u89c1\u6210\u56e0\u662f\uff1a<\/p>\n<ul>\n<li>\u5ba2\u6237\u5efa\u8868\u65f6<strong>\u624b\u52a8\u6307\u5b9a\u4e86\u8f83\u5c11\u7684\u5206\u6876\u6570<\/strong><\/li>\n<li><strong>\u5efa\u8868\u65f6\u672a\u6307\u5b9a\u5206\u6876\u6570\u4f46\u662f\u5f53\u65f6\u7684 <code>tabletserver.store.datadirs<\/code> \u78c1\u76d8\u6570\u8f83\u5c11\uff0c\u540e\u7eed\u6269\u5bb9\u4e86\u8282\u70b9\u6216\u78c1\u76d8\u2014\u2014\u5206\u7247\u6570\u53d8\u591a\u4e86\uff0c\u5206\u6876\u6570\u5374\u505c\u7559\u5728\u65e7\u503c\uff0c\u591a\u4f59\u7684 tablet \u4fbf\u4e00\u76f4\u662f\u7a7a\u7684<\/strong>\u3002<\/li>\n<\/ul>\n<h2>\u56db. \u4e3a\u4ec0\u4e48 table repair \u548c balance \u6ca1\u6709\u4f5c\u7528<\/h2>\n<p><code>table repair<\/code> \u4e0e <code>balance<\/code>\uff08rebalance\uff09\u64cd\u4f5c\u8c03\u6574\u7684\u662f<strong>\u526f\u672c\u5728\u8282\u70b9\/\u78c1\u76d8\u4e4b\u95f4\u7684\u6446\u653e\u4f4d\u7f6e<\/strong>\uff0c\u5e76\u4e0d\u6539\u53d8&quot;\u5206\u6876 \u2192 \u5206\u7247&quot;\u7684\u6570\u636e\u5f52\u5c5e\u3002\u800c\u672c\u95ee\u9898\u7684\u6839\u56e0\u662f<strong>\u5206\u6876\u6570\u4e0e\u5206\u7247\u6570\u4e0d\u5339\u914d\u5bfc\u81f4\u7684\u6570\u636e\u5206\u5e03\u503e\u659c<\/strong>\u2014\u2014\u7a7a tablet \u65e0\u8bba\u632a\u5230\u54ea\u91cc\u90fd\u662f\u7a7a\u7684\uff0c\u8d85\u5927\u7684 tablet \u632a\u5230\u522b\u7684\u8282\u70b9\u8fd8\u662f\u90a3\u4e48\u5927\u3002\u6240\u4ee5\u65e0\u8bba\u600e\u4e48 balance\uff0cVariance \u90fd\u4e0d\u4f1a\u4e0b\u964d\uff0cUnbalanced \u6807\u8bb0\u4e5f\u65e0\u6cd5\u6d88\u9664\u3002<\/p>\n<h2>\u4e94. \u89e3\u51b3\u65b9\u6848<\/h2>\n<p><strong>\u6839\u672c\u624b\u6bb5\u662f\u91cd\u5efa\u8868\uff0c\u63d0\u9ad8\u5206\u6876\u6570\uff0c\u8ba9\u6570\u636e\u5c3d\u91cf\u5206\u6563<\/strong>\uff1a<\/p>\n<ul>\n<li><strong>\u4f18\u5148\u63a8\u8350\uff1a\u91cd\u5efa\u8868\u65f6\u4f7f\u7528\u9ed8\u8ba4\u5206\u6876\u6570<\/strong>\uff0c\u7531\u7cfb\u7edf\u6309\u5f53\u524d\u78c1\u76d8\u6570\u81ea\u52a8\u5206\u914d\uff1b<\/li>\n<li>\u6216<strong>\u624b\u52a8\u6307\u5b9a\u66f4\u5927\u7684\u5206\u6876\u6570<\/strong>\uff08\u4e0d\u5c0f\u4e8e\u5206\u7247\u6570\uff0c\u4e14\u5c3d\u91cf\u80fd\u6574\u9664\uff09\uff0c\u4f7f\u6570\u636e\u5229\u7528\u66f4\u591a\u78c1\u76d8\u3001tablet \u5927\u5c0f\u66f4\u5747\u5300\uff1b<\/li>\n<\/ul>\n<h2>\u516d. \u9884\u9632\u5efa\u8bae<\/h2>\n<ul>\n<li>\u5efa Holodesk \u8868\u65f6<strong>\u4e0d\u624b\u52a8\u6307\u5b9a\u8fc7\u5c0f\u7684\u5206\u6876\u6570<\/strong>\uff0c\u5efa\u8bae\u76f4\u63a5\u4f7f\u7528\u9ed8\u8ba4\u503c\uff1b<\/li>\n<li>\u6269\u5bb9\u8282\u70b9\/\u78c1\u76d8\u540e\uff0c\u6392\u67e5\u5b58\u91cf\u8868\u7684&quot;\u5206\u6876\u6570 vs \u5206\u7247\u6570&quot;\u5339\u914d\u60c5\u51b5\uff0c\u5bf9\u4e0d\u5339\u914d\u7684\u8868\u8bc4\u4f30\u91cd\u5efa\uff1b<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00. \u95ee\u9898\u73b0\u8c61 \u5728 TDDMS Webserver \u9875\u9762\u67e5\u770b Table Warnings \u8be6\u60c5\u65f6\uff0c\u90e8\u5206\u8868\u88ab\u6807 ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=19399\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-19399","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\/19399","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\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19399"}],"version-history":[{"count":4,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/19399\/revisions"}],"predecessor-version":[{"id":19408,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/19399\/revisions\/19408"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}