MFS分布式文件系统(内含安装包)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MFS分布式文件系统(内含安装包)相关的知识,希望对你有一定的参考价值。

简介:
MooseFS是一个具有容错性的网络分布式文件系统。它把数据分散存放在多个物理服务器上,而呈现给用户的则是一个统一的资源。
常规特征:
1、分层次的结构(目录树)
2、存储POSIX文件属性(权限、最后访问和修改时间)
3、支持特殊文件(块和字符设备、管道以及套接字)
4、符号连接和硬连接
5、对文件系统的访问可以通过IP地址和(或者)密码进行限制
独有特征:
1、高可靠(数据的多个拷贝被存储在不同的计算机上)
2、通过附加新的计算机或者硬盘可以实现容量的动态扩展
3、删除的文件可以根据一个可配置的时间周期进行保留(一个文件系统级别的回收站)
4、不受访问和写入影响的文件连贯快照
实验环境及安装包:
mfs1.6安装包:
链接:https://pan.baidu.com/s/1hWqTj6BnQUzW89eBtcBdEg
提取码:vaog
fuse2.9安装包:
链接:https://pan.baidu.com/s/1Su-Va9M3m0melIXTINcc4w
提取码:dyva

第一台服务器master 192.168.120.133
第二台服务器log 192.168.120.128
第三台服务器chunk01 192.168.120.129
第四台服务器chunk02 192.168.120.131
第五台服务器client 192.168.120.132
具体实验操作:(实验步骤虽然多,但前面都是重复操作)
---------------------------搭建Master服务器---------------------------
[[email protected] ~]# yum install gcc gcc-c++ zlib-devel -y
[[email protected] ~]# useradd -s /sbin/nologin mfs
[[email protected] ~]# mkdir /abc
[[email protected]ocalhost ~]# mount.cifs //192.168.100.10/rhel6 /abc
Password for [email protected]//192.168.100.10/rhel6:
[[email protected] ~]# cd /abc/Y2C
[[email protected] Y2C]# tar zxvf mfs-1.6.27-5.tar.gz -C /opt/
[[email protected] Y2C]# cd /opt/mfs-1.6.27/
[[email protected] mfs-1.6.27]# ./configure
--prefix=/usr/local/mfs
--with-default-user=mfs
--with-default-group=mfs
--disable-mfschunkserver
--disable-mfsmount
[[email protected] mfs-1.6.27]# make && make install
[[email protected] mfs-1.6.27]# cd /usr/local/mfs/etc/mfs/
[[email protected] mfs]# ls
mfsexports.cfg.dist mfsmaster.cfg.dist mfsmetalogger.cfg.dist mfstopology.cfg.dist
[[email protected] mfs]# cp mfsexports.cfg.dist mfsexports.cfg
[[email protected] mfs]# cp mfsmaster.cfg.dist mfsmaster.cfg
[[email protected] mfs]# cp mfstopology.cfg.dist mfstopology.cfg
[[email protected] mfs]# cd /usr/local/mfs/var/mfs/
[[email protected] mfs]# cp metadata.mfs.empty metadata.mfs
[[email protected] mfs]# /usr/local/mfs/sbin/mfsmaster start
[[email protected] mfs]# systemctl stop firewalld.service
[[email protected] mfs]# setenforce 0
[[email protected] mfs]# netstat -ntap | grep mfsmaster
tcp 0 0 0.0.0.0:9419 0.0.0.0: LISTEN 12020/mfsmaster
tcp 0 0 0.0.0.0:9420 0.0.0.0:
LISTEN 12020/mfsmaster
tcp 0 0 0.0.0.0:9421 0.0.0.0:* LISTEN 12020/mfsmaster

------------------搭建MetaLogger server-------------------

---------------第二台服务器上(日志配置)-------------------
[[email protected] ~]# yum install gcc gcc-c++ zlib-devel -y
[[email protected] ~]# systemctl stop firewalld.service
[[email protected] ~]# setenforce 0
[[email protected] ~]# useradd -s /sbin/nologin mfs
[[email protected] ~]# mkdir /abc
[[email protected] ~]# mount.cifs //192.168.100.10/rhel6 /abc
Password for [email protected]//192.168.100.10/rhel6:
[[email protected] ~]# cd /abc/Y2C/
[[email protected] Y2C]# tar zxvf mfs-1.6.27-5.tar.gz -C /opt/
[[email protected] Y2C]# cd /opt/mfs-1.6.27/
[[email protected] mfs-1.6.27]# ./configure
--prefix=/usr/local/mfs
--with-default-user=mfs
--with-default-group=mfs
--disable-mfschunkserver
--disable-mfsmount
[[email protected] mfs-1.6.27]# make && make install
[[email protected] mfs-1.6.27]# cd /usr/local/mfs/etc/mfs/
[[email protected] mfs]# cp mfsexports.cfg.dist mfsexports.cfg
[[email protected] mfs]# cp mfsmaster.cfg.dist mfsmaster.cfg
[[email protected] mfs]# cp mfsmetalogger.cfg.dist mfsmetalogger.cfg
[[email protected] mfs]# vim mfsmetalogger.cfg
#第15行 MASTER_HOST = 192.168.120.133 #(IP为第一台主服务器的)
[[email protected] mfs]# cd /usr/local/mfs/var/mfs/
[[email protected] mfs]# cp metadata.mfs.empty metadata.mfs
[[email protected] mfs]# /usr/local/mfs/sbin/mfsmetalogger start
working directory: /usr/local/mfs/var/mfs

----------------第三、四台(节点服务器1、2)两台同样操作-----------------------
[[email protected] ~]# yum install gcc gcc-c++ zlib-devel -y
[[email protected] ~]# systemctl stop firewalld.service
[[email protected] ~]# setenforce 0
[[email protected] ~]# useradd -s /sbin/nologin mfs
[[email protected] ~]# mkdir /abc
[[email protected] ~]# mount.cifs //192.168.100.10/rhel6 /abc
Password for [email protected]//192.168.100.10/rhel6:
[[email protected] ~]# cd /abc/Y2C
[[email protected] Y2C]# tar zxvf mfs-1.6.27-5.tar.gz -C /opt/
[[email protected] Y2C]# cd /opt/mfs-1.6.27/
[[email protected] mfs-1.6.27]# ./configure
--prefix=/usr/local/mfs
--with-default-user=mfs
--with-default-group=mfs
--disable-mfsmaster
--disable-mfsmount
[[email protected] mfs-1.6.27]# make && make install
[[email protected] mfs-1.6.27]# cd /usr/local/mfs/etc/mfs/
[[email protected] mfs]# cp mfschunkserver.cfg.dist mfschunkserver.cfg
[[email protected]st mfs]# cp mfshdd.cfg.dist mfshdd.cfg
[[email protected] mfs]# vim mfschunkserver.cfg

第12行 MASTER_HOST = 192.168.120.133

[[email protected] mfs]# vim mfshdd.cfg
#按G到末尾插入路径
/data

[[email protected] mfs]# mkdir /data
[[email protected] mfs]# chown -R mfs.mfs /data/
[[email protected] mfs]# /usr/local/mfs/sbin/mfschunkserver start
[[email protected] mfs]# netstat -ntap | grep mfschunkserve
tcp 0 0 0.0.0.0:9422 0.0.0.0:* LISTEN 44065/mfschunkserve
tcp 0 0 192.168.120.129:35272 192.168.120.133:9420 ESTABLISHED 44065/mfschunkserve

-------------------------------客户端----------------------------------------------
[[email protected] ~]# yum install gcc gcc-c++ zlib-devel -y
[[email protected] ~]# systemctl stop firewalld.service
[[email protected] ~]# setenforce 0
[[email protected] ~]# useradd -s /sbin/nologin mfs
[[email protected] ~]# mkdir /abc
[[email protected] ~]# mount.cifs //192.168.100.10/rhel6 /abc
Password for [email protected]//192.168.100.10/rhel6:
[[email protected] ~]# cd /abc/Y2C
[[email protected] Y2C]# tar zxvf fuse-2.9.2.tar.gz -C /opt/
[[email protected] Y2C]# cd /opt/fuse-2.9.2/
[[email protected] fuse-2.9.2]# ./configure
[[email protected] fuse-2.9.2]# make && make install
[[email protected] fuse-2.9.2]# vim /etc/profile
按G到末尾插入
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH

[[email protected] fuse-2.9.2]# source /etc/profile
[[email protected] fuse-2.9.2]# cd /abc/Y2C/
[[email protected] Y2C]# tar zxvf mfs-1.6.27-5.tar.gz -C /opt/
[[email protected] Y2C]# cd /opt/mfs-1.6.27/
[[email protected] mfs-1.6.27]# ./configure
--prefix=/usr/local/mfs
--with-default-user=mfs
--with-default-group=mfs
--disable-mfsmaster
--disable-mfschunkserver
--enable-mfsmount

[[email protected] mfs-1.6.27]# make && make install
[[email protected] mfs-1.6.27]# mkdir /opt/mfs
[[email protected] mfs-1.6.27]# modprobe fuse #加载fuse模块到内核
[[email protected] mfs-1.6.27]# /usr/local/mfs/bin/mfsmount /opt/mfs -H 192.168.120.133
mfsmaster accepted connection with parameters: read-write,restricted_ip ; root mapped to root:root
[[email protected] mfs-1.6.27]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root 20G 3.6G 17G 18% /
devtmpfs 897M 0 897M 0% /dev
tmpfs 912M 0 912M 0% /dev/shm
tmpfs 912M 9.1M 903M 1% /run
tmpfs 912M 0 912M 0% /sys/fs/cgroup
/dev/mapper/centos-opt 5.0G 76M 5.0G 2% /opt
/dev/mapper/centos-home 10G 37M 10G 1% /home
/dev/sda1 1012M 179M 834M 18% /boot
tmpfs 183M 4.0K 183M 1% /run/user/42
tmpfs 183M 20K 183M 1% /run/user/0
/dev/sr0 4.3G 4.3G 0 100% /run/media/root/CentOS 7 x86_64
//192.168.100.10/rhel6 311G 227G 85G 73% /abc
192.168.120.133:9421 32G 0 32G 0% /opt/mfs ###挂载过来了

------------------优化客户端-------------------------------

[[email protected] mfs-1.6.27]# vim /etc/profile
export PATH=/usr/local/mfs/bin:$PATH

[[email protected] mfs-1.6.27]# source /etc/profile
[[email protected] mfs-1.6.27]# cd /opt/mfs
[[email protected] mfs]# echo "this is abc" > test.txt
[[email protected] mfs]# mfsgetgoal -r 2 /opt/mfs #复制两份文件

-------------MASTER-server---------------启动监控程序------
[[email protected] mfs]# /usr/local/mfs/sbin/mfscgiserv
lockfile created and locked
starting simple cgi server (host: any , port: 9425 , rootpath: /usr/local/mfs/share/mfscgi)
----------------打开浏览器访问-------------------------
访问主服务器:http://192.168.120.133:9425
技术分享图片
#两个节点:
技术分享图片
#客户端:
技术分享图片
#存储位置:
技术分享图片

以上是关于MFS分布式文件系统(内含安装包)的主要内容,如果未能解决你的问题,请参考以下文章

轻松部署MFS分布式文件系统 内附源码包

Linux MFS分布式文件系统介绍和安装

Yum简单安装MFS分布式文件系统

Yum简单安装MFS分布式文件系统

MFS分布式文件系统安装配置

分布式文件系统之MFS