安装过程:master红色字体步骤在每台服务器上都需要进行的过程,其他服务此过程省略 管理服务器(master):
解压安装包:
[root@localhost ~]# tar zxvf moosefs-2.0.68-1.tar.gz -C /usr/src/
[root@localhost ~]# cd /usr/src/moosefs-2.0.68
部分选项配置:可以根据需要和功能选择具体配置
[root@localhost moosefs-2.0.68]# ./configure -h
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--with-default-user=USER Choose default user to run daemons as
--with-default-group=GROUP Choose default group to run daemons as
--disable-mfsmaster Do not build mfsmaster
--disable-mfsmetalogger Do not build mfsmetalogger
--disable-mfssupervisor Do not build mfssupervisor
--disable-mfschunkser Do not build mfschunkserver
--disable-mfsmount Do not build mfsmount
--disable-mfscgi Do not install CGI scripts
--disable-mfscli Do not install CLI script
--disable-mfscgiserv Do not install CGI server
--disable-mfsnetdump Do not build mfsnetdump 编译开始前需先安装下列软件
[root@localhost moosefs-2.0.68]# yum install -y gcc zlib-devel fuse-devel 创建服务所需的用户和组
[root@localhost mfs]# vim /etc/hosts
192.168.1.1 mfsmaster 启动服务(服务启动metadata.mfs文件是必须的,有时当服务停止后metadata.mfs文件会自动转为metadata.mfs.back,再次启动服务时需复制metadata.mfs.bak为metadata.mfs)
[root@localhost ~]# /usr/local/moosefs/sbin/mfsmaster start
open files limit has been set to: 4096
working directory: /var/lib/mfs
lockfile created and locked
initializing mfsmaster modules ...
exports file has been loaded
mfstopology configuration file (/etc/mfstopology.cfg) not found - using defaults
loading metadata ...
metadata file has been loaded
no charts data file - initializing empty charts
master metaloggers module: listen on *:9419 masteryumetaloggers通信的端口
master chunkservers module: listen on *:9420 master与chunkserver通信的端口
main master server module: listen on *:9421 master监听的端口
mfsmaster daemon initialized properly 运行CGI监控服务监控 MooseFS 当前运行状态
[root@localhost ~]# /usr/local/moosefs/sbin/mfscgiserv
lockfile created and locked
starting simple cgi server (host: any , port: 9425 , rootpath: /usr/local/moosefs/share/mfscgi) 在浏览器地址栏输入 http://192.168.1.1:9425 即可查看 master 的运行情况
备份服务器:
用来安装 metalogger 的主机,在性能上应该比 master 强大(至少有更多的内存)。一旦主控
服务器 master 失效, 只要导入 changelogs 到元数据文件,备份服务器 metalogger 将能接替发生
故障的 master,行使管理服务器的职能
安装过程与master步骤相同,仅配置文件不同,启动服务
[root@localhost mfs]# cp mfsmetalogger.cfg.dist mfsmetalogger.cfg
[root@localhost ~]# /usr/local/moosefs/sbin/mfsmetalogger start
open files limit has been set to: 4096
working directory: /var/lib/mfs
lockfile created and locked
initializing mfsmetalogger modules ...
mfsmetalogger daemon initialized proper
[root@localhost mfs]# vim mfshdd.cfg
/mnt/mfschunk1
/mnt/mfschunk2 启动服务
[root@localhost ~]# /usr/local/moosefs/sbin/mfschunkserver start
open files limit has been set to: 16384
working directory: /var/lib/mfs
lockfile created and locked
setting glibc malloc arena max to 8
setting glibc malloc arena test to 1
initializing mfschunkserver modules ...
hdd space manager: data folders '/mnt/mfschunk2/' and '/mnt/mfschunk1/' are on the same physical device (could lead to unexpected behaviours)
hdd space manager: path to scan: /mnt/mfschunk2/
hdd space manager: path to scan: /mnt/mfschunk1/
hdd space manager: start background hdd scanning (searching for available chunks)
main server module: listen on *:9422
no charts data file - initializing empty charts
mfschunkserver daemon initialized properly 通过浏览器访问 http://192.168.1.1:9425/ 可以看见这个 MooseFS 系统的全部信息,