海运的博客

CentOS6.2安装ZFS文件系统组RAID-Z使用SSD缓存

发布时间:November 4, 2012 // 分类:备份存储 // 3 Comments

CentOS服务器安装编译环境及相应组件:

yum groupinstall "Development Tools"
yum install kernel-devel zlib-devel libuuid-devel libblkid-devel libselinux-devel parted lsscsi nano mdadm bc

安装ZFS内核模块:

wget http://github.com/downloads/zfsonlinux/spl/spl-0.6.0-rc10.tar.gz
wget http://github.com/downloads/zfsonlinux/zfs/zfs-0.6.0-rc10.tar.gz
tar xvzpf spl-0.6.0-rc10.tar.gz
tar xvzpf zfs-0.6.0-rc10.tar.gz
cd spl-0.6.0-rc10
./configure
make rpm
rpm -Uvh *.x86_64.rpm
cd ..
cd zfs-0.6.0-rc10
./configure
make rpm
rpm -Uvh *.x86_64.rpm
cd ..

加载ZFS模块:

modprobe zfs

查看当前硬盘分区,四块1T硬盘准备组成RAID-Z。

[root ~]# fdisk -l | grep GB
Disk /dev/sde: 120.0 GB, 120034123776 bytes
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes

新建ZFS池并组成RAID:

zpool create storage raidz -f sda sdb sdc sdd

开机挂载新建ZFS池:

echo "zfs mount storage" >> /etc/rc.local

查看SSD硬盘分区信息:

fdisk -l /dev/sde
 
Disk /dev/sde: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002824e
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sde1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sde2              26        2115    16777216   8e  Linux LVM
/dev/sde3            2115        2376     2097152   82  Linux swap / Solaris
/dev/sde4            2376       14594    98140632    5  Extended
/dev/sde5            2376       14594    98139136   83  Linux

SSD分区/dev/sde2设置为ZFS缓存:

zpool add storage cache sde2

查看ZFS状态:

zpool status
  pool: storage
 state: ONLINE
 scan: none requested
config:
 
    NAME        STATE     READ WRITE CKSUM
    storage     ONLINE       0     0     0
      raidz1-0  ONLINE       0     0     0
        sda     ONLINE       0     0     0
        sdb     ONLINE       0     0     0
        sdc     ONLINE       0     0     0
        sdd     ONLINE       0     0     0
    cache
      sde2      ONLINE       0     0     0

ZFS设置优化其它参数:

zfs set compression=on storage
zfs set dedup=on storage
zfs set atime=off storage

其它使用SSD缓存可参考:CentOS安装FlashCache使用SSD缓存

分类
最新文章
最近回复
  • 海运: 地址格式和udpxy一样,udpxy和msd_lite能用这个就能用。
  • 1: 怎么用 编译后的程序在家里路由器内任意一台设备上运行就可以吗?比如笔记本电脑 m参数是笔记本的...
  • 孤狼: ups_status_set: seems that UPS [BK650M2-CH] is ...
  • 孤狼: 擦。。。。apcupsd会失联 nut在冲到到100的时候会ONBATT进入关机状态,我想想办...
  • 海运: 网络,找到相应的url编辑重发请求,firefox有此功能,其它未知。
  • knetxp: 用浏览器F12网络拦截或监听后编辑重发请求,修改url中的set为set_super,将POS...
  • Albert: 啊啊啊啊啊啊啊啊啊 我太激动了,终于好了英文区搜索了半天,翻遍了 pve 论坛没找到好方法,博...
  • jiangker: good, very helpful to me
  • fengfeng: N1 armbian 能有编译下内核吗。。我要开启can 不懂怎么操作
  • 1: 方法一ngtcp2要改下:./configure PKG_CONFIG_PATH=/usr/l...