{"id":483,"date":"2014-03-31T01:23:01","date_gmt":"2014-03-31T01:23:01","guid":{"rendered":"http:\/\/www.selinuxplus.com\/?p=483"},"modified":"2014-03-31T01:23:01","modified_gmt":"2014-03-31T01:23:01","slug":"ceph%e5%ad%a6%e4%b9%a0-7crush%e7%ae%97%e6%b3%952","status":"publish","type":"post","link":"http:\/\/www.selinuxplus.com\/?p=483","title":{"rendered":"[ceph\u5b66\u4e60-7]crush\u7b97\u6cd5(2)"},"content":{"rendered":"<p>\u5c42\u6b21\u5316\u7684Cluster Map:<\/p>\n<p>Cluster Map\u7531\u8bbe\u5907(device)\u548c\u6876\uff08bucket)\u7ec4\u6210\uff0c\u4ed6\u4eec\u90fd\u6709\u6570\u503c\u578b\u7684\u6807\u8bc6\u7b26(id)\u548c\u6743\u91cd(weight value)\u3002bucket\u53ef\u4ee5\u5305\u542b\u4efb\u610f\u6570\u91cf\u7684devices\u6216\u8005\u5176\u4ed6buckets,\u4f7f\u4ed6\u4eec\u5f62\u6210\u5b58\u50a8\u7684\u6811\u72b6\u7ed3\u6784\u4e2d\u7684\u5185\u90e8\u8282\u70b9\uff0cdevice\u603b\u662f\u8fd9\u4e2a\u6811\u7ed3\u6784\u7684\u53f6\u5b50\u8282\u70b9\u3002\u7ba1\u7406\u5458\u5bf9\u5b58\u50a8\u8bbe\u5907\u8d4b\u4e88\u6743\u91cd\uff0c\u63a7\u5236\u8be5device\u7684\u76f8\u5bf9\u6570\u636e\u7684\u5b58\u50a8\u80fd\u529b\u3002\u5c3d\u7ba1\u4e00\u4e2a\u5927\u578b\u7cfb\u7edf\u5f80\u5f80\u5305\u542b\u4e86\u5b58\u50a8\u80fd\u529b\u548c\u6027\u80fd\u7279\u70b9\u4e0d\u5c3d\u76f8\u540c\u7684\u8bbe\u5907\uff0c\u4f46\u662f\u968f\u673a\u7684\u6570\u636e\u5206\u5e03\uff0c\u5728\u7edf\u8ba1\u610f\u4e49\u4e0a\u5c06device\u7684\u4f7f\u7528\u60c5\u51b5\u4e0e\u8d1f\u8f7d\uff08load)\u5173\u8054\u8d77\u6765\uff0c\u53ef\u4ee5\u5c06\u8bbe\u5907\u7684\u8d1f\u8f7d\u5360\u603b\u4f53\u7684\u6bd4\u4f8b\u4fdd\u6301\u5728\u5e73\u5747\u7684\u6c34\u5e73\u4e0a\u3002\u8fd9\u5c31\u4f7f\u5f97\u8fd9\u4e2a\u63cf\u8ff0\u6570\u636e\u653e\u7f6e\u89c4\u5219\u7684\u6743\u91cd\u662f\u53d6\u51b3\u4e8e\u8bbe\u5907\u5bb9\u91cf\u7684\u3002\u800cbucket\u7684\u6743\u91cd\u5219\u662f\u5176\u5305\u542b\u7684\u6240\u6709\u9879(item)\u7684\u6743\u91cd\u4e4b\u548c\u3002<\/p>\n<p>bucket \u53ef\u4ee5\u4ee5\u4efb\u610f\u5f62\u5f0f\u7ec4\u7ec7\u6210\u6811\u578b\u7ed3\u6784\u6765\u63cf\u8ff0\u53ef\u7528\u7684\u5b58\u50a8\u7ed3\u6784\u3002\u6570\u636e\u901a\u8fc7\u7c7b\u4f3c\u4f2a\u968f\u673a\u7684\u6563\u5217\u51fd\u6570\u9012\u5f52\u9009\u62e9\u5d4c\u5957\u9879\u76ee\uff0c\u5c06\u6570\u636e\u653e\u5230\u5c42\u6b21\u7ed3\u6784\u4e2d\u3002\u5728\u4f20\u7edf\u7684\u6563\u5217\u6280\u672f\u4e0b\uff0c\u4efb\u4f55\u76ee\u6807\u8bbe\u5907\u6570\u91cf\u7684\u6539\u53d8\uff0c\u90fd\u4f1a\u5bfc\u81f4\u4e00\u6b21\u5f88\u5927\u89c4\u6a21\u7684\u6570\u636e\u8fc1\u79fb\uff0c\u76f8\u6bd4\uff0cCRUSH\u4ee5\u53ca\u56db\u79cd\u4e0d\u540c\u7684bucket type\u3002\u6bcf\u79cd\u6709\u4e0d\u540c\u7684\u9009\u62e9\u7b97\u6cd5\uff0c\u6765\u89e3\u51b3\u589e\u5220device\u65f6\u5bfc\u81f4\u6570\u636e\u79fb\u52a8\u548c\u603b\u4f53\u8ba1\u7b97\u7684\u590d\u6742\u5ea6\u3002<\/p>\n<p> \u526f\u672c\u5206\u5e03\u7b56\u7565<br \/>\n CRUSH\u7684\u8bbe\u8ba1\u4f7f\u5f97\u6570\u636e\u5747\u5300\u7684\u5206\u5e03\u5728\u5e26\u6709\u6743\u91cd\u7684device\u4e0a\uff0c\u5728\u7edf\u8ba1\u610f\u4e49\u4e0a\u4fdd\u6301\u4e86device\u548cbandwidth(\u5e26\u5bbd)\u7684\u5747\u8861\uff0c\u526f\u672c\u5728\u6811\u5f62\u7ed3\u6784\u7684\u5b58\u50a8device\u7684\u5206\u5e03\u5f71\u54cd\u7740\u6570\u636e\u7684\u5b89\u5168\u3002\u901a\u8fc7\u5bf9\u4e8e\u7cfb\u7edf\u672c\u8d28\u7684\u7269\u7406\u7ed3\u6784\u7684\u6620\u5c04\uff0cCRUSH\u80fd\u591f\u5efa\u6a21\uff0c\u4ece\u800c\u5b9a\u4f4d\u6f5c\u5728\u7684\u76f8\u5173\u8bbe\u5907\u7684\u6545\u969c\u6e90\u3002\u5178\u578b\u7684\u6545\u969c\u6e90\u5305\u62ec\u7269\u7406\u4f4d\u7f6e\u4e0a\u63a5\u8fd1\u3001\u5171\u4eab\u7535\u6e90\u3001\u5171\u4eab\u7f51\u7edc\u3002\u901a\u7740\u5c06\u8fd9\u4e9b\u4fe1\u606f\u53cd\u6620\u7ed9Cluster Map\u4e2d\uff0cCRUSH placement policies (\u4f4d\u7f6e\u7b56\u7565)\u80fd\u591f\u5c06\u5bf9\u8c61\u526f\u672c\u53d1\u5e03\u5728\u4e0d\u540c\u7684\u533a\u57df\uff08\u6545\u969c\u57df\uff09\u4e2d\uff0c\u540c\u65f6\u7ef4\u6301\u9884\u671f\u7684\u6570\u636e\u5206\u5e03\u5f62\u5f0f\u3002\u4f8b\u5982\uff0c\u4e3a\u4e86\u5e94\u5bf9\u51fa\u73b0\u5e76\u53d1\u6545\u969c\u7684\u53ef\u80fd\u6027\uff0c\u4e5f\u8bb8\u4f1a\u9700\u8981\u786e\u4fdd\u6570\u636e\u526f\u672c\u5728\u4e0d\u540c\u7684\u673a\u67b6\u3001\u673a\u67dc\u3001\u7535\u6e90\u3001CPU\u3001\u4f4d\u7f6e\u7684device\u4e0a\u3002<br \/>\n CRUSH\u53ef\u4ee5\u88ab\u7528\u4e8e\u4e0d\u540c\u7684\u6570\u636e\u526f\u672c\u7b56\u7565\u548c\u4e0d\u540c\u7684\u786c\u4ef6\u914d\u7f6e\u4e0b\uff0c\u4e3a\u4e86\u9002\u5e94\u8fd9\u6837\u7684\u573a\u666f\u9700\u6c42\uff0cCRUSH\u4e3a\u5176\u9002\u5e94\u7684\u6bcf\u4e2a\u526f\u672c\u7b56\u7565\u6216placement policies \u5b9a\u4e49placement Rule.\u4ee5\u4fdd\u8bc1\u7cfb\u7edf\u6216\u7ba1\u7406\u5458\u53ef\u4ee5\u786e\u5207\u7684\u6307\u5b9a\u526f\u672c\u5982\u4f55\u5b9a\u4f4d\u3002<br \/>\n \u6bcf\u6761\u89c4\u5219\u5305\u542b\u7528\u6237\u7b80\u5355\u6267\u884c\u73af\u5883\u7684\u7528\u6237\u6811\u5f62\u7ed3\u6784\u7684\u6307\u4ee4\u5e8f\u5217\uff0c\u8fd9\u4e9b\u64cd\u4f5c\u5305\u62ec\uff1a<br \/>\n tack(a).\u9009\u62e9\u4e00\u4e2aitem\uff08a\uff09,\u4e00\u822c\u662fbucket\uff0c\u5e76\u8fd4\u56debucket\u6240\u5305\u542b\u7684\u6240\u6709item\u3002\u8fd9\u4e9bitem\u662f\u540e\u7eed\u64cd\u4f5c\u7684\u53c2\u6570\uff0c\u8fd9\u4e9bitem\u7ec4\u6210\u5411\u91cfi\uff1b<br \/>\n select(n,t);\u8fed\u4ee3\u64cd\u4f5c\u6bcf\u4e2aitem\uff08\u5411\u91cfi\u4e2d\u7684item),\u5bf9\u4e8e\u6bcf\u4e2aitem\uff08\u5411\u91cfi\u4e2d\u7684item)\u5411\u4e0b\u904d\u5386\uff08\u904d\u5386\u8fd9\u4e2aitem\u6240\u5305\u542b\u7684item\uff09,\u90fd\u8fd4\u56den\u4e2a\u4e0d\u540c\u7684item\uff08type\u4e3at\u7684item),\u5e76\u628a\u8fd9\u4e9bitem\u90fd\u653e\u5230\u5411\u91cfi\u4e2d\u3002<br \/>\n select\u51fd\u6570\u4f1a\u8c03\u7528c(r,x)\u51fd\u6570\uff0c\u8fd9\u4e2a\u51fd\u6570\u4f1a\u5728\u6bcf\u4e2abucket\u4e2d\u4f2a\u968f\u673a\u9009\u62e9\u4e00\u4e2aitem.<br \/>\n emit:\u628a\u5411\u91cfi\u653e\u5230result\u4e2d\u3002<\/p>\n<p> \u5b58\u50a8\u8bbe\u5907\u6709\u4e00\u4e2a\u786e\u5b9a\u7684\u7c7b\u578b\uff0c\u6bcf\u4e2abucket\u90fd\u6709type\u5c5e\u6027\u503c\uff0c\u7528\u4e8e\u533a\u5206\u4e0d\u540c\u7684bucket\u7c7b\u578b\uff0c\u5982\uff08\u201crow\u201d,&#8221;rack&#8221;,&#8221;host&#8221;\u7b49\u3002type\u4e5f\u53ef\u4ee5\u81ea\u5b9a\u4e49\uff09\u3002rules\u53ef\u4ee5\u5305\u542b\u591a\u4e2atack\u548cemit\u8bed\u5757\uff0c\u8fd9\u6837\u5c31\u5141\u8bb8\u4ece\u4e0d\u540c\u7684\u5b58\u50a8\u6c60\u4e2d\u9009\u62e9\u526f\u672c\u7684\u5b58\u50a8\u76ee\u6807\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c42\u6b21\u5316\u7684Cluster Map: Cluster &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[84,83],"tags":[180,98],"_links":{"self":[{"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=\/wp\/v2\/posts\/483"}],"collection":[{"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=483"}],"version-history":[{"count":1,"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=\/wp\/v2\/posts\/483\/revisions"}],"predecessor-version":[{"id":484,"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=\/wp\/v2\/posts\/483\/revisions\/484"}],"wp:attachment":[{"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=483"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}