四、MFS 客户端的安装及配置
1.)安装MFS 客户端
Mfsmount 需要依赖FUSE,因此需要先安装好fuse!
[root@mfs-client ~]# wget
[root@mfs-client ~]# tar zxf fuse-2.8.5.tar.gz
[root@mfs-client ~]# cd fuse-2.8.5
[root@mfs-client fuse-2.8.5]#./configure
[root@mfs-client fuse-2.8.5]# make;make install
[root@mfs-client fuse-2.8.5]# yum -y install fuse-devel
[root@mfs-client fuse-2.8.5]# modprobe fuse
[root@mfs-client fuse-2.8.5]# cd
PS:这里不yum安装fuse-devl时后面安装mfs时启用 --enable-mfsmount 时会报错!
2.)安装MFS 客户端程序
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
如果不执行这个操作,在后面安装MFS 的过程中,执行命令
./configure --enable-mfsmount 时可能出现"checking for FUSE... no configure:
error: mfsmount build was forced, but fuse development package is not
installed"这样的错误,而不能正确安装MFS 客户端程序。
[root@mfs-client ~]# wget
[root@mfs-client ~]# groupadd -g 1000 mfs
[root@mfs-client ~]# useradd -u 1000 -g mfs -s /sbin/nologin mfs
[root@mfs-client ~]# tar zxf mfs-1.6.20-2.tar.gz
[root@mfs-client ~]# cd mfs-1.6.20-2
[root@mfs-client mfs-1.6.20-2]# ./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs --enable-mfsmount
[root@mfs-client mfs-1.6.20-2]# make;make install
[root@mfs-client mfs-1.6.20-2]# chown -R mfs.mfs /usr/local/mfs
[root@mfs-client mfs-1.6.20-2]# echo "export PATH=$PATH:/usr/local/mfs/bin" >> /etc/profile
[root@mfs-client mfs-1.6.20-2]# source /etc/profile
[root@mfs-client mfs-1.6.20-2]# cd
3.)挂载
挂载前,我们PING下元数据服务器上的VIP
[root@mfs-client ~]# ping 192.168.8.210
[root@mfs-client ~]# mkdir –p /mnt/mfs
[root@mfs-client ~]# mfsmount /mnt/mfs/ -H 192.168.8.210
[root@mfs-client ~]# mount
/dev/sda2 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda5 on /data type ext3 (rw)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
mfs#192.168.8.210:9421 on /mnt/mfs type fuse (rw,nosuid,nodev,allow_other,default_permissions)
[root@mfs-client ~]# df –h
[root@mfs-client mfs]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 3.8G 2.4G 1.3G 65% /
/dev/sda5 4.9G 139M 4.5G 3% /data
/dev/sda1 122M 18M 98M 16% /boot
tmpfs 144M 0 144M 0% /dev/shm
mfs#192.168.8.210:9421
17G 0 17G 0% /mnt/mfs