分布式文件体系MooseFS的布置装置51CTO博客 - 娱乐之横扫全球

分布式文件体系MooseFS的布置装置51CTO博客

2019年04月01日08时43分53秒 | 作者: 南蓉 | 标签: 文件,装置,体系 | 浏览: 719

概述:
MooseFS是一种分布式文件体系,MooseFS文件体系结构包含以下四种人物:
1 办理效劳器managing server (master)
2 元数据日志效劳器Metalogger server(Metalogger)
3 数据存储效劳器data servers (chunkservers)
4 客户机挂载运用client computers

各种人物作用:
1 办理效劳器:担任各个数据存储效劳器的办理,文件读写调度,文件空间收回以及康复.多节点复制
2 元数据日志效劳器: 担任备份master效劳器的改变日志文件,文件类型为changelog_ml.*.mfs,以便于在master server出问题的时分顶替其进行作业
3 数据存储效劳器:担任衔接办理效劳器,遵从办理效劳器调度,供给存储空间,并为客户供给数据传输.
4 客户端: 经过fuse内核接口挂接远程办理效劳器上所办理的数据存储效劳器,.看起来同享的文件体系和本地unix文件体系运用相同的作用.

装置环境
Master Server
master               10.0.0.141    Centos5.5(64X)

Metalogger Server
metalogger           10.0.0.142    Centos5.5(64X)

Chunk Servers
chunk01              10.0.0.143    Centos5.5(64X)
chunk02              10.0.0.144    Centos5.5(64X)

Client Server
client01              10.0.0.150    Centos5.5(64X)
client02              10.0.0.155    Centos5.5(64X)


master 装置(10.0.0.141)

mkdir -p /root/tools/moosefs/
cd /root/tools/moosefs/

/usr/sbin/groupadd -g 660 mfs
/usr/sbin/useradd -g mfs mfs -u 660 -s /sbin/nologin

wget http://www.moosefs.org/tl_files/mfscode/mfs-1.6.20-2.tar.gz
tar zxvf mfs-1.6.20-2.tar.gz
cd mfs-1.6.20-2
./configure \
prefix=/elain/apps/mfs \
sysconfdir=/elain/apps/mfs/etc \
localstatedir=/elain/apps/mfs/lib \
with-default-user=mfs \
with-default-group=mfs \
disable-mfschunkserver \
disable-mfsmount
make && make install
cd ..

cd /elain/apps/mfs/etc/
cp mfsmaster.cfg.dist mfsmaster.cfg
cp mfsmetalogger.cfg.dist mfsmetalogger.cfg
cp mfsexports.cfg.dist mfsexports.cfg

vi mfsexports.cfg

10.0.0.0/24             /       rw,alldirs,maproot=0

cd /elain/apps/mfs/lib/mfs
cp metadata.mfs.empty metadata.mfs

vi /etc/hosts

10.0.0.141         mfsmaster

运转mfs效劳
/elain/apps/mfs/sbin/mfsmaster start

master metaloggers module: listen on *:9419
master chunkservers module: listen on *:9420
main master server module: listen on *:9421

运转监控渠道
/elain/apps/mfs/sbin/mfscgiserv

starting simple cgi server (host: any , port: 9425 , rootpath: /elain/apps/mfs/share/mfscgi)

这时,可经过浏览器拜访:http://10.0.0.141:9425/  检查 master 的运转状况

-
metalogger   装置(10.0.0.142)

cd /root/tools/
/usr/sbin/groupadd -g 660 mfs
/usr/sbin/useradd -g mfs mfs -u 660 -s /sbin/nologin

wget http://www.moosefs.org/tl_files/mfscode/mfs-1.6.20-2.tar.gz
tar zxvf mfs-1.6.20-2.tar.gz
cd mfs-1.6.20-2
./configure \
prefix=/elain/apps/mfs \
sysconfdir=/elain/apps/mfs/etc \
localstatedir=/elain/apps/mfs/lib \
with-default-user=mfs \
with-default-group=mfs \
disable-mfschunkserver \
disable-mfsmount
make && make install
cd ..

cd /elain/apps/mfs/etc/
cp mfsmetalogger.cfg.dist mfsmetalogger.cfg

vi /etc/hosts

10.0.0.141         mfsmaster

/elain/apps/mfs/sbin/mfsmetalogger start


Chunk01  装置(10.0.0.143)

cd /root/tools/

/usr/sbin/groupadd -g 660 mfs
/usr/sbin/useradd -g mfs mfs -u 660 -s /sbin/nologin

wget http://www.moosefs.org/tl_files/mfscode/mfs-1.6.20-2.tar.gz
tar zxvf mfs-1.6.20-2.tar.gz
cd mfs-1.6.20-2
./configure \
prefix=/elain/apps/mfs \
sysconfdir=/elain/apps/mfs/etc \
localstatedir=/elain/apps/mfs/lib \
with-default-user=mfs \
with-default-group=mfs \
disable-mfsmaster
make && make install
cd ..

cd /elain/apps/mfs/etc/
cp mfschunkserver.cfg.dist mfschunkserver.cfg
cp mfshdd.cfg.dist mfshdd.cfg

vi /etc/hosts

10.0.0.141         mfsmaster

mkdir /data/mfschunks{1,2}
chown -R mfs:mfs /data/mfschunks{1,2}

vi /elain/apps/mfs/etc/mfshdd.cfg

/data/mfschunks1
/data/mfschunks2

/elain/apps/mfs/sbin/mfschunkserver start

-
Chunk02  装置(10.0.0.144)
cd  /root/tools/
/usr/sbin/groupadd -g 660 mfs
/usr/sbin/useradd -g mfs mfs -u 660 -s /sbin/nologin

wget http://www.moosefs.org/tl_files/mfscode/mfs-1.6.20-2.tar.gz
tar zxvf mfs-1.6.20-2.tar.gz
cd mfs-1.6.20-2
./configure \
prefix=/elain/apps/mfs \
sysconfdir=/elain/apps/mfs/etc \
localstatedir=/elain/apps/mfs/lib \
with-default-user=mfs \
with-default-group=mfs \
disable-mfsmaster
make && make install
cd ..

cd /elain/apps/mfs/etc/
cp mfschunkserver.cfg.dist mfschunkserver.cfg
cp mfshdd.cfg.dist mfshdd.cfg

vi /etc/hosts

10.0.0.141         mfsmaster

mkdir /data/mfschunks{1,2}
chown -R mfs:mfs /data/mfschunks{1,2}

vi /elain/apps/mfs/etc/mfshdd.cfg

/data/mfschunks1
/data/mfschunks2

/elain/apps/mfs/sbin/mfschunkserver start

-
Client01 Server装置 (10.0.0.150)

cd /root/tools/
/usr/sbin/groupadd -g 660 mfs
/usr/sbin/useradd -g mfs mfs -u 660 -s /sbin/nologin

wget http://cdnetworks-kr-2.dl.sourceforge.net/project/fuse/fuse-2.X/2.8.5/fuse-2.8.5.tar.gz
tar -zxvf fuse-2.8.5.tar.gz
cd fuse-2.8.5
./configure
make
make install
cd ..

运转以下export指令,不然挂载moosefs体系会失利

vi /etc/profile
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
source /etc/profile

cd /root/tools/moosefs/
wget http://www.moosefs.org/tl_files/mfscode/mfs-1.6.20-2.tar.gz
tar -zxvf mfs-1.6.20-2.tar.gz
cd mfs-1.6.20-2
./configure \
prefix=/elain/apps/mfs \
sysconfdir=/elain/apps/mfs/etc \
localstatedir=/www/lib \
with-default-user=mfs \
with-default-group=mfs \
enable-mfsmount
make && make install
cd ..

vi /etc/hosts

10.0.0.141         mfsmaster

挂接操作
mkdir -p /elain/data/htdocs/elain/upload
/elain/apps/mfs/bin/mfsmount /elain/data/htdocs/elain/upload/ -H mfsmaster
umount -l /elain/data/htdocs/elain/upload

-
Client02 Server装置 (10.0.0.155)
cd /root/tools/
/usr/sbin/groupadd -g 660 mfs
/usr/sbin/useradd -g mfs mfs -u 660 -s /sbin/nologin

wget http://cdnetworks-kr-2.dl.sourceforge.net/project/fuse/fuse-2.X/2.8.5/fuse-2.8.5.tar.gz
tar zxvf fuse-2.8.5.tar.gz
cd fuse-2.8.5
./configure
make
make install
cd ..

运转以下export指令,不然挂载moosefs体系会失利

vi /etc/profile
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
source /etc/profile

#加载fuse
modprobe fuse

[root@web1 ~#]lsmod |grep fuse                                                                                            
fuse                   83057  8

wget http://www.moosefs.org/tl_files/mfscode/mfs-1.6.20-2.tar.gz
tar -zxvf mfs-1.6.20-2.tar.gz
cd mfs-1.6.20-2
./configure \
prefix=/elain/apps/mfs \
sysconfdir=/elain/apps/mfs/etc \
localstatedir=/elain/apps/mfs/lib \
with-default-user=mfs \
with-default-group=mfs \
enable-mfsmount
make && make install
cd ..

vi /etc/hosts

10.0.0.141         mfsmaster

挂接操作
mkdir -p /mnt/mfs
/elain/apps/mfs/bin/mfsmount /mnt/mfs -H mfsmaster

装置结束。

中止 MooseFS
为了安全中止 MooseFS 集群,主张履行如下的过程:

umount -l /mnt/mfs                                                  #客户端卸载MooseFS 文件体系
/elain/apps/mfs/sbin/mfschunkserver stop                            #中止 chunk server 进程
/elain/apps/mfs/sbin/mfsmetalogger stop                             #中止 metalogger 进程
/elain/apps/mfs/sbin/mfsmaster stop                                 #中止主控 master server 进程

安全的发动MooseFS集群

/elain/apps/mfs/sbin/mfsmaster start                                #发动 master 进程
/elain/apps/mfs/sbin/mfschunkserver start                           #发动 chunkserver 进程
/elain/apps/mfs/sbin/mfsmetalogger start                            #发动 metalogger 进程
/elain/apps/mfs/bin/mfsmount /mnt/mfs -H  master                    #客户端挂载 MooseFS 文件体系
 

MooseFS 指令的运用方法及参阅文档:
http://www.moosefs.org/reference-guide.html#using-moosefs
http://www.moosefs.org/moosefs-faq.html

FAQ:
/elain/apps/mfs/bin/mfsmount /elain/data/htdocs/elain/upload -H master
mfsmaster accepted connection with parameters: read-write,restricted_ip ; root mapped to root:root
fuse: device not found, try modprobe fuse first
error in fuse_mount
答:modprobe fuse
[root@client01 ~]# lsmod |grep fuse
fuse                   83057  6

转载请注明: 转载自http://www.elain.org

本文链接地址:分布式文件体系MooseFS的布置装置

版权声明
本文来源于网络,版权归原作者所有,其内容与观点不代表娱乐之横扫全球立场。转载文章仅为传播更有价值的信息,如采编人员采编有误或者版权原因,请与我们联系,我们核实后立即修改或删除。

猜您喜欢的文章