角色 | IPAdress |
---|---|
主控服务器(Master server) | 10.90.0.10 |
主控备份服务器(Metalogger server) | 10.90.0.20 |
存储块服务器(Chunk server) | 10.90.0.30 |
客户端主机(Clients) | 10.90.0.40 |
主控服务器
1. 添加用户和组 [root@mfsmaster software]# groupadd mfs [root@mfsmaster software]#useradd -s /sbin/nologin -g mfs -M mfs 2. 下载软件包并解压安装 [root@mfsmaster software]#wget http://ppa.moosefs.com/src/moosefs-3.0.88-1.tar.gz [root@mfsmaster packages]# tar xzf moosefs-3.0.88-1.tar.gz [root@mfsmaster packages]#cd moosefs-3.0.88-1 3. 安装master [root@mfsmaster packages]#./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs [root@mfsmaster packages]# make && make install 成功安装master后,系统会在/usr/local/mfs/etc 目录自动生成样例配置文件,这些样例配置文件是以.dist后缀命名,这里将借用这些样例文件作为MooseFS主控服务器的目标配置文件 [root@mfsmaster packages]# cd /usr/local/mfs/etc/mfs [root@mfsmaster packages]#cp mfsmaster.cfg.sample mfsmaster.cfg [root@mfsmaster packages]# cp mfsmetalogger.cfg.sample mfsmetalogger.cfg [root@mfsmaster packages]#cp mfsexports.cfg.sample mfsexports.cfg [root@mfsmaster packages]#cp mfstopology.cfg.sample mfstopology.cfg 在配置文件mfsexports.cfg文件的第一行,先取消注释,然后把星号(*)改成10.10.11.0/8,以便我们可以得到下面的文本行 10.90.0.0/16 / rw,alldirs,admin,maproot=0:0 启动master服务 [root@mfsmaster packages]# /usr/local/mfs/sbin/mfsmaster 启动报错及解决 [root@mfsmaster etc]# /usr/local/mfs/sbin/mfsmaster open files limit has been set to: 16384 working directory: /usr/local/mfs/var/mfs lockfile created and locked initializing mfsmaster modules ... exports file has been loaded topology file has been loaded loading metadata ... can't find metadata.mfs - try using option '-a' init: metadata manager failed !!! error occurred during initialization - exiting [root@mfsmaster etc]cd /usr/local/mfs/var/&& mv metadata.mfs.empty metadata.mfs 运行CGI监控服务,这样就可以用浏览器查看整个MooseFS的运行情况 [root@mfsmaster packages]#/usr/local/mfs/sbin/mfscgiserv 在浏览器中输入:http://10.10.0.10:9425 就能看到master的运行情况,效果如下图所示 插图等待。。。。。
备份服务器Backup server(Metalogger server)安装
[root@backup_server ~]# groupadd mfs && useradd -s /sbin/nologin -g mfs -M mfs [root@backup_server pacakges]# tar xzf moosefs-3.0.88-1.tar.gz [root@backup_server pacakges]# cd moosefs-3.0.88 [root@backup_server moosefs-3.0.88]# ./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs --sysconfdir=/usr/local/mfs --localstatedir=/usr/local/mfs/data --enable-mfsmount [root@backup_server moosefs-3.0.88]# make && make install [root@backup_server etc]# cd /usr/local/mfs/etc/mfs [root@backup_server mfs]# cp mfsmetalogger.cfg.sample mfsmetalogger.cfg [root@backup_server mfs]# vim /etc/hosts #添加10.90.0.10 mfsmaster [root@backup_server mfs]# /usr/local/mfs/sbin/mfsmetalogger
存储块服务器Chunk servers 安装
[root@chunk_server ~]# groupadd mfs && useradd -s /sbin/nologin -g mfs -M mfs [root@chunk_server pacakges]# tar xzf moosefs-3.0.88-1.tar.gz [root@chunk_server pacakges]# cd moosefs-3.0.88 [root@chunk_server moosefs-3.0.88]# ./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs --sysconfdir=/usr/local/mfs --localstatedir=/usr/local/mfs/data --enable-mfsmount --disable-mfsmaster [root@chunk_server moosefs-3.0.88]# make && make install [root@chunk_server mfs]# vim /etc/hosts #添加10.90.0.10 mfsmaster [root@chunk_server etc]# cd /usr/local/mfs/etc/mfs [root@chunk_server mfs]# cp mfschunkserver.cfg.sample mfschunkserver.cfg [root@chunk_server mfs]#cp mfshdd.cfg.sample mfshdd.cfg [root@chunk_server mfs]#vim mfshdd.cfg#添加共享空间 在配置文件mfshdd.cfg中,我们给出了用于客户端挂接MooseFS分布式文件系统根分区所使用的共享空间位置。建议在Chunk server上划分单独的空间给MooseFS使用。这样做的好处是便于管理剩余的空间,此处我们假定要使用两个贡献点/mnt/mfschunks1 和/mnt/mfschunks2 [root@chunk_server mfs]#mkdir /mnt/{mfschunks1,mfschunks2} [root@chunk_server mfs]#chown mfs.mfs /mnt/{mfschunks1,mfschunks2} 启动 chunk serve [root@chunk_server mfs]# /usr/local/mfs/sbin/mfschunkserver
客户端安装
为了挂接基于MooseFS 分布式文件,客户端主机必须安装FUSE软件包(FUSE版本号至少2.6,推荐版本号大于2.7的fuse)。如果系统没安装fuse,你必须手动对其进行安装。在所以客户端上执行如下命令:
#安装FUSE
[root@client_001 ~]#yum -y install fuse fuse-devel
[root@client_001 ~]# groupadd mfs && useradd -s /sbin/nologin -g mfs -M mfs
[root@client_001 pacakges]# tar xzf moosefs-3.0.88-1.tar.gz
[root@client_001 pacakges]# cd moosefs-3.0.88
[root@client_001 moosefs-3.0.88]# ./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs --enable-mfsmount --disable-mfsmaster --disable-mfschunkserver
[root@client_001 moosefs-3.0.88]# make && make install
[root@client_001 mfs]# vim /etc/hosts #添加10.90.0.10 mfsmaster
测试挂载
[root@client_001 mfs]#mkdir /software/mfs_test
/usr/local/mfs/sbin/mount.moosefs -H msmaster /software/mfs_test