zfs-test-0.7.1-1.el7.x86_64.rpm
OST需要下载的源码包
kmod-lustre-2.10.1-1.el7.x86_64.rpmkmod-lustre-osd-ldiskfs-2.10.1-1.el7.x86_64.rpmkmod-lustre-osd-zfs-2.10.1-1.el7.x86_64.rpmkmod-lustre-tests-2.10.1-1.el7.x86_64.rpmlibnvpair1-0.7.1-1.el7.x86_64.rpmlibuutil1-0.7.1-1.el7.x86_64.rpmlibzfs2-0.7.1-1.el7.x86_64.rpmlibzfs2-devel-0.7.1-1.el7.x86_64.rpmlibzpool2-0.7.1-1.el7.x86_64.rpmlustre-2.10.1-1.el7.x86_64.rpmlustre-debuginfo-2.10.1-1.el7.x86_64.rpmlustre-dkms-2.10.1-1.el7.noarch.rpmlustre-iokit-2.10.1-1.el7.x86_64.rpmlustre-osd-ldiskfs-mount-2.10.1-1.el7.x86_64.rpmlustre-osd-zfs-mount-2.10.1-1.el7.x86_64.rpmlustre-resource-agents-2.10.1-1.el7.x86_64.rpmlustre-tests-2.10.1-1.el7.x86_64.rpmsha256sumspl-0.7.1-1.el7.x86_64.rpmspl-dkms-0.7.1-1.el7.noarch.rpmzfs-0.7.1-1.el7.x86_64.rpmzfs-dkms-0.7.1-1.el7.noarch.rpm
client需要下载的源码包 kmod-lustre-client-2.10.1-1.el7.x86_64.rpm kmod-lustre-client-tests-2.10.1-1.el7.x86_64.rpm lustre-client-2.10.1-1.el7.x86_64.rpm lustre-client-debuginfo-2.10.1-1.el7.x86_64.rpm lustre-client-dkms-2.10.1-1.el7.noarch.rpm lustre-client-tests-2.10.1-1.el7.x86_64.rpm lustre-iokit-2.10.1-1.el7.x86_64.rpm 三、lustre安装 服务端安装(1台MDT和2台OST) [root@centos1 ~]# mkdir /opt/lustre [root@centos1 ~]# cd /opt/lustre/ 下载上述源码包 [root@centos1 lustre]# ls kmod-lustre-2.10.1-1.el7.x86_64.rpm lustre-osd-ldiskfs-mount-2.10.1-1.el7.x86_64.rpm kmod-lustre-osd-ldiskfs-2.10.1-1.el7.x86_64.rpm lustre-dkms-2.10.1-1.el7.noarch.rpm ........ 使用yum安装源码包及其相关依赖 [root@centos1 lustre]# yum -y install kernel-3.10.0-693.2.2.el7_lustre.x86_64.rpm ........ 注:每个角色下的源码包都要全部安装 安装完毕重启一下 [root@centos1 lustre]# reboot 加载lustre和ldiskfs模块 [root@centos1 lustre]# modprobe lustre [root@centos1 lustre]# modprobe ldiskfs 安装客户端(client) [root@centos4 ~]# mkdir /opt/lustre [root@centos4 ~]# cd /opt/lustre/ 下载上述源码包 [root@centos4 lustre]# yum -y install lustre-client-2.10.1-1.el7.x86_64.rpm........
注:每个角色下的源码包要全部安装
安装完毕重启一下 [root@centos4 lustre]# reboot 加载lustre模块 [root@centos6 lustre]# modprobe lustre 四、lustre配置 Lustre是基于内核的分布式文件系统,而不是像其它一些用户态的分布式文件系统那样直接建立在ext3或者是ext4之上。Lustre需要对磁盘进行格式化,并且在格式化的过程中进行参数配置。这里分别给前3台机器添加一块20G硬盘作为测试用,添加的硬盘显示为/dev/sdb ,最后一台机器作为客户端 1. 在MDS服务器(192.168.11.148)上执行以下操作 [root@centos1 lustre]# mkfs.lustre --fsname=lustrefs --mgs --mdt --index=0 /dev/sdb 参数解释: fsname指定的是创建lustre时的文件系统名 mgs指定该机器为元数据服务器,即该机器为mds mdt指定/dev/sdb为元数据实际数据存储位置 至于index则指定该mgs的索引号,mgs可以设置主备模式,但mdt需要在主备mds之间共享 [root@centos1 lustre]# mount.lustre /dev/sdb /mnt/mdt 2. 在两台OST服务器(192.168.11.149/150)上执行以下操作 [root@centos2 lustre]# mkfs.lustre --fsname=lustrefs --mgsnode=192.168.11.148@tcp --ost --index=0 /dev/sdb 参数解释: fsname不多说 mgsnode指定oss请求元数据节点,并指明访问协议tcp ost指定/dev/sdb为存储数据的实际位置 index这个参数可以看到两个节点是不一样的 //整个系统的实际容量是两台OST的/dev/sdb的容量 [root@centos2 lustre]# mount.lustre /dev/sdb /mnt/ost0 [root@centos3 lustre]# mount.lustre /dev/sdb /mnt/ost1 查看一下容量 [root@centos2 ~]# df -h 文件系统 容量 已用 可用 已用% 挂载点 /dev/mapper/cl-root 37G 4.1G 33G 11% / devtmpfs 907M 0 907M 0% /dev tmpfs 920M 0 920M 0% /dev/shm tmpfs 920M 8.4M 912M 1% /run tmpfs 920M 0 920M 0% /sys/fs/cgroup /dev/sda1 1014M 235M 780M 24% /boot /dev/sdb 20G 46M 19G 1% /mnt/ost0 tmpfs 184M 0 184M 0% /run/user/0 3.客户端(192.168.11.151)挂载 [root@centos4 lustre]# mount.lustre 192.168.11.148@tcp:/lustrefs /mnt/lustre 查看系统容量 [root@centos4 lustre]# df -hT 文件系统 类型 容量 已用 可用 已用% 挂载点 /dev/mapper/cl-root xfs 37G 4.2G 33G 12% / devtmpfs devtmpfs 910M 0 910M 0% /dev tmpfs tmpfs 920M 0 920M 0% /dev/shm tmpfs tmpfs 920M 8.4M 912M 1% /run tmpfs tmpfs 920M 0 920M 0% /sys/fs/cgroup /dev/sda1 xfs 1014M 186M 829M 19% /boot 192.168.11.148@tcp:/lustrefs lustre 39G 91M 37G 1% /mnt/lustre tmpfs tmpfs 184M 0 184M 0% /run/user/0 可以看到客户端挂载后,可用容量为两台OST的/dev/sdb的总容量 4. 测试 客户端测试: [root@centos4 lustre]# dd if=/dev/zero of=/mnt/test.img bs=1M count=4500 记录了4500+0 的读入 记录了4500+0 的写出 4718592000字节(4.7 GB)已复制,7.40257 秒,637 MB/秒 其中一台OST服务器测试 [root@centos2 lustre]# dd if=/dev/zero of=/tmp/test.img bs=1M count=4500 记录了4500+0 的读入 记录了4500+0 的写出 4718592000字节(4.7 GB)已复制,6.74598 秒,699 MB/秒 MDT上测试 [root@centos1 lustre]# dd if=/dev/zero of=/tmp/test.img bs=1M count=4500 记录了4500+0 的读入 记录了4500+0 的写出 4718592000字节(4.7 GB)已复制,7.06079 秒,668 MB/秒 一台普通电脑PC测试 shown@localhost ~ $ dd if=/dev/zero of=/tmp/test.img bs=1M count=4500 记录了4500+0 的读入 记录了4500+0 的写出 4718592000 bytes (4.7 GB, 4.4 GiB) copied, 43.889 s, 108 MB/s 可以看出lustre是相当的快 五、番外篇 lustre文件系统非常快,但它没有很好的数据冗余保护机制,部分节点宕机的话很容易造成数据丢失。 推荐一个提高lustre系统数据安全性的架构,即底层直接配置两个lustre系统,数据一式两份,这样子的架构是一个成本比较低的提高lustre数据安全性的方案。并且我所知道的是已经有不少朋友都是这么设计的。不过这样做需要花费成本的地方在于数据如何正确的同步(此方案未经论证) 六、参考资料 http://www.blogchong.com/?mod=pad&act=view&id=27 https://www.watters.ws/mediawiki/index.php/Lustre_Install_Notes http://www.weiruoyu.cn/?p=524 https://jira.hpdd.intel.com/browse/LU-9801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&showAll=true https://dev.uabgrid.uab.edu/wiki/LustreQuickStart