Moosefs文件系统在Linux下的安装、配置和使用

  • 安装配置主服务器

  • 安装MFS文件系统

下载地址:https://pan.baidu.com/s/1v_Q20XFWI66Qu2DKlpV6Ig

提取码:v0wq

(1)解压源代码

[[email protected]]# tar -zxf moosefs-3.0.tar.gz //解压至当前目录

(2)配置安装环境

[[email protected]]# cd moosefs-3.0 //切换至源码目录下 [[email protected]]# ./configure -prefix=/usr/local/mfs -with-default-user=root -with-default-group=root --enable-mfsmount //-prefix:配置安装目录 //--enable-mfsmount:设置为可挂载

(3)编译安装

[[email protected]]# make //编译 [[email protected]]# make install //安装

可能遇到问题

  1. 配置安装环境时,出现错误“checking for FUSE… no configure: error:

mfsmount build was forced, but fuse development package is not installed ”

问题原因:可能是fuse未安装,也可能是没有配置环境变量

下载地址:https://pan.baidu.com/s/1t7gNMwWBTeSCWM904b9Ikg

提取码:9eqx

解决方案:安装fuse

[[email protected]]# ./configure //配置 [[email protected]]# make //编译 [[email protected]]# make install //安装 [[email protected]]# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH //配置环境变量

2.配置环境时,出现错误“configure: error: zlib development library not found”

下载地址:https://pan.baidu.com/s/1Cp7I9YCORmSGtIqu9gO8Dg

提取码:3y5d

问题原因:未安装zlib库

解决方案:安装zlib库

[[email protected]]# ./configure //配置 [[email protected]]# make //编译 [[email protected]]# make install //安装

3.配置环境时,出现错误“mfsnetdump needs pcap library”

问题原因:未安装pcap库

下载地址:https://pan.baidu.com/s/1KPcvx38ohx9KAG5T5UFZxA

提取码:4eqv

解决方案:安装libpacap

[[email protected]]# ./configure //配置 [[email protected]]# make //编译 [[email protected]]# make install //安装

  • 安装pcap时,出现错误“configure: error: Neither flex nor lex was found.”

下载地址:https://pan.baidu.com/s/1a-U8nge4nPQypR5JQelQoQ

提取码:enp9

问题原因:未安装flex

解决方法:安装flex

[[email protected]]# ./configure //配置 [[email protected]]# make //编译 [[email protected]]# make install //安装

  • 安装pcap时,出现错误“configure: error: yacc is insufficient to compile libpcap. libpcap requires Bison, a newer version of Berkeley YACC with support for reentrant parsers, or another YACC compatible with them.”

下载地址:https://pan.baidu.com/s/18RiJpO8Urvzq1PRN1-sEIg

提取码:tbgp

问题原因:未安装YACC编译器或版本过老

解决方案:安装更新bison

[[email protected]]# ./configure //配置 [[email protected]]# make //编译 [[email protected]]# make install //安装

  • 配置mfsmaster.cfg

(1)切换至安装目录下,拷贝配置文件

[[email protected]]# cd /usr/local/mfs/etc/mfs [[email protected]]# cp mfschunkserver.cfg.sample mfschunkserver.cfg [[email protected]]# cp mfsexports.cfg.sample mfsexports.cfg [[email protected]]# cp mfshdd.cfg.sample mfshdd.cfg [[email protected]]# cp mfsmaster.cfg.sample mfsmaster.cfg [[email protected]]# cp mfsmetalogger.cfg.sample mfsmetalogger.cfg [[email protected]]# cp mfsmount.cfg.sample mfsmount.cfg [[email protected]]# cp mfstopology.cfg.sample mfstopology.cfg

(2)编辑配置文件

[[email protected]]# vi mfsmaster.cfg //此处无需修改

Moosefs文件系统在Linux下的安装、配置和使用

  • 配置mfsexports.cfg

(1)编辑配置文件

[[email protected]]# vi mfsmaster.cfg //此处无需修改

Moosefs文件系统在Linux下的安装、配置和使用

 

第一部分:客户端IP地址

第二部分:被挂载的目录

第三部分:客户端拥有的权限

地址可以指定的几种变现形式:

                       *                                所有的IP地址

                        n.n.n.n                       单个IP地址(这个实验讲述的就是这个形式)

                       n.n.n.n/b                     ip网络地址/位数掩码

                       f.f.f.f-t.t.t.t                    ip段

目录部分需要注意两点:

                            /                        表示MooseFS根:

                            *                         表示MFSMETA文件系统

权限部分:

                          ro                              只读模式共享

                          rw                            读写的方式共享

                          alldirs                        允许挂载任何指定的子目录

                          maproot                     映射为root,还是指定的用户

                          password                    指定客户端密码

  • 检查安装情况

(1)启动master server

切换至安装目录下sbin目录,执行如下命令:

[[email protected]]# ./mfsmaster start -a

Moosefs文件系统在Linux下的安装、配置和使用

 

(2)启动CGI服务

执行如下命令:

[[email protected]]# ./mfscgiserv

Moosefs文件系统在Linux下的安装、配置和使用

 

(3)启动浏览器(IP:9245/mfs.cgi)

Moosefs文件系统在Linux下的安装、配置和使用

 

  • 安装配置备份服务器

基本安装同上第1步

  • 安装配置元数据日志服务器

(1)配置 mfslogger.cfg

Moosefs文件系统在Linux下的安装、配置和使用

将MASTER_HOST改为主服务器IP

(2)启动元数据日志服务

切换至安装目录sbin目录下,执行如下命令:

[[email protected]]# ./mfsmaster start -a //启动主服务 [[email protected]]# ./mfscgiserv //启动CGI服务 [[email protected]]# ./mfsmetalogger //启动日志服务

(3)查看日志生成情况

切换安装目录下的var/mfs目录下,执行如下命令:

[[email protected]]# ls

Moosefs文件系统在Linux下的安装、配置和使用

 

  • 安装配置数据存储服务器

(1)配置mfschunkerserver.cfg

Moosefs文件系统在Linux下的安装、配置和使用

MASTER_HOST改为主服务器IP

(2)配置mfshdd.cfg

Moosefs文件系统在Linux下的安装、配置和使用

建立挂载目录

(3)启动数据存储服务

切换至安装目录sbin目录下,执行如下命令:

[[email protected]]# ./mfsmaster start -a //启动主服务 [[email protected]]# ./mfscgiserv //启动CGI服务 [[email protected]]# ./mfschunkserver //启动日志服务

Moosefs文件系统在Linux下的安装、配置和使用