{"id":4210,"date":"2015-08-31T10:00:03","date_gmt":"2015-08-31T01:00:03","guid":{"rendered":"http:\/\/www.skyarch.net\/blog\/?p=4210"},"modified":"2015-09-20T05:16:26","modified_gmt":"2015-09-19T20:16:26","slug":"ec2%e3%82%a4%e3%83%b3%e3%82%b9%e3%82%bf%e3%83%b3%e3%82%b9%e3%82%92glusterfs%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6ebs%e5%86%97%e9%95%b7%e5%8c%96","status":"publish","type":"post","link":"https:\/\/www.skyarch.net\/blog\/ec2%e3%82%a4%e3%83%b3%e3%82%b9%e3%82%bf%e3%83%b3%e3%82%b9%e3%82%92glusterfs%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6ebs%e5%86%97%e9%95%b7%e5%8c%96\/","title":{"rendered":"EC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092GlusterFS\u3092\u4f7f\u7528\u3057\u3066EBS\u5197\u9577\u5316"},"content":{"rendered":"<p>\u3010\u5b9f\u65bd\u3057\u305f\u3053\u3068\u3011<\/p>\n<p>AWS\u74b0\u5883\u306eEC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067GlusterFS\u3092\u4f7f\u7528\u3057\u3066\u3001\u30b5\u30fc\u30d0\u306e\u5197\u9577\u5316\u3092\u884c\u3063\u305f\u6642\u306e\u30e1\u30e2\u306b\u306a\u308a\u307e\u3059<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u3010\u524d\u63d0\u6761\u4ef6\u3011<\/p>\n<p>\u30fbAmazonLinux<\/p>\n<p>\u30fb\u8ffd\u52a0\u3067EBS\u3092\u3064\u3051\u3066\u304a\u304f(\u3053\u308c\u304cGlusterFS\u5316\u3055\u308c\u308bDisk\u3067\u3059)<br \/>\n\u25a0\u624b\u9806<br \/>\n\uff11\uff0eglusterfs\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb(www01\/02)<\/p>\n<p>curl -o \/etc\/yum.repos.d\/glusterfs-epel.repo http:\/\/download.gluster.org\/pub\/gluster\/glusterfs\/3.3\/LATEST\/EPEL.repo\/glusterfs-epel.repo<\/p>\n<p>&nbsp;<\/p>\n<p>\uff12\uff0e\u30ea\u30dd\u30b8\u30c8\u30ea\u30d5\u30a1\u30a4\u30eb\u7de8\u96c6(www01\/02)<br \/>\nvi \/etc\/yum.repos.d\/glusterfs-epel.repo<\/p>\n[$releasever] \u2192 [6]\u306b\u4fee\u6b63\u3059\u308b<\/p>\n<p>=========\u4fee\u6b63\u3057\u305f\u30d5\u30a1\u30a4\u30eb=========<br \/>\n#Place this file in your \/etc\/yum.repos.d\/ directory<\/p>\n[glusterfs-epel]\nname=GlusterFS is a clustered file-system capable of scaling to several petabytes.<br \/>\n#baseurl=http:\/\/download.gluster.org\/pub\/gluster\/glusterfs\/3.3\/3.3.2\/EPEL.repo\/epel-$releasever\/$basearch\/<br \/>\nbaseurl=http:\/\/download.gluster.org\/pub\/gluster\/glusterfs\/3.3\/3.3.2\/EPEL.repo\/epel-6\/$basearch\/<br \/>\nenabled=1<br \/>\nskip_if_unavailable=1<br \/>\ngpgcheck=0<\/p>\n[glusterfs-swift-epel]\nname=GlusterFS is a clustered file-system capable of scaling to several petabytes.<br \/>\n#baseurl=http:\/\/download.gluster.org\/pub\/gluster\/glusterfs\/3.3\/3.3.2\/EPEL.repo\/epel-$releasever\/noarch<br \/>\nbaseurl=http:\/\/download.gluster.org\/pub\/gluster\/glusterfs\/3.3\/3.3.2\/EPEL.repo\/epel-6\/noarch<br \/>\nenabled=1<br \/>\nskip_if_unavailable=1<br \/>\ngpgcheck=0<\/p>\n[glusterfs-source-epel]\nname=GlusterFS is a clustered file-system capable of scaling to several petabytes. - Source<br \/>\n#baseurl=http:\/\/download.gluster.org\/pub\/gluster\/glusterfs\/3.3\/3.3.2\/EPEL.repo\/epel-$releasever\/SRPMS<br \/>\nbaseurl=http:\/\/download.gluster.org\/pub\/gluster\/glusterfs\/3.3\/3.3.2\/EPEL.repo\/epel-6\/SRPMS<br \/>\nenabled=0<br \/>\nskip_if_unavailable=1<br \/>\ngpgcheck=0<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\uff13\uff0eglusterfs\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u53ca\u3073\u8d77\u52d5(www01\/02)<\/p>\n<p>yum install glusterfs-server<br \/>\nchkconfig glusterd on<br \/>\n\/etc\/init.d\/glusterd start<\/p>\n<p>&nbsp;<\/p>\n<p>\uff14\uff0e\u30de\u30a6\u30f3\u30c8\u30c7\u30d0\u30a4\u30b9\u4f5c\u6210(www01\/02)<br \/>\n\u30fb\u30a2\u30bf\u30c3\u30c1\u3057\u3066\u3044\u308bEBS\u3092\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3059\u308b<\/p>\n<p>mkfs -t ext4 -I 512 \/dev\/[\u30c7\u30d0\u30a4\u30b9\u540d]\n<p>\u30fb\u30de\u30a6\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4f5c\u6210<br \/>\n(www01\u306e\u5834\u5408)<br \/>\nmkdir \/brick\/www01<\/p>\n<p>(www02\u306e\u5834\u5408)<br \/>\nmkdir \/brick\/www02<\/p>\n<p>\u30fb\u30de\u30a6\u30f3\u30c8\u3059\u308b<br \/>\n(www01\u306e\u5834\u5408)<br \/>\nmount -t ext4 [\u30c7\u30d0\u30a4\u30b9\u540d] \/brick\/www01<\/p>\n<p>(www02\u306e\u5834\u5408)<br \/>\nmount -t ext4 [\u30c7\u30d0\u30a4\u30b9\u540d] \/brick\/www02<br \/>\ndf -h\u3067\u78ba\u8a8d<br \/>\n\u30fbfstab\u3078\u8ffd\u8a18<br \/>\n=========\u4fee\u6b63\u3057\u305f\u30d5\u30a1\u30a4\u30eb=========<br \/>\n#<br \/>\nLABEL=\/ \/ ext4 defaults,noatime 1 1<br \/>\ntmpfs \/dev\/shm tmpfs defaults 0 0<br \/>\ndevpts \/dev\/pts devpts gid=5,mode=620 0 0<br \/>\nsysfs \/sys sysfs defaults 0 0<br \/>\nproc \/proc proc defaults 0 0<br \/>\n\/dev\/xvdb1 \/bricks\/www01 ext4 defaults,noatime 1 1<\/p>\n<p>&nbsp;<\/p>\n<p>\uff15\uff0e\u30ce\u30fc\u30c9\u767b\u9332(www01\u203b\u7247\u5074\u3067\u5b9f\u65bd)<\/p>\n[root@ ~]# gluster<br \/>\ngluster&gt;<br \/>\ngluster&gt; peer status<br \/>\nNo peers present<br \/>\ngluster&gt;<br \/>\ngluster&gt; peer probe [IP\u30a2\u30c9\u30ec\u30b9]\ngluster&gt;<br \/>\ngluster&gt; peer status<br \/>\nNumber of Peers: 1<\/p>\n<p>Hostname: [IP\u30a2\u30c9\u30ec\u30b9]\nUuid: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br \/>\nState: Peer in Cluster (Connected)<br \/>\ngluster&gt;<br \/>\n\uff16\uff0e\u30dc\u30ea\u30e5\u30fc\u30e0\u4f5c\u6210(www01\u203b\u7247\u5074\u3067\u5b9f\u65bd)<\/p>\n<p>gluster&gt; volume info<br \/>\nNo volumes present<br \/>\ngluster&gt;<br \/>\ngluster&gt; volume create vol01 replica 2 [www01\u306eIP\u30a2\u30c9\u30ec\u30b9]:\/bricks\/www01 [IP\u30a2\u30c9\u30ec\u30b9]:\/bricks\/www02<br \/>\nCreation of volume vol01 has been successful. Please start the volume to access data.<br \/>\ngluster&gt;<br \/>\ngluster&gt; volume info<\/p>\n<p>Volume Name: vol01<br \/>\nType: Replicate<br \/>\nVolume ID:\u00a0xxxxxxxxxxxxxxxxxxxxxxxxxxxx<br \/>\nStatus: Created<br \/>\nNumber of Bricks: 1 x 2 = 2<br \/>\nTransport-type: tcp<br \/>\nBricks:<br \/>\nBrick1: [www01\u306eIP\u30a2\u30c9\u30ec\u30b9]:\/bricks\/www01<br \/>\nBrick2: [www02\u306eIP\u30a2\u30c9\u30ec\u30b9]:\/bricks\/www02<br \/>\ngluster&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>\uff17\uff0e\u30dc\u30ea\u30e5\u30fc\u30e0\u8d77\u52d5(www01\u203b\u7247\u5074\u3067\u5b9f\u65bd)<\/p>\n<p>gluster&gt; volume status vol01<br \/>\nVolume vol01 is not started<br \/>\ngluster&gt;<br \/>\ngluster&gt; volume start vol01<br \/>\nStarting volume vol01 has been successful<br \/>\ngluster&gt;<br \/>\ngluster&gt; volume status vol01<br \/>\nStatus of volume: vol01<br \/>\nGluster process Port Online Pid<\/p>\n<hr \/>\n<p>Brick 172.31.24.105:\/bricks\/www01 24010 Y 1900<br \/>\nBrick 172.31.2.117:\/bricks\/www02 24010 Y 1654<br \/>\nNFS Server on localhost 38467 Y 1906<br \/>\nSelf-heal Daemon on localhost N\/A Y 1912<br \/>\nNFS Server on 172.31.2.117 38467 Y 1660<br \/>\nSelf-heal Daemon on 172.31.2.117 N\/A Y 1662<\/p>\n<p>gluster&gt;<br \/>\ngluster&gt; exit<\/p>\n<p>\uff18\uff0e\u30dc\u30ea\u30e5\u30fc\u30e0\u30de\u30a6\u30f3\u30c8(www01\u203b\u7247\u5074\u3067\u5b9f\u65bd)<\/p>\n[root@~]#<br \/>\n[root@~]# mkdir \/glusterfs\/data<br \/>\n[root@~]# ls -ld \/glusterfs\/data<br \/>\ndrwxr-xr-x 2 root root 4096 Aug 11 22:52 \/glusterfs\/data<br \/>\n[root@~]#<br \/>\n[root@~]#<br \/>\n[root@~]# mount -t glusterfs [www01\u306eIP\u30a2\u30c9\u30ec\u30b9]:\/vol01 \/glusterfs\/data<br \/>\n[root@~]#<br \/>\n[root@~]#<br \/>\n[root@~]# df -h<br \/>\nFilesystem Size Used Avail Use% Mounted on<br \/>\n\/dev\/xvda1 25G 2.9G 22G 12% \/<br \/>\ndevtmpfs 994M 64K 994M 1% \/dev<br \/>\ntmpfs 1003M 0 1003M 0% \/dev\/shm<br \/>\n\/dev\/xvdb1 25G 44M 23G 1% \/bricks\/www01<br \/>\n[www01\u306eIP\u30a2\u30c9\u30ec\u30b9]:\/vol01 25G 44M 23G 1% \/glusterfs\/data<br \/>\n[root@ ~]#<\/p>\n<p>&nbsp;<\/p>\n<p>\uff19\uff0e\u30dc\u30ea\u30e5\u30fc\u30e0\u30de\u30a6\u30f3\u30c8(www02\u203b\u7247\u5074\u3067\u5b9f\u65bd)<\/p>\n[root@~]#<br \/>\n[root@~]# mkdir \/glusterfs\/data<br \/>\n[root@~]# ls -ld \/glusterfs\/data<br \/>\ndrwxr-xr-x 2 root root 4096 Aug 11 22:52 \/glusterfs\/data<br \/>\n[root@~]#<br \/>\n[root@~]#<br \/>\n[root@~]#<br \/>\n[root@~]# mount -t glusterfs [www02\u306eIP\u30a2\u30c9\u30ec\u30b9]:\/vol01 \/glusterfs\/data<br \/>\n[root@~]#<br \/>\n[root@~]#<br \/>\n[root@~]# df -h<br \/>\nFilesystem Size Used Avail Use% Mounted on<br \/>\n\/dev\/xvda1 25G 2.9G 22G 12% \/<br \/>\ndevtmpfs 994M 64K 994M 1% \/dev<br \/>\ntmpfs 1003M 0 1003M 0% \/dev\/shm<br \/>\n\/dev\/xvdb1 25G 44M 23G 1% \/bricks\/www02<br \/>\n[www02\u306eIP\u30a2\u30c9\u30ec\u30b9]:\/vol01 25G 44M 23G 1% \/glusterfs\/data<br \/>\n[root@~]#<\/p>\n<p>&nbsp;<\/p>\n<p>\uff11\uff10\uff0e\u78ba\u8a8d(www01\/02)<br \/>\n(www01)<br \/>\ntouch \/glusterfs\/data\/test.txt<br \/>\nls -l \/glusterfs\/data\/test.txt<br \/>\n[\u78ba\u8a8d]\u4f5c\u6210\u3055\u308c\u305f\u3053\u3068<\/p>\n<p>(www02)<br \/>\nls -l \/glusterfs\/data\/test.txt<br \/>\n[\u78ba\u8a8d]\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u3053\u3068<\/p>\n<p>rm -i \/glusterfs\/data\/test.txt<br \/>\nls -l \/glusterfs\/data\/test.txt<br \/>\n[\u78ba\u8a8d]\u524a\u9664\u3057\u305f\u3053\u3068<br \/>\n(www01)<br \/>\nls -l \/glusterfs\/data\/test.txt<br \/>\n[\u78ba\u8a8d]\u524a\u9664\u3055\u308c\u3066\u3044\u308b\u3053\u3068<\/p>\n<p>&nbsp;<\/p>\n<p>\uff11\uff11\uff0e\u81ea\u52d5\u30de\u30a6\u30f3\u30c8\u8a2d\u5b9a(www01\/02)<\/p>\n<p>\u30fbfstab\u3078\u8ffd\u8a18(www01)<br \/>\n=========\u4fee\u6b63\u3057\u305f\u30d5\u30a1\u30a4\u30eb=========<br \/>\n#<br \/>\nLABEL=\/ \/ ext4 defaults,noatime 1 1<br \/>\ntmpfs \/dev\/shm tmpfs defaults 0 0<br \/>\ndevpts \/dev\/pts devpts gid=5,mode=620 0 0<br \/>\nsysfs \/sys sysfs defaults 0 0<br \/>\nproc \/proc proc defaults 0 0<br \/>\n\/dev\/xvdb1 \/bricks\/www01 ext4 defaults,noatime 1 1<br \/>\n[www01\u306eIP]:\/vol01 \/glusterfs\/data glusterfs defaults,_netdev 0 0<\/p>\n<p>&nbsp;<\/p>\n<p>\u30fbfstab\u3078\u8ffd\u8a18(www02)<br \/>\n=========\u4fee\u6b63\u3057\u305f\u30d5\u30a1\u30a4\u30eb=========<br \/>\n#<br \/>\nLABEL=\/ \/ ext4 defaults,noatime 1 1<br \/>\ntmpfs \/dev\/shm tmpfs defaults 0 0<br \/>\ndevpts \/dev\/pts devpts gid=5,mode=620 0 0<br \/>\nsysfs \/sys sysfs defaults 0 0<br \/>\nproc \/proc proc defaults 0 0<br \/>\n\/dev\/xvdb1 \/bricks\/www02 ext4 defaults,noatime 1 1<br \/>\n[www02\u306eIP\u30a2\u30c9\u30ec\u30b9]:\/vol01 \/glusterfs\/data glusterfs defaults,_netdev 0 0<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u30fbnetfs\u6709\u52b9(www01\/www02)<\/p>\n<p>chkconfig<br \/>\nchkconfig netfs on<br \/>\nchkconfig<\/p>\n<p>\u30fbOS\u518d\u8d77\u52d5\u3057\u3066\u30de\u30a6\u30f3\u30c8\u3055\u308c\u3066\u3044\u308b\u3053\u3068<\/p>\n<p>&nbsp;<\/p>\n<p>\u3053\u308c\u3092\u3057\u306a\u3044\u3068OS\u518d\u8d77\u52d5\u3057\u3066\u3082\u30de\u30a6\u30f3\u30c8\u3055\u308c\u306a\u3044<\/p>\n<p>\u203b\u3081\u3063\u3061\u3083\u306f\u307e\u3063\u305f(\u6ce3)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u5b9f\u65bd\u3057\u305f\u3053\u3068\u3011 AWS\u74b0\u5883\u306eEC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067GlusterFS\u3092\u4f7f\u7528\u3057\u3066\u3001\u30b5\u30fc\u30d0\u306e\u5197\u9577\u5316\u3092\u884c\u3063\u305f\u6642\u306e\u30e1\u30e2\u306b\u306a\u308a\u307e\u3059 &nbsp; &nbsp; \u3010\u524d\u63d0\u6761\u4ef6\u3011 \u30fbAmazonLinux \u30fb\u8ffd\u52a0\u3067EBS\u3092\u3064\u3051\u3066\u304a\u304f(\u3053&#8230;<\/p>\n","protected":false},"author":1,"featured_media":223,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"4210","footnotes":""},"categories":[76],"tags":[],"class_list":{"0":"post-4210","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-glusterfs","8":"ja"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/4210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/comments?post=4210"}],"version-history":[{"count":11,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/4210\/revisions"}],"predecessor-version":[{"id":4247,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/4210\/revisions\/4247"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/media\/223"}],"wp:attachment":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/media?parent=4210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/categories?post=4210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/tags?post=4210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}