配置MFS:
安装并启动MFS
[root@server1 3.0.103]# ls
moosefs-cgi-3.0.103-1.rhsystemd.x86_64.rpm
moosefs-cgiserv-3.0.103-1.rhsystemd.x86_64.rpm
moosefs-chunkserver-3.0.103-1.rhsystemd.x86_64.rpm
moosefs-cli-3.0.103-1.rhsystemd.x86_64.rpm
moosefs-client-3.0.103-1.rhsystemd.x86_64.rpm
moosefs-master-3.0.103-1.rhsystemd.x86_64.rpm
moosefs-metalogger-3.0.103-1.rhsystemd.x86_64.rpm
[root@server1 3.0.103]# yum install -y moosefs-master-3.0.103-1.rhsystemd.x86_64.rpm moosefs-cli-3.0.103-1.rhsystemd.x86_64.rpm moosefs-cgiserv-3.0.103-1.rhsystemd.x86_64.rpm moosefs-cgi-3.0.103-1.rhsystemd.x86_64.rpm
[root@server1 mfs]# systemctl start moosefs-master
[root@server1 mfs]# systemctl start moosefs-cgiserv
[root@server1 mfs]# netstat -anltp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:9419 0.0.0.0:* LISTEN 2128/mfsmaster
tcp 0 0 0.0.0.0:9420 0.0.0.0:* LISTEN 2128/mfsmaster
tcp 0 0 0.0.0.0:9421 0.0.0.0:* LISTEN 2128/mfsmaster
tcp 0 0 0.0.0.0:9425 0.0.0.0:* LISTEN 2144/python
给server1 添加域名解析 mfsmaster
[root@server1 mfs]# vim /etc/hosts
172.25.24.1 server1 mfsmaster
将chunkserver包传给server2 server3
在server2中安装并添加 mfsmaster域名解析
[root@server1 3.0.103]# scp moosefs-chunkserver-3.0.103-1.rhsystemd.x86_64.rpm server2:
[root@server2 ~]# yum install -y moosefs-chunkserver-3.0.103-1.rhsystemd.x86_64.rpm
[root@server2 ~]# vim /etc/hosts
172.25.24.1 server1 mfsmaster
建立一个分区
[root@server2 ~]# mkfs.xfs /dev/vda
[root@server2 ~]# fdisk /dev/vda
[root@server2 ~]# mkfs.xfs /dev/vda1
[root@server2 ~]# mkdir /mnt/chunk1/
[root@server2 ~]# mount /dev/vda1 /mnt/chunk1/
[root@server2 ~]# chown mfs.mfs /mnt/chunk1/
[root@server2 ~]# vim /etc/mfs/mfshdd.cfg
35 /mnt/chunk1
[root@server2 ~]# vim /etc/hosts
172.25.24.1 server1 mfsmaster
[root@server2 ~]# systemctl start moosefs-chunkserver
server3 安装 修改解析 启动服务
[root@server3 ~]# rpm -ivh moosefs-chunkserver-3.0.103-1.rhsystemd.x86_64.rpm
[root@server3 ~]# mkdir /mnt/chunk2
[root@server3 ~]# chown mfs.mfs /mnt/chunk2/
[root@server3 ~]# vim /etc/mfs/mfshdd.cfg
35 /mnt/chunk2
[root@server3 ~]# vim /etc/hosts
172.25.24.1 server1 mfsmaster
[root@server3 ~]# systemctl start moosefs-chunkserver
可在网页172.25.24.1:9425 中查看
在真机中安装client包
[root@foundation24 3.0.103]# yum install moosefs-client-3.0.103-1.rhsystemd.x86_64.rpm
修改mfsmount文件 将mfs挂载到/mnt/mfs 添加域名解析
[root@foundation24 3.0.103]# cd /etc/mfs/
[root@foundation24 mfs]# ls
mfsmount.cfg mfsmount.cfg.sample
[root@foundation24 mfs]# vim mfsmount.cfg
16 /mnt/mfs
[root@foundation24 mfs]# vim /etc/hosts
172.25.24.1 server1 mfsmaster
[root@foundation24 mfs]# mkdir /mnt/mfs
[root@foundation24 mfs]# mfsmount
mfsmaster accepted connection with parameters: read-write,restricted_ip,admin ; root mapped to root:root
[root@foundation24 mfs]# df
mfsmaster:9421 39816192 1626496 38189696 5% /mnt/mfs
设置goal值 代表复制几次文件
ot@foundation24 mfs]# mkdir dir1
[root@foundation24 mfs]# mkdir dir2
[root@foundation24 mfs]# mfsgetgoal dir1
dir1: 2
[root@foundation24 mfs]# mfsgetgoal dir2
dir2: 2
[root@foundation24 mfs]# mfssetgoal -r 1 dir1/
dir1/:
inodes with goal changed: 1
inodes with goal not changed: 0
inodes with permission denied: 0
[root@foundation24 mfs]# cp /etc/passwd dir1/
[root@foundation24 dir1]# mfsfileinfo passwd
passwd:
chunk 0: 0000000000000001_00000001 / (id:1 ver:1)
copy 1: 172.25.24.3:9422 (status:VALID)
[root@foundation24 dir1]# cp /etc/fstab ../dir2/
[root@found