{"id":479,"date":"2014-03-30T08:10:41","date_gmt":"2014-03-30T08:10:41","guid":{"rendered":"http:\/\/www.selinuxplus.com\/?p=479"},"modified":"2014-03-30T08:16:28","modified_gmt":"2014-03-30T08:16:28","slug":"ceph%e5%ad%a6%e4%b9%a0-7crush%e7%ae%97%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.selinuxplus.com\/?p=479","title":{"rendered":"[ceph\u5b66\u4e60-6]crush\u7b97\u6cd5(1)"},"content":{"rendered":"<p>crush\u7b97\u6cd5\u7c7b\u4f3c\u4e00\u81f4\u6027\u7b97\u6cd5\uff0c\u4e00\u81f4\u6027\u7b97\u6cd5\u4f7f\u7528\u4e86\u4e00\u4e2a\u6563\u5217\u5230\u670d\u52a1\u5668\u5e73\u53f0\u7684\u6563\u5217\u8868\uff0ccrush\u53ef\u4ee5\u5b58\u5728\u5c42\u7ea7\u7ed3\u6784\u7684\u670d\u52a1\u5668\u4e0a\uff08shelves,racks,rows\uff09\uff0c\u5e76\u5141\u8bb8\u7528\u6237\u5236\u5b9a\u3002\u4f8b\u5982\u5c06\u590d\u5236\u5230\u4e0d\u540c\u7684\u8d27\u67b6\u4e0a\u800c\u4e0d\u662f\u4ec5\u5728primary\u4e0a\u3002<\/p>\n<p>crush\uff08Controoled Replication Under Scalable Hashing\uff09\u662f\u4e00\u79cd\u4f2a\u968f\u673a\u6570\u636e\u5206\u5e03\u7b97\u6cd5\uff0c\u5b83\u80fd\u591f\u5728\u5c42\u7ea7\u7ed3\u6784\u7684\u5b58\u50a8\u96c6\u7fa4\u4e2d\u6709\u6548\u7684\u5206\u5e03\u5bf9\u8c61\u7684\u526f\u672c\u3002\u5b83\u7684\u53c2\u6570\u4e3aobject id\u6216object group\u3002id\uff0c\u5e76\u8fd4\u56de\u4e00\u7ec4\u5b58\u50a8\u8bbe\u5907\uff08\u7528\u4e8e\u4fdd\u5b58object\u526f\u672c\uff09\u3002Crush\u9700\u8981cluster map\uff08\u63cf\u8ff0\u5b58\u50a8\u96c6\u7fa4\u7684\u5c42\u7ea7\u7ed3\u6784)\u3001\u548c\u526f\u672c\u5206\u5e03\u7b56\u7565\uff08rule).<br \/>\nCRUSH\u7684\u4f18\u70b9\uff1a\u4efb\u4f55\u7ec4\u4ef6\u90fd\u53ef\u4ee5\u72ec\u7acb\u8ba1\u7b97\u51fa\u6bcf\u4e2aobject\u6240\u5728\u7684\u4f4d\u7f6e\uff08\u53bb\u4e2d\u5fc3\u5316\uff09.\u53ea\u9700\u8981\u5c11\u91cf\u7684\u5143\u6570\u636e\uff08cluster map),\u53ea\u8981\u5f53\u5220\u9664\u6dfb\u52a0\u8bbe\u5907\u65f6\uff0c\u8fd9\u4e9b\u5143\u6570\u636e\u624d\u9700\u8981\u6539\u53d8<\/p>\n<p>crush\u7b97\u6cd5\u662f\u901a\u8fc7\u5bf9\u6bcf\u4e2a\u8bbe\u5907\u7684\u6743\u91cd\u5728\u5b58\u50a8\u8bbe\u5907\u95f4\u5206\u53d1\u6570\u636e\uff0c\u5927\u81f4\u662f\u5747\u5300\u5206\u5e03\u7684\u3002\u6570\u636e\u5206\u53d1\u662f\u6709\u4e00\u4e2a\u5c42\u6b21\u5316\u7684cluster map \u63a7\u5236\u7684\uff0cCluster Map\u63cf\u8ff0\u4e86\u53ef\u7528\u7684\u5b58\u50a8\u8d44\u6e90\uff0c\u7531\u5efa\u7acb\u96c6\u7fa4\u6620\u5c04\u7684\u4e00\u4e9b\u903b\u8f91\u5143\u7d20\u7ec4\u6210\u3002\u4f8b\u5982\uff0c\u67d0\u4e2aCluster Map\u53ef\u80fd\u63cf\u8ff0\u4e86\u4e00\u4e2a\u5927\u578b\u7684\u88c5\u7f6e\uff0c\u5305\u542b\u4e86\u4e00\u6392\u673a\u67dc\uff0c\u6bcf\u4e2a\u673a\u67dc\u6709\u8bb8\u591a\u78c1\u76d8\u67b6\uff0c\u6bcf\u4e2a\u78c1\u76d8\u67b6\u4e0a\u6709\u8bb8\u591a\u5b58\u50a8\u8bbe\u5907\u3002\u6570\u636e\u5206\u914d\u7b56\u7565\u662f\u6709placement Rules\u5b9a\u4e49\u7684\u3002 Placement Rules \u6307\u5b9a\u4e86\u4ece\u53ca\u7fa4\u4f17\u4e2d\u9009\u4e2d\u7684\u526f\u672c\u76ee\u6807\u7684\u6570\u91cf\uff0c\u4ee5\u53ca\u653e\u7f6e\u8fd9\u4e9b\u526f\u672c\u7684\u9650\u5236\u6761\u4ef6\u3002\u4f8b\u5982\uff0c\u67d0\u4e2aPlacement Rule\u4e5f\u8bb8\u4f1a\u6307\u5b9a\u4e09\u4e2a\u955c\u50cf\u526f\u672c\u8981\u88ab\u653e\u7f6e\u5728\u4e0d\u540c\u7684\u7269\u7406\u673a\u67dc\u4e0a\uff0c\u4ee5\u514d\u8fd9\u4e9b\u526f\u672c\u5171\u4eab\u540c\u4e00\u6761\u4f9b\u7535\u7ebf\u8def\u3002<\/p>\n<p>CRUSH\u7b97\u51fax\u5230\u4e00\u7ec4OSD\u96c6\u5408\uff1a<br \/>\n\u7ed9\u51fa\u4e00\u4e2a\u6574\u578b\u8f93\u5165x\uff0cCRUSH\u4f1a\u8f93\u51fa\u4e00\u4e2a\u6709\u5e8f\u7684\u3001\u5305\u542bn\u4e2a\u4e0d\u76f8\u540c\u7684\u5b58\u50a8\u76ee\u6807\u7684R\u5411\u91cf\u3002<\/p>\n<pre class=\"lang:default decode:true \" >\uff08osd0,osd1,...osdn) = CRUSH(x)<\/pre>\n<p>CRUSH\u4f7f\u7528\u4e00\u4e2a\u591a\u53c2\u6570\u7684\u6574\u5f62hash\u51fd\u6570\uff0c\u53c2\u6570\u5217\u8868\u5305\u542bx\uff0c\u4f7f\u5f97\u4ecex\u5230osd\u96c6\u5408\u662f\u5b8c\u5168\u72ec\u7acb\u4e14\u786e\u5b9a\u6027\u7684\uff0c\u4ec5\u4ec5\u4f9d\u8d56Cluster Map\u3001Placement RUles\u548c\u8f93\u5165\u53c2\u6570x\u3002\u6570\u636e\u5206\u53d1\u662f\u4f2a\u968f\u673a\u7684\uff0c\u8f93\u51fa\u7ed3\u679c\u4e0e\u8f93\u5165\u7ed3\u679c\u6216\u8005\u8bbe\u5907\u4e2d\u73b0\u8c61\u6709\u7684\u5bf9\u8c61\u4e4b\u95f4\u6ca1\u6709\u660e\u663e\u7684\u76f8\u5173\u6027\u3002<br \/>\nCRUSH\u63d0\u4f9b\u4e86\u4e00\u4e2a\u53bb\u96c6\u4e2d\u5316\uff08\u96c6\u7fa4\u5316\uff09\u7684\u526f\u672c\u53d1\u5e03\u65b9\u6848\uff0c\u5305\u542b\u67d0\u5bf9\u8c61\u7684\u5171\u4eab\u526f\u672c\u7684\u8fd9\u4e9b\u8bbe\u5907\u4e5f\u662f\u76f8\u5bf9\u5176\u4ed6\u5bf9\u8c61\u4e5f\u662f\u72ec\u7acb\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>crush\u7b97\u6cd5\u7c7b\u4f3c\u4e00\u81f4\u6027\u7b97\u6cd5\uff0c\u4e00\u81f4\u6027\u7b97\u6cd5\u4f7f\u7528\u4e86\u4e00\u4e2a&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,97],"_links":{"self":[{"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=\/wp\/v2\/posts\/479"}],"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=479"}],"version-history":[{"count":3,"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=\/wp\/v2\/posts\/479\/revisions"}],"predecessor-version":[{"id":482,"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=\/wp\/v2\/posts\/479\/revisions\/482"}],"wp:attachment":[{"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=479"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}