目的
由于根据资料介绍,reiserfs和reiser4文件系统对于小文件专门进行优化,对小文件进行合并存储,据说小文件性能很好。所以我们就搭建相关的环境进行验证。
总体分析
Centos
Reiserf
安装
rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpmyum install kmod-reiserfs reiserfs-utils -y
使用
mkreiserfs -f /dev/sddmount /dev/sdd /mnt/sdd
存在的问题
Reiser4
存在的问题
Ubuntu
Reiserfs
安装
sudo apt install reiserfsprogs
创建
sudo mkfs.reiserfs -f /dev/sdb
使用
sudo mount -o user_xattr /dev/sdb /mnt/sdb
存在的问题
创建glusterfs卷时,出现如下问题:
newfs@newfs-desktop:/mnt$ sudo gluster volume create vol1 replica 3 newfs:/mnt/sda newfs:/mnt/sdb newfs:/mnt/sdd force
volume create: vol1: failed: Glusterfs is not supported on brick: newfs:/mnt/sda.
Setting extended attributes failed, reason: 不支持的操作.
Reiser4
因为reiser4本身没有在Linux主干代码分支发布,只是以补丁的形势出现在网上,所以必须自己打补丁,重新编译内核,并且安装内核。而这一切都带来相当的麻烦。
内核编译
参考:https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel
主要步骤:
apt-get source linux
sudo apt-get build-dep linux-image-$(uname -r)
chmod a+x debian/rules
chmod a+x debian/scripts/*
chmod a+x debian/scripts/misc/*
fakeroot debian/rules clean
fakeroot debian/rules editconfigs
fakeroot debian/rules clean
fakeroot debian/rules binary-headers binary-generic binary-perarch
内核安装
我选择的是ubuntu 18.10
sudo dpkg -i linux-headers-4.18.0-15_4.18.0-15.16_all.deb
sudo dpkg -i linux-headers-4.18.0-15-generic_4.18.0-15.16_amd64.deb
sudo dpkg -i linux-modules-4.18.0-15-generic_4.18.0-15.16_amd64.deb
sudo dpkg -i linux-image-unsigned-4.18.0-15-generic_4.18.0-15.16_amd64.deb
sudo dpkg -i linux-modules-extra-4.18.0-15-generic_4.18.0-15.16_amd64.deb
安装工具包
sudo apt install reiser4progs
创建reiser4文件系统盘
sudo mount -t reiser4 /dev/sda /mnt/sda
存在的问题
和reiserfs一样,同样存在创建glusterfs卷失败的问题。而且还不能使用setfattr进行设置属性。
newfs@newfs:/mnt$ sudo gluster volume create vol1 replica 3 newfs:/mnt/sda newfs:/mnt/sdb newfs:/mnt/sdd force
volume create: vol1: failed: Glusterfs is not supported on brick: newfs:/mnt/sda.
Setting extended attributes failed, reason: 不支持的操作.
测试
拷贝大量的小文件,性能比没有改进的glusterfs+xfs好。但是和网络配置有关系。如果要使用这个文件系统,建议进行排除网络因素的对比测试。