ZFS on LinuxãAmazon Linuxã¨EBSã§è©¦ãã¦ã¿ã
ä¹ ãã¶ãã«èªåã®ToDoãªã¹ããè¦ã¦ã¿ãã¨ãæ¨å¹´ã®10æãããã«ç»é²ããããããªãã®ãããã¾ããã
ããã£ããZFS Daysã«åå ããã®ã ããããã°ã«ä½ãæ¸ãã
ãããããã ãã¿ããªä»ã®äººã«è¦ããããªã大äºãªãã®ãZFSã«ä¿åãã¦ããªã¼ã
ããã°ãæ¸ãã¾ã§ãåå¼·ä¼ãªã®ã§ãåå¼·ä¼ã®ã¯ãã¼ã¸ã³ã°ã®çºã«ãZFS on LinuxをAmazon Linuxã«ã¤ã³ã¹ãã¼ã«ãã¦ã¿ã¾ããã
â»å®ããªã£ãã¨ã¯ãããæ¤è¨¼ã®çºã«HDDãä½åãè²·ãã¾ããï¼ï¼
â»ä»åã¯1å°ã®EC2ã¤ã³ã¹ã¿ã³ã¹ã«10GiBã®EBSã3ã¤ã¢ã¿ããããé常ã«ã±ãèãæ§æã§ã
こちらã®ãã¼ã¸ã«è©³ãã解説ããã¦ã¾ãã
å¿ è¦ãªããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã«
$ sudo yum -y update && sudo reboot $ sudo yum -y groupinstall "Development Tools" "Development Libraries" $ sudo yum -y install kernel kernel-devel zlib-devel libuuid-devel lsscsi parted
SPL(Solaris Porting Layer)ãã¤ã³ã¹ãã¼ã«
$ mkdir ./src $ cd ./src $ wget http://github.com/downloads/zfsonlinux/spl/spl-0.6.0-rc6.tar.gz $ tar zxvf ./spl-0.6.0-rc6.tar.gz $ cd ./spl-0.6.0-rc6 $ ./configure $ make rpm $ sudo rpm -ivh ./*x86_64.rpm
ZFSãã¤ã³ã¹ãã¼ã«
$ cd ~/src $ wget http://github.com/downloads/zfsonlinux/zfs/zfs-0.6.0-rc6.tar.gz $ tar zxvf ./zfs-0.6.0-rc6.tar.gz $ cd ./zfs-0.6.0-rc6 $ ./configure $ make rpm $ sudo rpm -ivh ./*.x86_64.rpm
zfsã®ãã¼ã«ãä½æãã
$ sudo ls -alh /dev/sd* lrwxrwxrwx 1 root root 5 2æ 20 15:46 2012 /dev/sda1 -> xvda1 lrwxrwxrwx 1 root root 4 2æ 20 15:46 2012 /dev/sdf -> xvdf lrwxrwxrwx 1 root root 4 2æ 20 15:46 2012 /dev/sdg -> xvdg lrwxrwxrwx 1 root root 4 2æ 20 15:46 2012 /dev/sdh -> xvdh
ã¹ãã¬ã¼ã¸ãã¼ã«ã«EBSã追å ãã¦RAIDZãæ§æ
$ sudo zpool create mypool raidz /dev/xvdf /dev/xvdg /dev/xvdh
ä½æãããã¼ã«ã®ä¸è¦§ã確èª
$ sudo zpool list NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT mypool 29.8G 172K 29.7G 0% 1.00x ONLINE -
ä½æãããã¼ã«ã®ç¶æ ã確èª
$ sudo zpool status pool: mypool state: ONLINE scan: none requested config: NAME STATE READ WRITE CKSUM mypool ONLINE 0 0 0 raidz1-0 ONLINE 0 0 0 xvdf ONLINE 0 0 0 xvdg ONLINE 0 0 0 xvdh ONLINE 0 0 0 errors: No known data errors
dataã¨ãããã¡ã¤ã«ã·ã¹ãã ãä½æ
$ sudo zfs create mypool/data
ãã¦ã³ãç¶æ ã確èª
$ df -h Filesystem Size Used Avail Use% ãã¦ã³ãä½ç½® /dev/xvda1 7.9G 1.6G 6.3G 20% / tmpfs 299M 0 299M 0% /dev/shm mypool 20G 128K 20G 1% /mypool
ã¤ã³ã¹ãã¼ã«ãããèªåèµ·åãè¨å®ãããã¿ããã§åèµ·åãã¦ãèªåçã«ãã¦ã³ããããã¿ãã
$ sudo chkconfig --list zfs zfs 0:off 1:off 2:on 3:on 4:on 5:on 6:off
追加ディスクを既存のRAIDZ構成に追加出来るとå°ããã¤EBSã追å åºæ¥ã¦ããã«é¢ç½ããã ãã©ãªã¼ã