系統(tǒng)Centos 7
MfsMaster:192.168.1.100
MfsChukserver1:192.168.1.110
MfsChukserver2:192.168.1.120
MfsMetalogger:192.168.1.130
MfsClient:192.168.1.140
1.安裝Mfs軟件包
MfsMaster:
curl "http://ppa.moosefs.com/RPM-GPG-KEY-MooseFS" > /etc/pki/rpm-gpg/RPM-GPG-KEY-MooseFS
curl "http://ppa.moosefs.com/MooseFS-3-el7.repo" > /etc/yum.repos.d/MooseFS.repo
yum install moosefs-master moosefs-cgi moosefs-cgiserv moosefs-cli
MfsChukserver1提岔,MfsChukserver2:
curl "http://ppa.moosefs.com/RPM-GPG-KEY-MooseFS" > /etc/pki/rpm-gpg/RPM-GPG-KEY-MooseFS
curl "http://ppa.moosefs.com/MooseFS-3-el7.repo" > /etc/yum.repos.d/MooseFS.repo
yum install moosefs-chunkserver
MfsMetalogger:
curl "http://ppa.moosefs.com/RPM-GPG-KEY-MooseFS" > /etc/pki/rpm-gpg/RPM-GPG-KEY-MooseFS
curl "http://ppa.moosefs.com/MooseFS-3-el7.repo" > /etc/yum.repos.d/MooseFS.repo
yum install moosefs-metalogger
2.修改Hosts文件,在所有節(jié)點(diǎn)上為192.168.1.100增加一個(gè)別名mfsmaster
vim /etc/hosts
192.168.1.100 mfsmaster
wq!
3.啟動(dòng)程序(Master)
systemctl start moosefs-master
systemctl start moosefs-cgiserv
[root@MoosefsMaster mfs]# netstat -lntp | grep mfs
tcp 0 0 0.0.0.0:9419 0.0.0.0:* LISTEN 1031/mfsmaster
tcp 0 0 0.0.0.0:9420 0.0.0.0:* LISTEN 1031/mfsmaster
tcp 0 0 0.0.0.0:9421 0.0.0.0:* LISTEN 1031/mfsmaster
mfsmaster開(kāi)啟三個(gè)端口:客戶端連接9421端口坊秸,監(jiān)聽(tīng)9422端口;數(shù)據(jù)節(jié)點(diǎn)9420端口
4.修改MfsMetalogger配置文件,使其連接到Master,并啟動(dòng)
vim /etc/mfs/mfsmetalogger.cfg
MASTER_HOST = mfsmaster # 這里是需要連接的 mfs master server 的地址
systemctl start moosefs-metalogger
5.修改MfsChukserver1,MfsChukserver2
分別是 mfschunkserver.cfg 和 mfshdd.cfg
配置mfschunkserver.cfg
vim /etc/mfs/mfschunkserver.cfg
MASTER_HOST = mfsmaster # 該地址為 Master Server 的IP地址或者主機(jī)名
配置mfshdd.cfg
mfshdd.cfg該文件用來(lái)設(shè)置你將 Chunk Server 的哪個(gè)目錄共享出去給 Master Server進(jìn)行管理
mkdir /mfsshare
chown -R mfs.mfs /mfsshare
vim /etc/mfs/mfshdd.cfg
/mfsshare
wq!
systemctl start moosefs-chunkserver
ls /mfsshare
00 10 20 30 40 50 60 70 80 90 A0 B0 C0 D0 DF EF FF
01 11 21 31 41 51 61 71 81 91 A1 B1 C1 D1 E0 F0
02 12 22 32 42 52 62 72 82 92 A2 B2 C2 D2 E1 F1
03 13 23 33 43 53 63 73 83 93 A3 B3 C3 D3 E2 F2
04 14 24 34 44 54 64 74 84 94 A4 B4 C4 D4 E3 F3
05 15 25 35 45 55 65 75 85 95 A5 B5 C5 D5 E4 F4
06 16 26 36 46 56 66 76 86 96 A6 B6 C6 D6 E5 F5
07 17 27 37 47 57 67 77 87 97 A7 B7 C7 D7 E6 F6
08 18 28 38 48 58 68 78 88 98 A8 B8 C8 D8 E7 F7
09 19 29 39 49 59 69 79 89 99 A9 B9 C9 D9 E8 F8
0A 1A 2A 3A 4A 5A 6A 7A 8A 9A AA BA CA DA E9 F9
0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AB BB CB DB EA FA
0C 1C 2C 3C 4C 5C 6C 7C 8C 9C AC BC CC DC EB FB
0D 1D 2D 3D 4D 5D 6D 7D 8D 9D AD BD CD DD EC FC
0E 1E 2E 3E 4E 5E 6E 7E 8E 9E AE BE CE DE ED FD
6.Mfs客戶端安裝掛載
yum install moosefs-client
mfsmount /mnt -H 192.168.10.2 # 使用 -p 后面磕瓷,下面會(huì)提示輸入密碼
[root@MfsClient ~]# df -TH
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda2 ext4 20G 2.4G 16G 14% /
tmpfs tmpfs 981M 0 981M 0% /dev/shm
/dev/sda1 ext4 508M 34M 448M 7% /boot
192.168.1.100:9421 fuse.mfs 21G 856M 20G 5% /mnt
開(kāi)機(jī)掛載
echo '/usr/bin/mfsmount /mfsshare -H 192.168.1.100 ' >> /etc/rc.local