测试:MFS测试:
# mkdir hello{1,2}
# ls
hello1 hello2
# mfsdirinfo hello1/
hello1/:
inodes: 1
directories: 1
files: 0
chunks: 0
length: 0
size: 0
realsize: 0
# mfssetgoal -r 3 hello1/ 设置备份次数
hello1/:
inodes with goal changed: 1
inodes with goal not changed: 0
inodes with permission denied: 0
# mfsgetgoal hello1/ 查看文件备份数
hello1/: 3
# mfsgetgoal hello2
hello2: 1
#cp /etc/fstab hello1/
# cp /etc/passwd hello2/
# mfsfileinfo /hello/fstab 查看文件具体信息
fstab:
chunk 0: 000000000000000B_00000001 / (id:11 ver:1)
copy 1: 192.168.2.82:9422
copy 2: 192.168.2.90:9422
# mfscheckfile passwd
测试存储关系:
# mfsfileinfo fstab
fstab:
chunk 0: 000000000000000B_00000001 / (id:11 ver:1)
copy 1: 192.168.2.90:9422
[root@node5 hello1]# mfsfileinfo ../hello2/passwd
../hello2/passwd:
chunk 0: 000000000000000C_00000001 / (id:12 ver:1)
no valid copies !!!
客户端:误删除文件(不小心删除/mnt/mfs/hello*/passwd)
# mfsmount -m /mnt/test/ -H mfsmaster 恢复目录挂载到mfsmaster上
mfsmaster accepted connection with parameters: read-write,restricted_ip
# mount
#cd /mnt/test/
## mfscheckfile passwd
# mv 00000005\|hello2\|passwd undel/
直接恢复到之前的mfs目录中
# umount /mnt/meta/
mfschunk-server可以自动检测客户端的配置文件:
# mfschunkserver stop
在客户端重新拷贝文件,
#cp /etc/inittab /mnt/mfs/hello1
#mfsgetgoal hello1/fstab 查看文件份数
#mfsgetgoal hello1/inittab
# mfsfileinfo inittab 刚开始只有一个chukserver,只能保存一份
开启chunkserver
#mfschunkserver
# mfsfileinfo inittab 查看文件的备份数,恢复成chunkserver的数
inittab:
chunk 0: 0000000000000006_00000001 / (id:6 ver:1)
copy 1: 192.168.2.184:9422
copy 2: 192.168.2.185:9422
注意:
在mfsmaster中,正常运行时,数据文件为metadata.mfs.back
当主机出现故障,数据文件会保存成metadata.mfs
使用非正常关闭,(kill -9 pid) 数据文件将不会恢复
# mfsmetarestore -a- 非正常启动后会丢失metadata.mfs文件,必须恢复一下
然后重新启动mfsmaster(mfsmaster启动必须有metadata.mfs文件)
MooseFS 的详细介绍:请点这里
MooseFS 的下载地址:请点这里
本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-06/103607.htm
