{"id":337,"date":"2013-08-13T13:01:46","date_gmt":"2013-08-13T13:01:46","guid":{"rendered":"357a6fdf7642bf815a88822c447d9dc4"},"modified":"2013-08-13T13:01:46","modified_gmt":"2013-08-13T13:01:46","slug":"","status":"publish","type":"post","link":"https:\/\/www.xiaobo.li\/notes\/archives\/337","title":{"rendered":"glusterfs"},"content":{"rendered":"<p>\u4e0b\u8f7d\uff1a<\/p>\n<p><a href=\"http:\/\/download.gluster.org\/pub\/gluster\/glusterfs\/\">http:\/\/download.gluster.org\/pub\/gluster\/glusterfs\/<\/a><\/p>\n<p>&nbsp;<\/p>\n<h3>Fuse\u652f\u6301\u5e93\u5b89\u88c5<br \/>\n\u67e5\u770b\u53d1Fuse\u662f\u5426\u5df2\u7ecf\u5b89\u88c5\uff1a<\/h3>\n<p>\u547d\u4ee4\uff1a<\/p>\n<p>#lsmod | grep \"fuse\"<\/p>\n<p>\u5982\u679c\u663e\u793a\uff1a<\/p>\n<p>fuse&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 66285&nbsp; 4<\/p>\n<p>\u7cfb\u7edf\u5df2\u7ecf\u5b89\u88c5Fuse\uff0c\u8df3\u8fc7\u6b21\u5b89\u88c5\u6b65\u9aa4\uff0c\u8fdb\u5165\u4e0b\u4e2a\u8f6f\u4ef6\u7684\u5b89\u88c5\uff0c\u5426\u5219\u7ee7\u7eed\u4e0b\u9762\u7684\u5b89\u88c5<\/p>\n<p>&nbsp;<\/p>\n<p>\u6587\u4ef6:&nbsp;\"fuse-2.8.4.tar.gz\"<\/p>\n<p>\u89e3\u538b<br \/>\n#tar -xzvf fuse-2.8.4.tar.gz<br \/>\n#cd fuse-2.8.4 (\u8fdb\u5165\u76ee\u5f55\uff0c\u4e0b\u8ff0\u547d\u4ee4\u9700\u8981\u5728\u8be5\u76ee\u5f55\u4e0b\u6267\u884c)<\/p>\n<p>\u5b89\u88c5\u7f16\u8bd1:<br \/>\n#.\/configure --prefix=\/usr (\u8bbe\u5b9a\u5b89\u88c5\u76ee\u5f55)<br \/>\n#make<br \/>\n#make install<\/p>\n<p>\u6302\u8f7dfuse\u5185\u6838\u6a21\u5757<br \/>\n#modprobe fuse (\u5173\u952e)<br \/>\n#lsmod | grep \"fuse\" (\u67e5\u8be2fuse\u5185\u6838\u6a21\u5757\u662f\u5426\u5df2\u6b63\u786e\u6302\u8f7d)<\/p>\n<h3><a name=\"t3\"><\/a>1.1.2 GlusterFs\u5b89\u88c5<\/h3>\n<p>\u68c0\u67e5GlusterFs\u662f\u5426\u5df2\u7ecf\u5b89\u88c5\uff1a<\/p>\n<p>\u547d\u4ee4\uff1agluster \u2013V \u6216 glusterfs -V<\/p>\n<p>\u5982\u679c\u663e\u793a\uff1a<\/p>\n<p>glusterfs 3.2.5 built on Mar&nbsp; 7 2012 16:10:28<\/p>\n<p>Repository revision: git:\/\/git.gluster.com\/glusterfs.git<\/p>\n<p>Copyright (c) 2006-2011 Gluster Inc. &lt;http:\/\/www.gluster.com&gt;<\/p>\n<p>GlusterFS comes with ABSOLUTELY NO WARRANTY.<\/p>\n<p>You may redistribute copies of GlusterFS under the terms of the GNU General Public License.<\/p>\n<p>GlusterFs\u5df2\u7ecf\u5b89\u88c5\uff0c\u8df3\u8fc7\u6b64\u5b89\u88c5\u6b65\u9aa4\uff0c\u5426\u5219\u7ee7\u7eed\u4e0b\u9762\u7684\u5b89\u88c5<\/p>\n<p>&nbsp;<\/p>\n<p>\u6587\u4ef6:&nbsp;\" glusterfs-3.2.5.tar.gz\"<\/p>\n<p>\u89e3\u538b<br \/>\n#tar -xzvf glusterfs-3.2.5.tar.gz<br \/>\n#cd glusterfs-3.2.5 (\u8fdb\u5165\u76ee\u5f55\uff0c\u4e0b\u8ff0\u547d\u4ee4\u9700\u8981\u5728\u8be5\u76ee\u5f55\u4e0b\u6267\u884c)<\/p>\n<p>\u5b89\u88c5\u7f16\u8bd1:<br \/>\n#.\/configure --prefix=\/usr (\u8bbe\u5b9a\u5b89\u88c5\u76ee\u5f55)<br \/>\n#make<br \/>\n#make install<\/p>\n<p>\u67e5\u770b\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n<p>\u547d\u4ee4\uff1agluster \u2013V \u6216&nbsp;glusterfs -V<\/p>\n<p>\u5982\u679c\u663e\u793a\uff1a<\/p>\n<p>glusterfs 3.2.5 built on Mar&nbsp; 7 2012 16:10:28<\/p>\n<p>Repository revision: git:\/\/git.gluster.com\/glusterfs.git<\/p>\n<p>Copyright (c) 2006-2011 Gluster Inc. &lt;http:\/\/www.gluster.com&gt;<\/p>\n<p>GlusterFS comes with ABSOLUTELY NO WARRANTY.<\/p>\n<p>You may redistribute copies of GlusterFS under the terms of the GNU General Public License.<\/p>\n<p>\u5219\u5b89\u88c5\u6210\u529f<\/p>\n<h3><a name=\"t4\"><\/a>1.1.3 \u542f\u52a8glusterd <\/h3>\n<p># \/etc\/init.d\/glusterd start<\/p>\n<p>\u663e\u793a\uff1a<\/p>\n<p>Starting glusterd:[&nbsp; OK&nbsp; ]<\/p>\n<p>\u542f\u52a8\u6210\u529f<\/p>\n<h2><a name=\"t5\"><\/a><a name=\"_Toc291509284\">1.2<\/a>\u914d\u7f6e\u5377<\/h2>\n<h3><a name=\"t6\"><\/a><a name=\"_Toc291509285\">1.2.<\/a>1 \u524d\u671f\u51c6\u5907<\/h3>\n<p>\u9996\u5148\uff0c\u4f9d\u6b21\u767b\u9646\u5404\u4e2a\u670d\u52a1\u5668\u542f\u52a8glusterd\uff1b\u5e76\u5c06\u6bcf\u4e2a\u670d\u52a1\u5668\u5bf9\u5e94\u7684\u591a\u4e2aip\u4fe1\u606f\uff0c\u6dfb\u52a0\u5230\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u4ee5d182\u670d\u52a1\u5668\u4e3a\u4f8b\uff1a(\u5047\u8bbe\u96c6\u7fa4\u662f\u7531\u56db\u4e2a\u670d\u52a1\u5668\u8282\u70b9\u6784\u6210)<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u767b\u9646d182\u670d\u52a1\u5668<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vi \/etc\/hosts<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u628a\u5982\u4e0b\u4fe1\u606f\u5199\u5165hosts \u6587\u4ef6<\/p>\n<p>192.168.1.182 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;d182<\/p>\n<p>192.168.1.172 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d182&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/p>\n<p>192.168.1.162&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d182<\/p>\n<p>192.168.1.183 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d183<\/p>\n<p>192.168.1.173 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d183&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/p>\n<p>192.168.1.163&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d183<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp; 192.168.1.184 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;d184<\/p>\n<p>192.168.1.174 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d184&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/p>\n<p>192.168.1.164&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;d184<\/p>\n<p>192.168.1.185&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d185<\/p>\n<p>192.168.1.175 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;d185&nbsp;&nbsp;&nbsp; <\/p>\n<p>192.168.1.165&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d185<\/p>\n<p>\u5728\u670d\u52a1\u5668d183\u3001d184\u3001d185\u4e0a\u90fd\u6dfb\u52a0\u4e0a\u8bc9\u4fe1\u606f\u3002\uff08\u4e0a\u9762\u7684\u4f8b\u5b50\u662f\u6bcf\u4e2a\u670d\u52a1\u5668\u5bf9\u5e943\u4e2aip\uff0c\u51714\u4e2a\u670d\u52a1\u5668\uff0c\u603b\u8ba112\u6761\u8bb0\u5f55\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>\u521b\u5efaGlusterFS\u96c6\u7fa4\uff1a<\/p>\n<p>$ gluster peer probe SERVER<\/p>\n<p>SERVER\u8868\u793a\u5b58\u50a8\u670d\u52a1\u5668\u7684hostname\u3002\u4f8b\u5982\u8981\u521b\u5efa\u5305\u542b\u56db\u53f0\u670d\u52a1\u5668\u7684GlusterFS\u96c6\u7fa4\u4f7f\u7528\u547d\u4ee4\u5982\u4e0b\uff1a\uff08\u5728d182&nbsp;\u670d\u52a1\u5668\u4e0a\u8f93\u5165\uff09<\/p>\n<p># gluster peer probe d183<\/p>\n<p># gluster peer probe d184<\/p>\n<p># gluster peer probe d185<\/p>\n<p>&nbsp; <strong>\u6ce8\u610f<\/strong>\uff1a\u5728\u6784\u5efaGlusterFS\u96c6\u7fa4\u65f6\uff0c\u9700\u8981\u5728\u5176\u4e2d\u4efb\u610f\u4e00\u53f0\u5b58\u50a8\u670d\u52a1\u5668\u4e0a\u4f9d\u6b21\u5c06\u5176\u4ed6\u5b58\u50a8\u670d\u52a1\u5668\u6dfb\u52a0\u5230\u96c6\u7fa4\u4e2d\u3002<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u6dfb\u52a0\u5b8c\u96c6\u7fa4\u4e4b\u540e\uff0c\u767b\u9646\u96c6\u7fa4\u4e2d\u7684\u5176\u4ed6\u670d\u52a1\u5668,\u4f8b:\u4eced182\u767b\u9646d183<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u67e5\u770b\u96c6\u7fa4\u4fe1\u606f\u6307\u4ee4\uff1a<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gluster peer status <\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u663e\u793a\u4fe1\u606f\u5982\u4e0b\uff1a<\/p>\n<p>Number of Peers: 3<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hostname: 192.168.1.182<\/p>\n<p>Uuid: f97d4478-9374-41b9-b296-fb9840ff1a42<\/p>\n<p>State: Peer in Cluster (Connected)<\/p>\n<p>&nbsp;<\/p>\n<p>Hostname: d184<\/p>\n<p>Uuid: 503d8c85-03c5-40be-8bbe-f19419f3d985<\/p>\n<p>State: Peer in Cluster (Connected)<\/p>\n<p>&nbsp;<\/p>\n<p>Hostname: d185<\/p>\n<p>Uuid: 3697827c-23e5-4238-9f8c-10c1a920bcdb<\/p>\n<p>State: Peer in Cluster (Connected)<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u663e\u793a\u7ea2\u8272\u5b57\u4f53\u201dConnected\u201d,\u4e3a\u96c6\u7fa4\u8282\u70b9\u6dfb\u52a0\u6210\u529f\uff0c\u4f46\u5176\u4e2dd182\u662f\u4ee5192.168.1.182\u8fd9\u4e2aip\u52a0\u5165\u96c6\u7fa4\u7684\uff0c\u9700\u8981\u6362\u6210hostname<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u767b\u9646\u96c6\u7fa4\u4e2d\u7684\u96c6\u7fa4\u4e2d\u7684\u53e6\u4e00\u4e2a\u8282\u70b9\uff1a<\/p>\n<p>\u4f8b\uff1a\u767b\u9646d183\u670d\u52a1\u5668<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u6267\u884c\u6307\u4ee4\uff1a<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gluster peer detach 192.168.1.182<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gluster peer probe d182<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u96c6\u7fa4\u8282\u70b9\u6dfb\u52a0\u5b8c\u6bd5<\/p>\n<h3><a name=\"t7\"><\/a><a name=\"_Toc291509287\">1.2.2<\/a>\u521b\u5efa\u903b\u8f91\u5377 <\/h3>\n<p>\u6307\u4ee4\uff1agluster volume create test-volume replica 2 transport &nbsp;tcp server1:\/exp1<\/p>\n<p>server2:\/exp2 server3:\/exp3 server4:\/exp4<\/p>\n<p>test-volume:\u521b\u5efa\u7684\u903b\u8f91\u5377\u7684\u540d\u5b57<\/p>\n<p>replica 2\uff1a \u5197\u4f59\u6570<\/p>\n<p>server1: \u670d\u52a1\u5668\u540d<\/p>\n<p>exp1\uff1a brick\u7684\u8def\u5f84<\/p>\n<p><strong>\u67e5\u770bvolume \u4fe1\u606f\uff1a<\/strong># gluster volume info<\/p>\n<p>&nbsp;<\/p>\n<h2><a name=\"t8\"><\/a>1.3\u542f\u52a8\u5377<\/h2>\n<p><strong>\u542f\u52a8\u5377\u547d\u4ee4\uff1a<\/strong><\/p>\n<p># gluster volume start v8 <\/p>\n<p>&nbsp;&nbsp;&nbsp; V8\u4e3a\u521b\u5efa\u7684\u903b\u8f91\u5377\u7684\u540d\u5b57\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><a name=\"t9\"><\/a><a name=\"_Toc291509292\">1.4 <\/a>\u6302\u8f7d\u5377<\/h2>\n<p><strong>\u5ba2\u6237\u7aef\u6302\u8f7d\u5b58\u50a8\u670d\u52a1\u5668\u5377\u4f7f\u7528\uff1a<\/strong><\/p>\n<p>\u5982\u679c\u672c\u673a\u5728\u8282\u70b9\u7fa4\u91cc\u9762\uff0c\u90a3\u5c31\u4f7f\u7528\u672c\u673a\u7684\u670d\u52a1\uff0c\u5982 127.0.0.1:\/test-vol\uff0c\u5982\u679c\u672c\u673a\u4e0d\u5728\u96c6\u7fa4\u8282\u70b9\u91cc\u9762\uff0c\u5c31\u5f97\u4f7f\u7528\u4efb\u4f55\u4e00\u4e2a\u8282\u70b9\u670d\u52a1\u5668\u7684\u670d\u52a1\u3002<\/p>\n<p>\u5982\uff1a localhost:\/v8<\/p>\n<p>mount -t glusterfs d182:\/v8 \/usr\/local\/movies<\/p>\n<p>d182\u8868\u793a\u4e3bhost name<\/p>\n<p>V8\u8868\u793a\u5377\u540d<\/p>\n<p>\/usr\/local\/movies\u8868\u793a\u5ba2\u6237\u7aef\u6302\u8f7d\u70b9<\/p>\n<p><strong>\u9a8c\u8bc1mount\u662f\u5426\u6210\u529f\uff1a<\/strong><\/p>\n<p>&nbsp;$ df \u2013h<\/p>\n<p>Filesystem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Size&nbsp; Used Avail Use% Mounted on<\/p>\n<p>\/dev\/sda3&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;128G&nbsp;&nbsp; 33G&nbsp;&nbsp; 89G&nbsp; 28% \/<\/p>\n<p>\/dev\/sda1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.9G&nbsp;&nbsp; 42M&nbsp; 1.8G&nbsp;&nbsp; 3% \/boot<\/p>\n<p>tmpfs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.0G&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp; 2.0G&nbsp;&nbsp; 0% \/dev\/shm<\/p>\n<p>glusterfs#182:\/v8<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 551G&nbsp; 1.4G&nbsp; 521G&nbsp;&nbsp; 1% \/usr\/local\/movies<\/p>\n<p>\u51fa\u73b0\u7ea2\u8272\u5b57\u4f53\u90e8\u5206\u8868\u793a\u5df2\u7ecf\u6302\u8f7d\u4e0a\u5b58\u50a8\u670d\u52a1\u5668\u3002<\/p>\n<p><strong><span style=\"color:#ff0000;\">\u8282\u70b9\u6545\u969c\u5904\u7406<\/span><\/strong>\n<\/p>\n<p>&nbsp;\u5982\u679c\u4e00\u53f0\u8282\u70b9\u670d\u52a1\u5668down\u673a\uff0c\u8fd9\u4e2a\u65f6\u5019\uff0c\u6211\u4eec\u8981\u6062\u590d\u6545\u969c\uff0c\u66ff\u6362volume\u4e2d\u574f\u6389\u7684brick\u4e3a\u65b0\u7684brick\uff0c\u53c2\u8003\u5982\u4e0b\u64cd\u4f5c\uff1a<\/p>\n<p>&nbsp;#prob server<br \/>\n&nbsp;gluster peer probe [new-server]<br \/>\n&nbsp;#replace old to new brick<br \/>\n&nbsp;gluster volume replace-brick vol-name [old-server]:\/[old-brick]&nbsp; [new-server]:\/[new-brick]&nbsp; start<br \/>\n&nbsp;#\u68c0\u67e5\u540c\u6b65\u7684\u72b6\u6001<br \/>\n&nbsp;gluster volume replace-brick vol-name [old-server]:\/[old-brick]&nbsp; [new-server]:\/[new-brick]&nbsp; status<br \/>\n&nbsp;#\u7b49\u5f85\u540c\u6b65\u5b8c\u6210\u4e4b\u540e \u63d0\u4ea4<br \/>\n&nbsp;gluster volume replace-brick vol-name [old-server]:\/[old-brick]&nbsp; [new-server]:\/[new-brick]&nbsp; commit force<br \/>\n\u53ea\u9700\u5728\u4e00\u53f0\u8282\u70b9\u4e0a\u64cd\u4f5c\uff0c\u6240\u6709\u7684\u670d\u52a1\u5668\u4e0a\u8be5\u5377\u7684brick\u90fd\u6362\u6210\u65b0\u7684brick\u4e86\n<\/p>\n<p>---------------------------------------------------------------------------------<\/p>\n<h2 class=\"title content-title\">GlusterFS\u5206\u5e03\u5f0f\u96c6\u7fa4\u6587\u4ef6\u7cfb\u7edf\u5b89\u88c5\u3001\u914d\u7f6e\u53ca\u6027\u80fd\u6d4b\u8bd5<\/h2>\n<div id=\"content\" class=\"content mod-cs-content text-content clearfix\">\u524d\u51e0\u5929\u548c\u5929\u6daf\u7684\u5218\u5929\u65af\u5728\u8ba8\u8bba\u5206\u5e03\u5f0f\u6587\u4ef6\u7cfb\u7edf\uff0c\u624d\u60f3\u8d77\u7535\u8111\u5185\u8fd8\u6709\u4e00\u7bc7\u4e00\u5e74\u524d\u5199\u7684\u6587\u6863\uff0c\u73b0\u5728\u5e16\u5728\u8fd9\u91cc\uff0c\u7ed9\u6709\u9700\u8981\u7684\u670b\u53cb\u770b\u770b\uff0c\u56e0\u4e3a\u5f53\u65f6\u662f\u7528word\u5199\u7684\uff0c\u5e16\u5728\u8fd9\u8fb9\u6392\u7248\u4e0d\u662f\u5f88\u597d\u3002\u5927\u5bb6\u51d1\u5408\u7740\u770b\u5427\u3002<strong><\/p>\n<p>1.&nbsp;&nbsp;&nbsp; \u7248\u672c\u5386\u53f2<\/strong><\/p>\n<p>Revision&nbsp;&nbsp;&nbsp; Author(s)&nbsp;&nbsp;&nbsp; Date&nbsp;&nbsp;&nbsp; Summary of activity<br \/>\n1.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u7f57\u8f89&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2009-6-1&nbsp;&nbsp;&nbsp; \u521b\u5efa\u672c\u6587\u6863<\/p>\n<p><strong>2.&nbsp;&nbsp;&nbsp; \u53c2\u8003\u6587\u6863<\/strong><\/p>\n<p>[1] <a href=\"http:\/\/www.gluster.org\/\" target=\"_blank\">http:\/\/ www.gluster.org<\/a><br \/>\n[2] <a href=\"http:\/\/wenzizone.cn\/?p=8\" target=\"_blank\">http:\/\/wenzizone.cn\/?p=8<\/a><\/p>\n<p><strong>3.&nbsp;&nbsp;&nbsp; \u524d\u8a00<\/strong><\/p>\n<p>Glusterfs\u662f\u4e00\u4e2a\u5177\u6709\u53ef\u4ee5\u6269\u5c55\u5230\u51e0\u4e2aPB\u6570\u91cf\u7ea7\u7684\u5206\u5e03\u5f0f\u96c6\u7fa4\u6587\u4ef6\u7cfb\u7edf\u3002\u5b83\u53ef\u4ee5\u628a\u591a\u4e2a\u4e0d\u540c\u7c7b\u578b\u7684\u5b58\u50a8\u5757\u901a\u8fc7Infiniband RDMA\u6216\u8005TCP\/IP\u6c47\u805a\u6210\u4e00\u4e2a\u5927\u7684\u5e76\u884c\u7f51\u7edc\u6587\u4ef6\u7cfb\u7edf\u3002<br \/>\n\u8003\u8651\u5230\u516c\u53f8\u56fe\u7247\u670d\u52a1\u5668\u540e\u671f\u7684\u5347\u7ea7\uff0c\u6211\u4eec\u5bf9Glusterfs\u8fdb\u884c\u4e86\u6bd4\u8f83\u8be6\u7ec6\u7684\u6280\u672f\u6d4b\u8bd5\u3002<\/p>\n<p><strong>4.&nbsp;&nbsp;&nbsp; \u6d4b\u8bd5\u73af\u5883<\/strong><\/p>\n<p>\u6211\u4eec\u91c7\u7528\u516b\u53f0\u8001\u7684\u81f3\u5f3a\u670d\u52a1\u5668\u7ec4\u6210\u4e86\u6d4b\u8bd5\u73af\u5883\uff0c\u914d\u7f6e\u4e3a\u5185\u5b581-2G\u4e0d\u7b49\uff0c\u6bcf\u53f0\u6709\u4e24\u5757\u4ee5\u4e0a\u768473G SCSI\u786c\u76d8\u3002<br \/>\n\u540c\u65f6\u6bcf\u670d\u52a1\u5668\u914d\u6709\u4e24\u5757\u7f51\u5361\uff0c\u8fde\u63a5\u81f3\u4e24\u4e2a100M\u4ee5\u592a\u7f51\u4ea4\u6362\u673a\u4e0a\u3002192.168.1.x\u6bb5\u8fde\u63a5\u7684\u662fcisco 2950\uff0c\u53e6\u4e00\u4e2a\u6bb5\u662f\u4e00\u4e2ad-link\u4ea4\u6362\u673a\uff0c\u670d\u52a1\u5668\u95f4\u7684\u4f20\u8f93\u4e3b\u8981\u662f\u901a\u8fc7cisco 2950\uff0c\u4ee5\u4fdd\u8bc1\u7f51\u7edc\u7684\u7a33\u5b9a\u6027\u3002<\/p>\n<p>IP\u5730\u5740\u5206\u522b\u4e3a:192.168.1.11~192.168.1.18 \u53ca 192.168.190.11~192.168.190~18\u3002<\/p>\n<p>\u6240\u6709\u670d\u52a1\u5668\u7684\u64cd\u4f5c\u7cfb\u7edf\u90fd\u662fCentos linux 5.3\uff0c\u5b89\u88c5DAG RPM Repository\u7684\u66f4\u65b0\u5305\u3002DAG RPM Repository\u4e0b\u8f7d\u9875\u9762\u4e3a\uff1ahttp:\/\/dag.wieers.com\/rpm\/packages\/rpmforge-release\/\u3002<br \/>\n\u5b89\u88c5\u65b9\u5f0f\uff1a<\/p>\n<p># wget http:\/\/dag.wieers.com\/rpm\/packages\/rpmforge-release\/rpmforge-release-0.3.6-1.el5.rf.i386.rpm<br \/>\n# rpm \u2013ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm<\/p>\n<p><strong>5.&nbsp;&nbsp;&nbsp; GlusterFS\u7684\u5b89\u88c5<\/strong><\/p>\n<p><strong>5.1.&nbsp;&nbsp;&nbsp; \u670d\u52a1\u5668\u7aef\u5b89\u88c5<\/strong><\/p>\n<p>\u6211\u4eec\u901a\u8fc7rpm\u7f16\u8bd1\u65b9\u5f0f\u6765\u5b89\u88c5GlusterFS\uff0c\u56e0\u4e3a\u505a\u4e3a\u7fa4\u96c6\u6587\u4ef6\u7cfb\u7edf\uff0c\u53ef\u80fd\u9700\u8981\u5728\u81f3\u5c1110\u53f0\u4ee5\u4e0a\u7684\u670d\u52a1\u5668\u4e0a\u5b89\u88c5GlusterFS\u3002\u6bcf\u53f0\u53bb\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5\u592a\u8d39\u529f\u592b\uff0c\u7f3a\u4e4f\u6548\u7387\u3002\u5728\u4e00\u53f0\u7f16\u8bd1\u4e3arpm\u5305\uff0c\u518d\u590d\u5236\u5230\u5176\u5b83\u7684\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u662f\u6700\u597d\u7684\u9009\u62e9\u3002<\/p>\n<p>GlusterFS\u9700\u8981fuse\u652f\u6301\u5e93\uff0c\u9700\u5148\u5b89\u88c5:<br \/>\n# yum -y install fuse fuse-devel httpd-devel libibverbs-devel<\/p>\n<p>\u4e0b\u8f7dGlusterFS\u6e90\u7801\u7f16\u8bd1rpm\u5305\u3002<br \/>\n# wget http:\/\/ftp.gluster.com\/pub\/gluster\/glusterfs\/2.0\/LATEST\/glusterfs-2.0.0.tar.gz<br \/>\n# tar -xvzf glusterfs-2.0.0.tar.gz<br \/>\n# cp glusterfs-2.0.0.tar.gz \/usr\/src\/redhat\/SOURCES\/<br \/>\n# rpmbuild -bb glusterfs-2.0.0\/glusterfs.spec<br \/>\n# cp \/usr\/src\/redhat\/RPMS\/i386\/glusterfs* .<br \/>\n# rm glusterfs-debuginfo-2.0.0-1.i386.rpm<br \/>\n# rpm -ivh glusterfs-*.rpm<br \/>\n\u5b89\u88c5\u5b8c\u6210\uff0c\u5e76\u628a\u7f16\u8bd1\u597d\u7684rpm\u5305\u590d\u5236\u5230\u5176\u5b83\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u3002<\/p>\n<p><strong>5.2.&nbsp;&nbsp;&nbsp; \u5ba2\u6237\u7aef\u5b89\u88c5<\/strong><\/p>\n<p>\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u6709\u4e00\u70b9\u70b9\u4e0d\u540c\uff0c\u7279\u522b\u9700\u8981\u6ce8\u610f\u7684\u662f\u5728\u5ba2\u6237\u7aef\u8fd9\u8fb9\uff0c\u4e0d\u4f46\u9700\u8981fuse\u5e93\uff0c\u5e76\u4e14\u9700\u8981\u4e00\u4e2afuse\u5185\u6838\u6a21\u5757\u3002\u597d\u5728DAG RPM Repository\u5185\u5df2\u6709\u7528DKMS\u65b9\u5f0f\u7f16\u8bd1\u597d\u7684\u5185\u6838\u6a21\u5757\u5305\uff0c\u6211\u4eec\u76f4\u63a5\u5b89\u88c5\u4fbf\u53ef\u3002<br \/>\nDKMS(Dynamic Kernel Module Support)\u662fdell\u53d1\u8d77\u7684\u4e00\u4e2a\u9879\u76ee\uff0c\u76ee\u7684\u662f\u5e0c\u671b\u80fd\u5728\u4e0d\u7f16\u8bd1\u5185\u6838\u7684\u60c5\u51b5\u4e0b\uff0c\u52a8\u6001\u7684\u66f4\u65b0\u5185\u6838\u6a21\u5757\uff0c\u6700\u91cd\u8981\u7684\u662f\uff0c\u901a\u8fc7DKMS\u65b9\u5f0f\u7f16\u8bd1\u7684\u5185\u6838\u6a21\u5757\uff0c\u7531\u4e8e\u662f\u7531DKMS\u7ba1\u7406\u7684\uff0c\u5728\u5185\u6838\u5347\u7ea7\u540e\uff0c\u65e0\u9700\u91cd\u65b0\u7f16\u8bd1\uff0c\u4ecd\u65e7\u53ef\u7528\u3002\u8fd9\u79cd\u65b9\u5f0f\u53ef\u5927\u5927\u65b9\u4fbf\u4ee5\u540e\u7684\u5185\u6838\u66f4\u65b0\u3002<br \/>\nGlusterFS\u53ef\u76f4\u63a5\u7528\u4e0a\u9762rpm\u7f16\u8bd1\u540e\u7684\u5305\u5b89\u88c5:<\/p>\n<p># yum -y install dkms dkms-fuse fuse fuse-devel httpd-devel libibverbs-devel<br \/>\n# rpm -ivh glusterfs-*.rpm<\/p>\n<p><strong>6.&nbsp;&nbsp;&nbsp; GlusterFS\u7684\u5178\u578b\u67b6\u6784\u56fe<\/strong><\/p>\n<p><strong>7.&nbsp;&nbsp;&nbsp; GlusterFS\u5e38\u7528translators(\u4e2d\u7ee7)<\/p>\n<p>7.1.1.&nbsp;&nbsp;&nbsp; storage\/posix <\/strong><\/p>\n<p>type storage\/posix<br \/>\nstorage\/posix\u7684\u4f5c\u7528\u662f\u6307\u5b9a\u4e00\u4e2a\u672c\u5730\u76ee\u5f55\u7ed9GlusterFS\u5185\u7684\u4e00\u4e2a\u5377\u4f7f\u7528\u3002<br \/>\n\u914d\u7f6e\u4f8b\u5b50\uff1a<br \/>\nvolume posix-example<br \/>\ntype storage\/posix<br \/>\noption directory \/sda4<br \/>\nend-volume<\/p>\n<p><strong>7.1.2.&nbsp;&nbsp;&nbsp; protocol\/server (\u670d\u52a1\u5668)<\/strong><\/p>\n<p>type protocol\/server<br \/>\n\u670d\u52a1\u5668\u4e2d\u7ee7(protocol\/server\uff09\u8868\u793a\u672c\u8282\u70b9\u5728GlusterFS\u4e2d\u4e3a\u670d\u52a1\u5668\u6a21\u5f0f\u3002<br \/>\n\u914d\u7f6e\u4f8b\u5b50\uff1a<br \/>\nvolume server-example<br \/>\ntype protocol\/server<br \/>\noption transport-type tcp<br \/>\nsubvolumes brick&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #\u5b9a\u4e49\u597d\u7684\u5377<br \/>\noption auth.addr.brick.allow *&nbsp; #\u6307\u5b9a\u53ef\u8bbf\u95ee\u672c\u5377\u7684\u8bbf\u95ee\u8005,*\u4e3a\u6240\u6709\uff0c\u53ef\u5bf9\u8bbf\u95ee\u8005\u505a\u9650\u5236\uff0c\u5982192.168.1.*<br \/>\nend-volume<\/p>\n<p><strong>7.1.3.&nbsp;&nbsp;&nbsp; protocol\/client (\u5ba2\u6237\u7aef)<\/strong><\/p>\n<p>type protocol\/client<br \/>\n\u5ba2\u6237\u7aef\u4e2d\u7ee7(protocol\/server\uff09\u7528\u4e8e\u5ba2\u6237\u7aef\u8fde\u63a5\u670d\u52a1\u5668\u65f6\u4f7f\u7528\u3002<br \/>\n\u914d\u7f6e\u4f8b\u5b50\uff1a<br \/>\nvolume client-example<br \/>\ntype protocol\/client<br \/>\noption transport-type tcp<br \/>\noption remote-host 192.168.1.13&nbsp;&nbsp;&nbsp; #\u8fde\u63a5\u7684\u670d\u52a1\u5668<br \/>\noption remote-subvolume brick&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #\u8fde\u63a5\u7684\u670d\u52a1\u5668\u5377\u540d<br \/>\nend-volume<\/p>\n<p><strong>7.1.4.&nbsp;&nbsp;&nbsp; cluster\/replicate(\u590d\u5236)<\/strong><\/p>\n<p>type cluster\/replicate<br \/>\n\u590d\u5236\u4e2d\u7ee7(cluster\/replicate\uff0c\u524d\u8eab\u662fAFR\uff09\u4e3aGlusterFS\u63d0\u4f9b\u4e86\u7c7b\u4f3cRAID-1\u7684\u529f\u80fd\u3002<br \/>\nReplicate\u4f1a\u590d\u5236\u6587\u4ef6\u6216\u8005\u6587\u4ef6\u5939\u5230\u5404\u4e2asubvolumes\u91cc\u3002\u5982\u4e00\u4e2a\u5377(volume)\u5185\u6709\u4e24\u4e2a\u5b50\u5377(subvolume)\uff0c\u90a3\u5c31\u4f1a\u6709\u4e24\u4efd\u6587\u4ef6\u6216\u6587\u4ef6\u5939\u7684\u590d\u672c\u3002<br \/>\nReplicate\u53ea\u65f6\u8fd8\u6709\u9ad8\u53ef\u7528\u7684\u529f\u80fd\uff0c\u5982\u679c\u4e24\u4e2a\u5b50\u5377\u4e2d\u6709\u4e00\u4e2a\u5b50\u5377\u6302\u4e86\uff0c\u5377\u4f9d\u7136\u53ef\u4ee5\u6b63\u5e38\u5de5\u4f5c\u3002\u5f53\u8fd9\u4e2a\u5b50\u5377\u91cd\u65b0\u542f\u7528\u65f6\uff0c\u4f1a\u81ea\u52a8\u66f4\u65b0\u4e22\u5931\u7684\u6587\u4ef6\u6216\u6587\u4ef6\u5939\uff0c\u4e0d\u8fc7\u66f4\u65b0\u662f\u901a\u8fc7\u5ba2\u6237\u7aef\u8fdb\u884c\u7684\u3002<br \/>\n\u914d\u7f6e\u4f8b\u5b50\uff1a<br \/>\nvolume replicate-example<br \/>\ntype cluster\/replicate<br \/>\nsubvolumes brick3 brick4<br \/>\nend-volume<\/p>\n<p><strong>7.1.5.&nbsp;&nbsp;&nbsp; cluster\/distribute (\u5206\u5e03\u5f0f)<\/strong><\/p>\n<p>type cluster\/distribute<br \/>\n\u5206\u5e03\u5f0f\u4e2d\u7ee7(cluster\/distribute\uff0c\u524d\u8eab\u662funify\uff09\u4e3aGlusterFS\u63d0\u4f9b\u4e86\u7c7b\u4f3cRAID-0\u7684\u529f\u80fd\u3002<br \/>\nDistribute\u53ef\u628a\u4e24\u4e2a\u5377\u6216\u5b50\u5377\u7ec4\u6210\u4e00\u4e2a\u5927\u5377\uff0c\u5b9e\u73b0\u591a\u5b58\u50a8\u7a7a\u95f4\u7684\u805a\u5408<br \/>\n\u914d\u7f6e\u4f8b\u5b50\uff1a<br \/>\nvolume distribute-example<br \/>\ntype cluster\/distribute<br \/>\nsubvolumes repl1 repl2<br \/>\nend-volume<\/p>\n<p><strong>7.1.6.&nbsp;&nbsp;&nbsp; features\/locks (\u9501)<\/strong><\/p>\n<p>type features\/locks<br \/>\n\u9501\u4e2d\u7ee7(features\/locks\uff09\u53ea\u80fd\u7528\u4e8e\u670d\u52a1\u5668\u7aef\u7684posix\u4e2d\u7ee7\u4e4b\u4e0a\uff0c\u8868\u793a\u7ed9\u8fd9\u4e2a\u5377\u63d0\u4f9b\u52a0\u9501(fcntl locking)\u7684\u529f\u80fd\u3002<br \/>\n\u914d\u7f6e\u4f8b\u5b50\uff1a<br \/>\nvolume locks-example<br \/>\ntype features\/locks<br \/>\nsubvolumes posix-example<br \/>\nend-volume<\/p>\n<p><strong>7.1.7.&nbsp;&nbsp;&nbsp; performance\/read-ahead (\u9884\u8bfb)<\/strong><\/p>\n<p>type performance\/read-ahead<br \/>\n\u9884\u8bfb\u4e2d\u7ee7(performance\/read-ahead\uff09\u5c5e\u4e8e\u6027\u80fd\u8c03\u6574\u4e2d\u7ee7\u7684\u4e00\u79cd\uff0c\u7528\u9884\u8bfb\u7684\u65b9\u5f0f\u63d0\u9ad8\u8bfb\u53d6\u7684\u6027\u80fd\u3002<br \/>\n\u8bfb\u53d6\u64cd\u4f5c\u524d\u5c31\u9884\u5148\u6293\u53d6\u6570\u636e\u3002\u8fd9\u4e2a\u6709\u5229\u4e8e\u5e94\u7528\u9891\u7e41\u6301\u7eed\u6027\u7684\u8bbf\u95ee\u6587\u4ef6\uff0c\u5f53\u5e94\u7528\u5b8c\u6210\u5f53\u524d\u6570\u636e\u5757\u8bfb\u53d6\u7684\u65f6\u5019\uff0c\u4e0b\u4e00\u4e2a\u6570\u636e\u5757\u5c31\u5df2\u7ecf\u51c6\u5907\u597d\u4e86\u3002 <br \/>\n\u989d\u5916\u7684\uff0c\u9884\u8bfb\u4e2d\u7ee7\u4e5f\u53ef\u4ee5\u626e\u6f14\u8bfb\u805a\u5408\u5668\uff0c\u8bb8\u591a\u5c0f\u7684\u8bfb\u64cd\u4f5c\u88ab\u7ed1\u5b9a\u8d77\u6765\uff0c\u5f53\u6210\u4e00\u4e2a\u5927\u7684\u8bfb\u8bf7\u6c42\u53d1\u9001\u7ed9\u670d\u52a1\u5668\u3002 <br \/>\n\u9884\u8bfb\u5904\u7406\u6709page-size\u548cpage-count\u6765\u5b9a\u4e49\uff0cpage-size\u5b9a\u4e49\u4e86\uff0c\u4e00\u6b21\u9884\u8bfb\u53d6\u7684\u6570\u636e\u5757\u5927\u5c0f\uff0cpage-count\u5b9a\u4e49\u7684\u662f\u88ab\u9884\u8bfb\u53d6\u7684\u5757\u7684\u6570\u91cf<br \/>\n\u4e0d\u8fc7\u5b98\u65b9\u7f51\u7ad9\u4e0a\u8bf4\u8fd9\u4e2a\u4e2d\u7ee7\u5728\u4ee5\u592a\u7f51\u4e0a\u6ca1\u6709\u5fc5\u8981\uff0c\u4e00\u822c\u90fd\u80fd\u8dd1\u6ee1\u5e26\u5bbd\u3002\u4e3b\u8981\u662f\u5728IB-verbs\u621610G\u7684\u4ee5\u592a\u7f51\u4e0a\u7528\u3002<br \/>\n\u914d\u7f6e\u4f8b\u5b50\uff1a<br \/>\nvolume readahead-example<br \/>\ntype performance\/read-ahead<br \/>\noption page-size&nbsp; 256&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # \u6bcf\u6b21\u9884\u8bfb\u53d6\u7684\u6570\u636e\u5757\u5927\u5c0f<br \/>\noption page-count 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # \u6bcf\u6b21\u9884\u8bfb\u53d6\u6570\u636e\u5757\u7684\u6570\u91cf<br \/>\noption force-atime-update off #\u662f\u5426\u5f3a\u5236\u5728\u6bcf\u6b21\u8bfb\u64cd\u4f5c\u65f6\u66f4\u65b0\u6587\u4ef6\u7684\u8bbf\u95ee\u65f6\u95f4\uff0c\u4e0d\u8bbe\u7f6e\u8fd9\u4e2a\uff0c\u8bbf\u95ee\u65f6\u95f4\u5c06\u6709\u4e9b\u4e0d\u7cbe\u786e\uff0c\u8fd9\u4e2a\u5c06\u5f71\u54cd\u9884\u8bfb\u8f6c\u6362\u5668\u8bfb\u53d6\u6570\u636e\u65f6\u7684\u90a3\u4e00\u65f6\u523b\u800c\u4e0d\u662f\u5e94\u7528\u771f\u5b9e\u8bfb\u5230\u6570\u636e\u7684\u90a3\u4e00\u65f6\u523b\u3002<br \/>\nsubvolumes &lt;x&gt;<br \/>\nend-volume<\/p>\n<p><strong>7.1.8.&nbsp;&nbsp;&nbsp; performance\/write-behind (\u56de\u5199)<\/strong><\/p>\n<p>type performance\/write-behind<br \/>\n\u56de\u5199\u4e2d\u7ee7(performance\/read-ahead\uff09\u5c5e\u4e8e\u6027\u80fd\u8c03\u6574\u4e2d\u7ee7\u7684\u4e00\u79cd\uff0c\u4f5c\u7528\u662f\u5728\u5199\u6570\u636e\u65f6\uff0c\u5148\u5199\u5165\u7f13\u5b58\u5185\uff0c\u518d\u5199\u5165\u786c\u76d8\u3002\u4ee5\u63d0\u9ad8\u5199\u5165\u7684\u6027\u80fd\u3002<br \/>\n\u56de\u5199\u4e2d\u7ee7\u6539\u5584\u4e86\u4e86\u5199\u64cd\u4f5c\u7684\u5ef6\u65f6\u3002\u5b83\u4f1a\u5148\u628a\u5199\u64cd\u4f5c\u53d1\u9001\u5230\u540e\u7aef\u5b58\u50a8\uff0c\u540c\u65f6\u8fd4\u56de\u7ed9\u5e94\u7528\u5199\u64cd\u4f5c\u5b8c\u6bd5\uff0c\u800c\u5b9e\u9645\u4e0a\u5199\u7684\u64cd\u4f5c\u8fd8\u6b63\u5728\u6267\u884c\u3002\u4f7f\u7528\u540e\u5199\u8f6c\u6362\u5668\u5c31\u53ef\u4ee5\u50cf\u6d41\u6c34\u7ebf\u4e00\u6837\u628a\u5199\u8bf7\u6c42\u6301\u7eed\u53d1\u9001\u3002\u8fd9\u4e2a\u540e\u5199\u64cd\u4f5c\u6a21\u5757\u66f4\u9002\u5408\u4f7f\u7528\u5728client\u7aef\uff0c\u4ee5\u671f\u51cf\u5c11\u5e94\u7528\u7684\u5199\u5ef6\u8fdf\u3002<br \/>\n\u56de\u5199\u4e2d\u7ee7\u540c\u6837\u53ef\u4ee5\u805a\u5408\u5199\u8bf7\u6c42\u3002\u5982\u679caggregate-size\u9009\u9879\u8bbe\u7f6e\u4e86\u7684\u8bdd\uff0c\u5f53\u8fde\u7eed\u7684\u5199\u5165\u5927\u5c0f\u7d2f\u79ef\u8d77\u6765\u8fbe\u5230\u4e86\u8bbe\u5b9a\u7684\u503c\uff0c\u5c31\u901a\u8fc7\u4e00\u4e2a\u5199\u64cd\u4f5c\u5199\u5165\u5230\u5b58\u50a8\u4e0a\u3002\u8fd9\u4e2a\u64cd\u4f5c\u6a21\u5f0f\u9002\u5408\u5e94\u7528\u5728\u670d\u52a1\u5668\u7aef\uff0c\u4ee5\u4e3a\u8fd9\u4e2a\u53ef\u4ee5\u5728\u591a\u4e2a\u6587\u4ef6\u5e76\u884c\u88ab\u5199\u5165\u78c1\u76d8\u65f6\u964d\u4f4e\u78c1\u5934\u52a8\u4f5c\u3002<br \/>\n\u914d\u7f6e\u4f8b\u5b50\uff1a<br \/>\nvolume write-behind-example<br \/>\ntype performance\/write-behind<br \/>\noption cache-size 3MB&nbsp;&nbsp;&nbsp; # \u7f13\u5b58\u5927\u5c0f,\u5f53\u7d2f\u79ef\u8fbe\u5230\u8fd9\u4e2a\u503c\u624d\u8fdb\u884c\u5b9e\u9645\u7684\u5199\u64cd\u4f5c<br \/>\noption flush-behind on&nbsp;&nbsp; # \u8fd9\u4e2a\u53c2\u6570\u8c03\u6574close()\/flush()\u592a\u591a\u7684\u60c5\u51b5\uff0c\u9002\u7528\u4e8e\u5927\u91cf\u5c0f\u6587\u4ef6\u7684\u60c5\u51b5<br \/>\nsubvolumes &lt;x&gt;<br \/>\nend-volume<\/p>\n<p><strong>7.1.9.&nbsp;&nbsp;&nbsp; performance\/io-threads (IO\u7ebf\u7a0b)<\/strong><\/p>\n<p>type performance\/io-threads<br \/>\nIO\u7ebf\u7a0b\u4e2d\u7ee7(performance\/io-threads\uff09\u5c5e\u4e8e\u6027\u80fd\u8c03\u6574\u4e2d\u7ee7\u7684\u4e00\u79cd\uff0c\u4f5c\u7528\u662f\u589e\u52a0IO\u7684\u5e76\u53d1\u7ebf\u7a0b\uff0c\u4ee5\u63d0\u9ad8IO\u6027\u80fd\u3002<br \/>\nIO\u7ebf\u7a0b\u4e2d\u7ee7\u8bd5\u56fe\u589e\u52a0\u670d\u52a1\u5668\u540e\u53f0\u8fdb\u7a0b\u5bf9\u6587\u4ef6\u5143\u6570\u636e\u8bfb\u5199I\/O\u7684\u5904\u7406\u80fd\u529b\u3002\u7531\u4e8eGlusterFS\u670d\u52a1\u662f\u5355\u7ebf\u7a0b\u7684\uff0c\u4f7f\u7528IO\u7ebf\u7a0b\u8f6c\u6362\u5668\u53ef\u4ee5\u8f83\u5927\u7684\u63d0\u9ad8\u6027\u80fd\u3002\u8fd9\u4e2a\u8f6c\u6362\u5668\u6700\u597d\u662f\u88ab\u7528\u4e8e\u670d\u52a1\u5668\u7aef\uff0c\u800c\u4e14\u662f\u5728\u670d\u52a1\u5668\u534f\u8bae\u8f6c\u6362\u5668\u540e\u9762\u88ab\u52a0\u8f7d\u3002<br \/>\nIO\u7ebf\u7a0b\u64cd\u4f5c\u4f1a\u5c06\u8bfb\u548c\u5199\u64cd\u4f5c\u5206\u6210\u4e0d\u540c\u7684\u7ebf\u7a0b\u3002\u540c\u4e00\u65f6\u523b\u5b58\u5728\u7684\u603b\u7ebf\u7a0b\u662f\u6052\u5b9a\u7684\u5e76\u4e14\u662f\u53ef\u4ee5\u914d\u7f6e\u7684\u3002<br \/>\n\u914d\u7f6e\u4f8b\u5b50\uff1a<br \/>\nvolume iothreads<br \/>\ntype performance\/io-threads <br \/>\noption thread-count 32 # \u7ebf\u7a0b\u4f7f\u7528\u7684\u6570\u91cf<br \/>\nsubvolumes &lt;x&gt;<br \/>\nend-volume<\/p>\n<p><strong>7.1.10.&nbsp;&nbsp;&nbsp; performance\/io-cache (IO\u7f13\u5b58)<\/strong><\/p>\n<p>type performance\/io-cache<br \/>\nIO\u7f13\u5b58\u4e2d\u7ee7(performance\/io-threads\uff09\u5c5e\u4e8e\u6027\u80fd\u8c03\u6574\u4e2d\u7ee7\u7684\u4e00\u79cd\uff0c\u4f5c\u7528\u662f\u7f13\u5b58\u4f4f\u5df2\u7ecf\u88ab\u8bfb\u8fc7\u7684\u6570\u636e\uff0c\u4ee5\u63d0\u9ad8IO\u6027\u80fd\u3002<br \/>\nIO\u7f13\u5b58\u4e2d\u7ee7\u53ef\u4ee5\u7f13\u5b58\u4f4f\u5df2\u7ecf\u88ab\u8bfb\u8fc7\u7684\u6570\u636e\u3002\u8fd9\u4e2a\u5bf9\u4e8e\u591a\u4e2a\u5e94\u7528\u5bf9\u540c\u4e00\u4e2a\u6570\u636e\u591a\u6b21\u8bbf\u95ee\uff0c\u5e76\u4e14\u5982\u679c\u8bfb\u7684\u64cd\u4f5c\u8fdc\u8fdc\u5927\u4e8e\u5199\u7684\u64cd\u4f5c\u7684\u8bdd\u662f\u5f88\u6709\u7528\u7684\uff08\u6bd4\u5982\uff0cIO\u7f13\u5b58\u5f88\u9002\u5408\u7528\u4e8e\u63d0\u4f9bweb\u670d\u52a1\u7684\u73af\u5883\uff0c\u5927\u91cf\u7684\u5ba2\u6237\u7aef\u53ea\u4f1a\u8fdb\u884c\u7b80\u5355\u7684\u8bfb\u53d6\u6587\u4ef6\u7684\u64cd\u4f5c\uff0c\u53ea\u6709\u5f88\u5c11\u4e00\u90e8\u5206\u4f1a\u53bb\u5199\u6587\u4ef6\uff09\u3002<br \/>\n\u5f53IO\u7f13\u5b58\u4e2d\u7ee7\u68c0\u6d4b\u5230\u6709\u5199\u64cd\u4f5c\u7684\u65f6\u5019\uff0c\u5b83\u5c31\u4f1a\u628a\u76f8\u5e94\u7684\u6587\u4ef6\u4ece\u7f13\u5b58\u4e2d\u5220\u9664\u3002<br \/>\nIO\u7f13\u5b58\u4e2d\u7ee7\u4f1a\u5b9a\u671f\u7684\u6839\u636e\u6587\u4ef6\u7684\u4fee\u6539\u65f6\u95f4\u6765\u9a8c\u8bc1\u7f13\u5b58\u4e2d\u76f8\u5e94\u6587\u4ef6\u7684\u4e00\u81f4\u6027\u3002\u9a8c\u8bc1\u8d85\u65f6\u65f6\u95f4\u662f\u53ef\u4ee5\u914d\u7f6e\u7684\u3002<br \/>\n\u914d\u7f6e\u4f8b\u5b50\uff1a<br \/>\nvolume iothreads<br \/>\ntype performance\/ io-cache<br \/>\noption cache-size 32MB&nbsp; #\u53ef\u4ee5\u7f13\u5b58\u7684\u6700\u5927\u6570\u636e\u91cf<br \/>\noption cache-timeout 1&nbsp; #\u9a8c\u8bc1\u8d85\u65f6\u65f6\u95f4\uff0c\u5355\u4f4d\u79d2<br \/>\noption priority&nbsp;&nbsp; *:0&nbsp;&nbsp; #\u6587\u4ef6\u5339\u914d\u5217\u8868\u53ca\u5176\u8bbe\u7f6e\u7684\u4f18\u5148\u7ea7<br \/>\nsubvolumes &lt;x&gt;<br \/>\nend-volume<\/p>\n<p><strong>7.1.11.&nbsp;&nbsp;&nbsp; \u5176\u5b83\u4e2d\u7ee7<\/strong><\/p>\n<p>\u5176\u5b83\u4e2d\u7ee7\u8fd8\u6709<br \/>\ncluster\/nufa(\u975e\u5747\u5300\u6587\u4ef6\u5b58\u53d6)<br \/>\ncluster\/stripe(\u6761\u5e26\uff0c\u7528\u4e8e\u5927\u6587\u4ef6\uff0c\u5206\u5757\u5b58\u50a8\u5728\u4e0d\u7528\u670d\u52a1\u5668)<br \/>\ncluster\/ha(\u96c6\u7fa4)<br \/>\nfeatures\/filter(\u8fc7\u6ee4)<br \/>\nfeatures\/trash(\u56de\u6536\u7ad9)<br \/>\npath-converter<br \/>\nquota<br \/>\n\u8001\u7684\u8fd8\u6709\uff1a<br \/>\ncluster\/unify\uff08\u548cdistribute\uff0c\u53ef\u5b9a\u4e49\u4e0d\u540c\u7684\u8c03\u5ea6\u5668\uff0c\u4ee5\u4e0d\u540c\u65b9\u5f0f\u5199\u5165\u6570\u636e\uff09<br \/>\n<strong><br \/>\n8.&nbsp;&nbsp;&nbsp; GlusterFS\u914d\u7f6e<\/p>\n<p>8.1.&nbsp;&nbsp;&nbsp; \u670d\u52a1\u5668\u7aef\u914d\u7f6e<\/strong><\/p>\n<p>\u670d\u52a1\u5668\u4e3a6\u53f0\uff0cIP\u5206\u522b\u662f192.168.1.11~192.168.1.16\u3002\u914d\u7f6e\u4e3a\uff1a<br \/>\n# vi \/etc\/glusterfs\/glusterfsd.vol<br \/>\nvolume posix<br \/>\ntype storage\/posix<br \/>\noption directory \/sda4<br \/>\nend-volume<\/p>\n<p>volume locks<br \/>\ntype features\/locks<br \/>\nsubvolumes posix<br \/>\nend-volume<\/p>\n<p>volume brick<br \/>\ntype performance\/io-threads<br \/>\noption thread-count 8<br \/>\nsubvolumes locks<br \/>\nend-volume<\/p>\n<p>volume server<br \/>\ntype protocol\/server<br \/>\noption transport-type tcp<br \/>\nsubvolumes brick<br \/>\noption auth.addr.brick.allow *<br \/>\nend-volume <br \/>\n\u4fdd\u5b58\u540e\u542f\u52a8GlusterFS:<br \/>\n# service glusterfsd start<\/p>\n<p><strong>8.2.&nbsp;&nbsp;&nbsp; \u5ba2\u6237\u7aef\u914d\u7f6e<\/strong><\/p>\n<p>\u670d\u52a1\u5668\u4e3a192.168.1.17\u548c192.168.1.18\uff1a<br \/>\n# vi \/etc\/glusterfs\/glusterfs.vol<br \/>\nvolume brick1<br \/>\ntype protocol\/client<br \/>\noption transport-type tcp<br \/>\nend-volume<\/p>\n<p>volume brick2<br \/>\ntype protocol\/client<br \/>\noption transport-type tcp<br \/>\noption remote-host 192.168.1.12<br \/>\noption remote-subvolume brick<br \/>\nend-volume<\/p>\n<p>volume brick3<br \/>\ntype protocol\/client<br \/>\noption transport-type tcp<br \/>\noption remote-host 192.168.1.13<br \/>\noption remote-subvolume brick<br \/>\nend-volume<\/p>\n<p>volume brick4<br \/>\ntype protocol\/client<br \/>\noption transport-type tcp<br \/>\noption remote-host 192.168.1.14<br \/>\noption remote-subvolume brick<br \/>\nend-volume<\/p>\n<p>volume brick5<br \/>\ntype protocol\/client<br \/>\noption transport-type tcp<br \/>\noption remote-host 192.168.1.15<br \/>\noption remote-subvolume brick<br \/>\nend-volume<\/p>\n<p>volume brick6<br \/>\ntype protocol\/client<br \/>\noption transport-type tcp<br \/>\noption remote-host 192.168.1.16<br \/>\noption remote-subvolume brick<br \/>\nend-volume<\/p>\n<p>volume afr1<br \/>\ntype cluster\/replicate<br \/>\nsubvolumes brick1 brick2<br \/>\nend-volume<\/p>\n<p>volume afr2<br \/>\ntype cluster\/replicate<br \/>\nsubvolumes brick3 brick4<br \/>\nend-volume<\/p>\n<p>volume afr3<br \/>\ntype cluster\/replicate<br \/>\nsubvolumes brick5 brick6<br \/>\nend-volume<\/p>\n<p>volume unify<br \/>\ntype cluster\/distribute<br \/>\nsubvolumes afr1 afr2 afr3<br \/>\nend-volume<\/p>\n<p>GlusterFS\u7684\u4e3b\u8981\u914d\u7f6e\u90fd\u5728\u5ba2\u6237\u7aef\u4e0a\uff0c\u4e0a\u9762\u914d\u7f6e\u6587\u4ef6\u7684\u610f\u601d\u662f\u628a6\u53f0\u670d\u52a1\u5668\u5206\u62103\u4e2areplicate\u5377\uff0c\u518d\u7528\u8fd93\u4e2areplicate\u5377\u505a\u6210\u4e00\u4e2adistribute\uff0c\u63d0\u4f9b\u5e94\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002<\/p>\n<p><strong>8.3.&nbsp;&nbsp;&nbsp; GlusterFS\u6302\u8f7d<\/strong><\/p>\n<p>GlusterFS\u6302\u8f7d\u4e3a\u5728\u5ba2\u6237\u7aef\u4e0a\u6267\u884c\uff1a<br \/>\n# glusterfs -f \/etc\/glusterfs\/glusterfs.vol \/gmnt\/ -l \/var\/log\/glusterfs\/glusterfs.log<br \/>\n-f \/etc\/glusterfs\/glusterfs.vol\u4e3a\u6307\u5b9aGlusterFS\u7684\u914d\u7f6e\u6587\u4ef6<br \/>\n\/gmnt\u662f\u6302\u8f7d\u70b9<br \/>\n-l \/var\/log\/glusterfs\/glusterfs.log\u4e3a\u65e5\u5fd7<br \/>\n\u53e6\u5916\uff0cGlusterFS\u4e5f\u53ef\u4ee5\u7ed3\u679cfstab\u6216autofs\u65b9\u5f0f\u5f00\u673a\u6302\u8f7d\u3002\u6302\u8f7d\u540e\u5c31\u53ef\u4ee5\u5728\/gmnt\u5185\u8bfb\u5199\u6587\u4ef6\u4e86\uff0c\u7528\u6cd5\u4e0e\u8bfb\u5199\u672c\u5730\u786c\u76d8\u4e00\u6837\u3002<\/p>\n<p>\n<strong>9.&nbsp;&nbsp;&nbsp; GlusterFS\u6027\u80fd\u6d4b\u8bd5<\/p>\n<p>9.1.&nbsp;&nbsp;&nbsp; \u5355\u5ba2\u6237\u7aef\u6d4b\u8bd5<\/strong><\/p>\n<p>\u6d4b\u8bd51\uff1a\u590d\u5236\u5927\u7ea62.5G\u5bb9\u91cf \/usr\u76ee\u5f55\u81f3GlusterFS(\u5927\u90e8\u5206\u90fd\u662f\u5c0f\u6587\u4ef6)<br \/>\n\u6d4b\u8bd5\u7ed3\u679c\uff1a<br \/>\nglusterfs&nbsp;&nbsp;&nbsp; 1361KB\/s<br \/>\n\u672c\u5730\u786c\u76d8&nbsp;&nbsp; 2533KB\/s<\/p>\n<p>\u6d4b\u8bd52: \u590d\u5236\u4e00\u4e2a3.8G\u7684\u6587\u4ef6\u81f3GlusterFS<br \/>\n\u6d4b\u8bd5\u7ed3\u679c\uff1a<br \/>\nglusterfs&nbsp;&nbsp;&nbsp;&nbsp; 2270KB\/s<br \/>\n\u672c\u5730\u786c\u76d8&nbsp;&nbsp;&nbsp; 10198KB\/s<\/p>\n<p>\u6d4b\u8bd53\uff1a\u8bfb\u53d6\u6d4b\u8bd52\u590d\u5236\u7684\u5927\u6587\u4ef6(cat xxx.iso &gt; \/dev\/null)<br \/>\n\u6d4b\u8bd5\u7ed3\u679c\uff1a<br \/>\nglusterfs&nbsp;&nbsp;&nbsp;&nbsp; 11.2MB\/s(\u57fa\u672c\u8dd1\u6ee1100M\u5e26\u5bbd)<br \/>\n\u672c\u5730\u786c\u76d8&nbsp;&nbsp;&nbsp; 45.6MB\/s<br \/>\n<strong><br \/>\n9.2.&nbsp;&nbsp;&nbsp; \u53cc\u5ba2\u6237\u7aef\u6d4b\u8bd5<\/strong><\/p>\n<p>\u6d4b\u8bd51\uff1a\u5728\u4e24\u4e2a\u5ba2\u6237\u7aef\u4e0a\u540c\u65f6\u590d\u5236\u5927\u7ea62.5G\u5bb9\u91cf \/usr\u76ee\u5f55\u81f3GlusterFS(\u5927\u90e8\u5206\u90fd\u662f\u5c0f\u6587\u4ef6)<br \/>\n\u6d4b\u8bd5\u7ed3\u679c\uff1a<br \/>\n192.168.1.17:glusterfs&nbsp;&nbsp; 1438KB\/s<br \/>\n192.168.1.18:glusterfs&nbsp;&nbsp; 1296KB\/s<\/p>\n<p>\u6d4b\u8bd52: \u5728\u4e24\u4e2a\u5ba2\u6237\u7aef\u4e0a\u540c\u65f6\u590d\u5236\u4e00\u4e2a3.8G\u7684\u6587\u4ef6\u81f3GlusterFS<br \/>\n\u6d4b\u8bd5\u7ed3\u679c\uff1a<br \/>\n192.168.1.17:glusterfs&nbsp;&nbsp;&nbsp; 2269KB\/s<br \/>\n192.168.1.18:glusterfs&nbsp;&nbsp;&nbsp; 2320KB\/s<\/p>\n<p>\n<strong>9.3.&nbsp;&nbsp;&nbsp; \u914d\u7f6e\u56de\u5199\u529f\u80fd\u540e\u7684\u6d4b\u8bd5<\/p>\n<p>9.3.1.&nbsp;&nbsp;&nbsp; \u670d\u52a1\u5668\u914d\u7f6e<\/strong><\/p>\n<p>volume posix<br \/>\ntype storage\/posix<br \/>\noption directory \/sda4<br \/>\nend-volume<\/p>\n<p>volume locks<br \/>\ntype features\/locks<br \/>\nsubvolumes posix<br \/>\nend-volume<\/p>\n<p>volume writebehind<br \/>\ntype performance\/write-behind<br \/>\noption cache-size&nbsp;&nbsp; 16MB<br \/>\noption flush-behind on<br \/>\nsubvolumes locks<br \/>\nend-volume<\/p>\n<p>volume brick<br \/>\ntype performance\/io-threads<br \/>\noption thread-count 64<br \/>\nsubvolumes writebehind <br \/>\nend-volume<\/p>\n<p>volume server<br \/>\ntype protocol\/server<br \/>\noption transport-type tcp<br \/>\noption auth.addr.brick.allow * # Allow access to \"brick\" volume<br \/>\nend-volume<\/p>\n<p><strong>9.3.2.&nbsp;&nbsp;&nbsp; \u5ba2\u6237\u7aef\u914d\u7f6e<\/strong><\/p>\n<p>volume brick1<br \/>\ntype protocol\/client<br \/>\noption transport-type tcp<br \/>\noption remote-host 192.168.1.11&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # IP address of the remote brick<br \/>\noption remote-subvolume brick&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # name of the remote volume<br \/>\nend-volume<\/p>\n<p>volume brick2<br \/>\ntype protocol\/client<br \/>\noption transport-type tcp<br \/>\noption remote-host 192.168.1.12<br \/>\noption remote-subvolume brick<br \/>\nend-volume<\/p>\n<p>volume brick3<br \/>\ntype protocol\/client<br \/>\noption transport-type tcp<br \/>\noption remote-host 192.168.1.13<br \/>\noption remote-subvolume brick<br \/>\nend-volume<\/p>\n<p>volume brick4<br \/>\ntype protocol\/client<br \/>\noption transport-type tcp<br \/>\noption remote-host 192.168.1.14<br \/>\noption remote-subvolume brick<br \/>\nend-volume<\/p>\n<p>volume brick5<br \/>\ntype protocol\/client<br \/>\noption transport-type tcp<br \/>\noption remote-host 192.168.1.15<br \/>\noption remote-subvolume brick<br \/>\nend-volume<\/p>\n<p>volume brick6<br \/>\ntype protocol\/client<br \/>\noption transport-type tcp<br \/>\noption remote-host 192.168.1.16<br \/>\noption remote-subvolume brick<br \/>\nend-volume<\/p>\n<p>volume afr1<br \/>\ntype cluster\/replicate<br \/>\nsubvolumes brick1 brick2<br \/>\nend-volume<\/p>\n<p>volume afr2<br \/>\ntype cluster\/replicate<br \/>\nsubvolumes brick3 brick4<br \/>\nend-volume<\/p>\n<p>volume afr3<br \/>\ntype cluster\/replicate<br \/>\nsubvolumes brick5 brick6<br \/>\nend-volume<\/p>\n<p>volume wb1<br \/>\ntype performance\/write-behind<br \/>\noption cache-size 2MB<br \/>\noption flush-behind on<br \/>\nsubvolumes afr1<br \/>\nend-volume<\/p>\n<p>volume wb2<br \/>\ntype performance\/write-behind<br \/>\noption cache-size 2MB<br \/>\noption flush-behind on<br \/>\nsubvolumes afr2<br \/>\nend-volume<\/p>\n<p>volume wb3<br \/>\ntype performance\/write-behind<br \/>\noption cache-size 2MB<br \/>\noption flush-behind on<br \/>\nsubvolumes afr3<br \/>\nend-volume<\/p>\n<p>volume unify<br \/>\ntype cluster\/distribute<br \/>\nsubvolumes wb1 wb2 wb3<br \/>\nend-volume<\/p>\n<p><strong>9.3.3.&nbsp;&nbsp;&nbsp; \u6d4b\u8bd5<\/strong><\/p>\n<p>\u6d4b\u8bd5\uff1a\u5728\u4e24\u4e2a\u5ba2\u6237\u7aef\u4e0a\u540c\u65f6\u590d\u5236\u5927\u7ea62.5G\u5bb9\u91cf \/usr\u76ee\u5f55\u81f3GlusterFS(\u5927\u90e8\u5206\u90fd\u662f\u5c0f\u6587\u4ef6)<br \/>\n\u6d4b\u8bd5\u7ed3\u679c\uff1a<br \/>\n192.168.1.17:glusterfs&nbsp;&nbsp; 979KB\/s<br \/>\n192.168.1.18:glusterfs&nbsp;&nbsp; 1056KB\/s<\/p>\n<p>\n<strong>10.&nbsp;&nbsp;&nbsp; \u7ed3\u8bed<\/strong><\/p>\n<p>\u4ece\u6d4b\u8bd5\u7ed3\u679c\u770b\uff0c\u5c0f\u6587\u4ef6\u7684\u5199\u5165\u901f\u5ea6\u53ea\u67091M\u591a\uff0c\u901f\u5ea6\u8fc7\u4f4e\uff0c\u597d\u5728\u5728\u591a\u5ba2\u6237\u7aef\u7684\u60c5\u51b5\u4e0b\uff0c\u5199\u5165\u901f\u5ea6\u8fd8\u7b97\u5e73\u7a33\u3002\u5927\u6587\u4ef6\u7684\u5199\u5165\u4e5f\u53ea\u67092M\u3002\u5bf9\u4e8e\u505a\u56fe\u7247\u670d\u52a1\u5668\u6765\u8bf4\uff0c\u53ea\u80fd\u7b97\u52c9\u5f3a\u591f\u7528\u3002<br \/>\n\u53e6\u5916\u5728\u6027\u80fd\u8c03\u4f18\u65b9\u9762\uff0c\u5728\u6211\u4eec\u52a0\u4e0a\u56de\u5199\u540e\uff0c\u901f\u5ea6\u53cd\u800c\u6709\u4e0b\u964d\u3002\u5f53\u7136\u4e5f\u6709\u53ef\u80fd\u662f\u914d\u7f6e\u53c2\u6570\u4e0d\u5f53\u7684\u539f\u56e0\u3002<br \/>\n\u7ecf\u6d4b\u8bd5\uff0cGlusterFS\u5728\u9ad8\u53ef\u7528\u65b9\u9762\u6bd4\u8f83\u7a33\u5b9a\u7684\uff0c\u57fa\u672c\u80fd\u8fbe\u5230\u8981\u6c42\u3002\u4e0d\u8fc7\u7531\u4e8e\u5728\u590d\u5236\u6a21\u5f0f\u7684\u66f4\u65b0\u662f\u901a\u8fc7\u5ba2\u6237\u7aef\u8fdb\u884c\u7684\uff0c\u5f53\u5ba2\u6237\u7aef\u548creplicate\u5185\u7684\u4e00\u53f0\u670d\u52a1\u5668\u540c\u65f6\u6302\u65f6\uff0c\u4f1a\u9020\u6210\u6570\u636e\u4e0d\u540c\u6b65\u7684\u60c5\u51b5\u3002\u9700\u8981\u624b\u52a8\u505a\u4e2a\u5217\u8868\u7684\u52a8\u4f5c(ls)\u624d\u4f1a\u66f4\u65b0\u3002<br \/>\nGlusterFS\u4f5c\u4e3a\u6b63\u5f0f\u8fd0\u8425\u73af\u5883\u4f7f\u7528\u65f6\uff0c\u8fd8\u7f3a\u4e4f\u4e00\u4e9b\u529f\u80fd\uff0c\u5982GlusterFS\u6ca1\u6709\u5bf9\u6574\u4e2a\u96c6\u7fa4\u7684\u76d1\u63a7\u548c\u7ba1\u7406\u7a0b\u5e8f\u7b49\u3002<\/div>\n<div class=\"content mod-cs-content text-content clearfix\">&nbsp;<\/div>\n<div class=\"content mod-cs-content text-content clearfix\">&nbsp;<\/div>\n<div class=\"content mod-cs-content text-content clearfix\">--------------------------------------------------------------------------<\/div>\n<div class=\"content mod-cs-content text-content clearfix\">&nbsp;<\/div>\n<div class=\"content mod-cs-content text-content clearfix\"><strong>\u4e00\u4e9b\u547d\u4ee4\u914d\u7f6e<\/strong><\/p>\n<p><span style=\"font-weight:bold;color:#ed1c24;text-decoration:underline;\">1.\u5728\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u5efa\u7acbDistributed Volume<\/span><\/p>\n<p>\u5047\u8bbe\u670d\u52a1\u5668\u4e3a:192.168.113.173(Server)<br \/>\n\u5047\u8bbe\u5ba2\u6237\u7aef\u4e3a:192.168.113.179(Client)<\/p>\n<p>\u9996\u5148\u914d\u7f6eServer,\u5f00\u542fgluster\u670d\u52a1<br \/>\nServer# modprobe fuse<br \/>\nServer# \/etc\/init\/glusterd start<\/p>\n<p>\u670d\u52a1\u5668\u53ea\u6709\u4e00\u53f0\uff0c\u76f4\u63a5\u521b\u5efaVolume\u5373\u53ef,\u540d\u4e3asingle-volume<br \/>\nServer# gluster volume create single-volume 192.168.113.173:\/home\/single1<\/p>\n<p>\u542f\u52a8volume<br \/>\nServer# gluster volume start single-volume<\/p>\n<p>\u67e5\u770b\u5f53\u524d\u6240\u6709volume\u72b6\u6001<br \/>\nServer# gluster volume info<\/p>\n<p>\u82e5\u8981\u4f7f\u7528Cache,\u5219\u4f7f\u7528<br \/>\nServer# gluster volume set single-volume performance.cache-size 1GB<\/p>\n<p>Gluster\u81ea\u52a8\u751f\u6210\u914d\u7f6e\u6587\u4ef6\uff0c\u5728\/etc\/glusterd\/vols\/single-volume\/\u6587\u4ef6\u5939\u4e2d<\/p>\n<p>\u5728\u5ba2\u6237\u7aef\u6302\u8f7dgluster\u955c\u50cf,\u5ba2\u6237\u7aef\u76f4\u63a5\u4f7f\u7528Server\u7aef\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4e0d\u5fc5\u521b\u5efa\u81ea\u5df1\u7684\u914d\u7f6e\u6587\u4ef6\u4e86<br \/>\nClient# modprobe fuse<br \/>\nClient# \/etc\/init\/glusterd start<br \/>\nClient# mount.glusterfs 192.168.113.173:\/single-volume \/mnt\/local-volume<\/p>\n<p><span style=\"font-weight:bold;color:#ed1c24;text-decoration:underline;\">2.\u5728\u4e24\u53f0\u670d\u52a1\u5668\u4e0a\u5efa\u7acbDistributed Volume<\/span><\/p>\n<p>\u5047\u8bbe\u670d\u52a1\u5668A\u4e3a:192.168.113.173(ServerA)<br \/>\n\u5047\u8bbe\u670d\u52a1\u5668B\u4e3a:192.168.113.174(ServerB)<br \/>\n\u5047\u8bbe\u5ba2\u6237\u7aef\u4e3a:192.168.113.179(Client)<\/p>\n<p>\u9996\u5148\u914d\u7f6eServer,\u5f00\u542fgluster\u670d\u52a1<br \/>\nServerA# modprobe fuse<br \/>\nServerA# \/etc\/init\/glusterd start<\/p>\n<p>ServerB# modprobe fuse<br \/>\nServerB# \/etc\/init\/glusterd start<\/p>\n<p>\u670d\u52a1\u5668\u6709\u4e24\u53f0,\u8981\u5148\u7ed1\u5b9a\u5728\u4e00\u8d77(\u5047\u8bbe\u4f7f\u7528ServerA\u505a\u4e3b\u670d\u52a1\u5668)<br \/>\nServerA# gluster peer probe 192.168.113.174<\/p>\n<p>\u521b\u5efaVolume,\u540d\u4e3acluster-volume<br \/>\nServerA# gluster volume create cluster-volume 192.168.113.173:\/home\/cluster1 192.168.113.174:\/home\/cluster2<\/p>\n<p>\u542f\u52a8volume<br \/>\nServerA# gluster volume start cluster-volume<\/p>\n<p>\u67e5\u770b\u5f53\u524d\u6240\u6709volume\u72b6\u6001<br \/>\nServerA# gluster volume info<\/p>\n<p>\u82e5\u8981\u4f7f\u7528Cache,\u5219\u4f7f\u7528<br \/>\nServerA# gluster volume set cluster-volume performance.cache-size 1GB<\/p>\n<p>Gluster\u81ea\u52a8\u751f\u6210\u914d\u7f6e\u6587\u4ef6\uff0c\u5728\/etc\/glusterd\/vols\/cluster-volume\/\u6587\u4ef6\u5939\u4e2d<\/p>\n<p>\u5728\u5ba2\u6237\u7aef\u6302\u8f7dgluster\u955c\u50cf,\u5ba2\u6237\u7aef\u76f4\u63a5\u4f7f\u7528Server\u7aef\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4e0d\u5fc5\u521b\u5efa\u81ea\u5df1\u7684\u914d\u7f6e\u6587\u4ef6\u4e86<br \/>\nClient# modprobe fuse<br \/>\nClient# \/etc\/init\/glusterd start<br \/>\nClient# mount.glusterfs 192.168.113.173:\/cluster-volume \/mnt\/local-volume<\/p>\n<p><span style=\"font-weight:bold;color:#ed1c24;text-decoration:underline;\">3.\u5728\u4e24\u53f0\u670d\u52a1\u5668\u4e0a\u5efa\u7acbStriped Volume<\/span><\/p>\n<p>\u5047\u8bbe\u670d\u52a1\u5668A\u4e3a:192.168.113.173(ServerA)<br \/>\n\u5047\u8bbe\u670d\u52a1\u5668B\u4e3a:192.168.113.174(ServerB)<br \/>\n\u5047\u8bbe\u5ba2\u6237\u7aef\u4e3a:192.168.113.179(Client)<\/p>\n<p>\u9996\u5148\u914d\u7f6eServer,\u5f00\u542fgluster\u670d\u52a1<br \/>\nServerA# modprobe fuse<br \/>\nServerA# \/etc\/init\/glusterd start<\/p>\n<p>ServerB# modprobe fuse<br \/>\nServerB# \/etc\/init\/glusterd start<\/p>\n<p>\u670d\u52a1\u5668\u6709\u4e24\u53f0,\u8981\u5148\u7ed1\u5b9a\u5728\u4e00\u8d77(\u5047\u8bbe\u4f7f\u7528ServerA\u505a\u4e3b\u670d\u52a1\u5668)<br \/>\nServerA# gluster peer probe 192.168.113.174<\/p>\n<p>\u521b\u5efaVolume,\u540d\u4e3astripe-volume<br \/>\nServerA# gluster volume create stripe-volume stripe 2 transport tcp 192.168.113.173:\/home\/stripe1 192.168.113.174:\/home\/stripe2<\/p>\n<p>\u542f\u52a8volume<br \/>\nServerA# gluster volume start stripe-volume<\/p>\n<p>\u67e5\u770b\u5f53\u524d\u6240\u6709volume\u72b6\u6001<br \/>\nServerA# gluster volume info<\/p>\n<p>\u82e5\u8981\u4f7f\u7528Cache,\u5219\u4f7f\u7528<br \/>\nServerA# gluster volume set stripe-volume performance.cache-size 1GB<\/p>\n<p>Gluster\u81ea\u52a8\u751f\u6210\u914d\u7f6e\u6587\u4ef6\uff0c\u5728\/etc\/glusterd\/vols\/stripe-volume\/\u6587\u4ef6\u5939\u4e2d<\/p>\n<p>\u5728\u5ba2\u6237\u7aef\u6302\u8f7dgluster\u955c\u50cf,\u5ba2\u6237\u7aef\u76f4\u63a5\u4f7f\u7528Server\u7aef\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4e0d\u5fc5\u521b\u5efa\u81ea\u5df1\u7684\u914d\u7f6e\u6587\u4ef6\u4e86<br \/>\nClient# modprobe fuse<br \/>\nClient# \/etc\/init\/glusterd start<br \/>\nClient# mount.glusterfs 192.168.113.173:\/stripe-volume \/mnt\/local-volume <\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0b\u8f7d\uff1a<\/p>\n<p><a href=\"http:\/\/download.gluster.org\/pub\/gluster\/glusterfs\/\">http:\/\/download.gluster.org\/pub\/gluster\/glusterfs\/<\/a><\/p>\n<p>&nbsp;<\/p>\n<h3>Fuse\u652f\u6301\u5e93\u5b89\u88c5<br \/>\n\u67e5\u770b\u53d1Fuse\u662f\u5426\u5df2\u7ecf\u5b89\u88c5\uff1a<\/h3>\n<p>\u547d\u4ee4\uff1a<\/p>\n<p>#lsmod | grep \"fuse\"<\/p>\n<p>\u5982\u679c\u663e\u793a\uff1a<\/p>\n<p>fuse&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 66285&nbsp; 4<\/p>\n<p>\u7cfb\u7edf\u5df2\u7ecf\u5b89\u88c5Fuse\uff0c\u8df3\u8fc7\u6b21\u5b89\u88c5\u6b65\u9aa4\uff0c\u8fdb\u5165\u4e0b\u4e2a\u8f6f\u4ef6\u7684\u5b89\u88c5\uff0c\u5426\u5219\u7ee7\u7eed\u4e0b\u9762\u7684\u5b89\u88c5<\/p>\n<p>&nbsp;<\/p>\n<p>\u6587\u4ef6:&nbsp;\"fuse-...<\/p>\n<p> <a href=\"https:\/\/www.xiaobo.li\/notes\/archives\/337\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[287],"tags":[143],"class_list":["post-337","post","type-post","status-publish","format-standard","hentry","category-linux","tag-glusterfs"],"_links":{"self":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/comments?post=337"}],"version-history":[{"count":0,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/337\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/media?parent=337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/categories?post=337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/tags?post=337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}