MooseFS的简介、部署及应用(3)

注:mfschunkserver 服务器的主配置很简单,没有特殊要求只需要修改MASTER_HOST的地址即可。存储分区的配置选择一个独立的磁盘分区(分区必须大于1G)。

启动mfschunkserver

[root@chunkserver-1~]#/usr/local/mfs/sbin/mfschunkserver

[root@chunkserver-1~]#netstat-an|grep9420

tcp00192.168.108.161:15099192.168.108.108:9420ESTABLISHED

同时查看系统日志

Oct1417:53:45vm_web_1mfschunkserver[1992]:connecting…

Oct1417:53:45vm_web_1mfschunkserver[1992]:connectedtoMaster

说明已经和master服务器成功连接

再查看master的日志查看

Oct1417:59:00experimentmfsmaster[10132]:server1(192.168.108.161):usedspace:560484352(0GB),totalspace:4226125824(3GB),usage:13.26%

Oct1417:59:00experimentmfsmaster[10132]:total:usedspace:560484352(0GB),totalspace:4226125824(3GB),usage:13.26%

同样也说明有一台 chunkserver 与自己连接,并给出了使用空间和剩余磁盘空间

剩余的3台mfschunkserver利用同样的方法配置好后启动mfschunkserver程序,这时候再查看master系统日志:

Oct1615:27:00experimentmfsmaster[10132]:inodes:9

Oct1615:27:00experimentmfsmaster[10132]:dirnodes:1

Oct1615:27:00experimentmfsmaster[10132]:filenodes:8

Oct1615:27:00experimentmfsmaster[10132]:chunks:18

Oct1615:27:00experimentmfsmaster[10132]:chunkstodelete:0

Oct1615:27:00experimentmfsmaster[10132]:chunkserversstatus:

Oct1615:27:00experimentmfsmaster[10132]:server1(192.168.108.162):usedspace:924282880(0GB),totalspace:4226125824(3GB),usage:21.87%

Oct1615:27:00experimentmfsmaster[10132]:server2(192.168.108.164):usedspace:924282880(0GB),totalspace:4226125824(3GB),usage:21.87%

Oct1615:27:00experimentmfsmaster[10132]:server3(192.168.108.163):usedspace:924282880(0GB),totalspace:4226125824(3GB),usage:21.87%

Oct1615:27:00experimentmfsmaster[10132]:server4(192.168.108.161):usedspace:924028928(0GB),totalspace:4226125824(3GB),usage:21.86%

Oct1615:27:00experimentmfsmaster[10132]:total:usedspace:3696877568(3GB),totalspace:16904503296(15GB),usage:21.87%

这里可以看到有4台chunkserver已经连接到了master

客户端挂载与工具使用

192.168.108.109

挂载MFS

mfsmount

[root@client~]#mkdir/mnt/mfs

[root@client~]#mfsmount-h192.168.108.108

*mfsmount默认情况下将分区加载到/mnt/mfs目录下。如果想加载到其他目录请利用-w参数。

mfsmount–help

usage:/usr/local/mfs/bin/mfsmount[-r][-m][-c][-v0..2][-hmasterhost][-pmasterport][-lpath][-wmountpoint]

r:readonlymode

m:mountmetadata

c:allowusingcache

v:verboselevel

defaults:

h:mfsmaster

p:9421

l:/

w:/mnt/mfs

修改MFS文件删除延迟时间

mfsrsettrashtime

[root@client~]#mfsrsettrashtime100/mnt/mfs/

/mnt/mfs/:

inodeswithtrashtimechanged:1(1)

inodeswithtrashtimenotchanged:0(0)

inodeswithpermissiondenied:0(0)

查看MFS文件删除延迟时间

mfsrgettrashtime

#mfsrgettrashtime/mnt/mfs/

/mnt/mfs/:

directorieswithtrashtime100:1(1)

mfssettrashtime

[root@client~]#mfssettrashtime60/mnt/mfs/

/mnt/mfs/:60

mfsgettrashtime

[root@client~]#mfsgettrashtime/mnt/mfs/

/mnt/mfs/:60

设置文件保存份数

mfssetgoal

[root@client~]#mfssetgoal4/mnt/mfs/

/mnt/mfs/:4

查看文件保存保存数

mfsgetgoal

[root@client~]#mfsgetgoal/mnt/mfs/

/mnt/mfs/:4

mfsrsetgoal

[root@client~]#mfsrsetgoal3/mnt/mfs/

/mnt/mfs/:

inodeswithgoalchanged:1(1)

inodeswithgoalnotchanged:0(0)

inodeswithpermissiondenied:0(0)

mfsrgetgoal

[root@client~]#mfsrgetgoal/mnt/mfs/

/mnt/mfs/:

directorieswithgoal3:1(1)

文件(文件夹)的查看(检查)命令

先生成1个10M的文件

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/93eb010aba42b105cb19e6c332253e8a.html