三.存儲服務器Chunk Server的安裝.
[root@lg src]# groupadd mfs
[root@lg src]# useradd -g mfs mfs
[root@lg src]# tar zxvf mfs-1.6.15.tar.gz
[root@lg src]# cd mfs-1.6.15
[root@lg mfs-1.6.15]# ./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs --disable-mfsmaster
[root@lg mfs-1.6.15]# make && make install
[root@lg src]# useradd -g mfs mfs
[root@lg src]# tar zxvf mfs-1.6.15.tar.gz
[root@lg src]# cd mfs-1.6.15
[root@lg mfs-1.6.15]# ./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs --disable-mfsmaster
[root@lg mfs-1.6.15]# make && make install
準備Chunk Server所需要的配置文件
[root@lg mfs-1.6.15]# cd /usr/local/mfs/etc/
[root@lg etc]# cp mfschunkserver.cfg.dist mfschunkserver.cfg
[root@lg etc]# cp mfshdd.cfg.dist mfshdd.cfg
[root@lg etc]# cp mfschunkserver.cfg.dist mfschunkserver.cfg
[root@lg etc]# cp mfshdd.cfg.dist mfshdd.cfg
編輯主配置文件
[root@localhost etc]# vi mfschunkserver.cfg
MASTER_HOST = 192.168.1.1
MASTER_PORT = 9420
MASTER_HOST = 192.168.1.1
MASTER_PORT = 9420
修改mfshdd.cfg文件,添加上給MFS使用的磁盤,我這裏獨立分出來一個data的分區,專門給MFS使用
[root@lg etc]# vi mfshdd.cfg
/data
/data
啓動數據存儲服務器
[root@lg etc]# /usr/local/mfs/sbin/mfschunkserver start
working directory: /usr/local/mfs/var/mfs
lockfile created and locked
initializing mfschunkserver modules ...
init: hdd space manager failed !!!
error occured during initialization - exiting
working directory: /usr/local/mfs/var/mfs
lockfile created and locked
initializing mfschunkserver modules ...
init: hdd space manager failed !!!
error occured during initialization - exiting
結果出現錯誤,通過檢查得知/data掛載點的屬主和屬組沒有修改成mfs小時
[root@lg etc]# chown mfs:mfs /data
[root@lg etc]# /usr/local/mfs/sbin/mfschunkserver start
working directory: /usr/local/mfs/var/mfs
lockfile created and locked
initializing mfschunkserver modules ...
scanning folder /data/ ...
/data/: 0 chunks found
scanning complete
main server module: listen on *:9422
no charts data file - initializing empty charts
mfschunkserver daemon initialized properly
[root@lg etc]# /usr/local/mfs/sbin/mfschunkserver start
working directory: /usr/local/mfs/var/mfs
lockfile created and locked
initializing mfschunkserver modules ...
scanning folder /data/ ...
/data/: 0 chunks found
scanning complete
main server module: listen on *:9422
no charts data file - initializing empty charts
mfschunkserver daemon initialized properly
設置開機啓動服務編輯/etc/rc.local添加
/uar/local/mfs/sbin/mfschunkserver start
可以看到數據存儲服務器也安裝成功,
四, MFS客戶端的安裝配置以及掛載
安裝fuse
[root@lg src]# tar zxvf fuse-2.7.3.tar.gz
[root@lg src]# cd fuse-2.7.3
[root@lg fuse-2.7.3]# ./configure && make && make install
[root@lg src]# cd fuse-2.7.3
[root@lg fuse-2.7.3]# ./configure && make && make install
[root@lg fuse-2.7.4]# lsmod | grep fuse #查看fuse模塊是否被加入到內核
[root@lg fuse-2.7.4]# modprobe fuse #保證fuse模塊被加入到內核
安裝客戶端軟件Mfsmount,需要修改下環境變量,不然在編譯的時候會出錯
出錯configure: error: mfsmount build was forced, but fuse library is too old or not installed
解決方法:修改環境變量
[root@lg src]# touch /etc/ld.so.conf.d/fuse
[root@lg src]#vim /etc/ld.so.conf.d/fuse
[root@lg src]#/usr/local/lib #這裏也需要注意一下,有時候要創建fuse文件
[root@lg src]# vi /etc/profile
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
[root@lg src]# source /etc/profile
[root@lg src]# source /etc/profile
[root@lg src]# groupadd mfs
[root@lg src]# useradd -g mfs mfs
[root@lg src]# tar zxvf mfs-1.6.15.tar.gz
[root@lg src]# cd mfs-1.6.15
[root@lg mfs-1.6.15]# ./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs --disable-mfsmaster --disable-mfschunkserver --enable-mfsmount
[root@lg mfs-1.6.15]# make && make install
[root@lg src]# useradd -g mfs mfs
[root@lg src]# tar zxvf mfs-1.6.15.tar.gz
[root@lg src]# cd mfs-1.6.15
[root@lg mfs-1.6.15]# ./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs --disable-mfsmaster --disable-mfschunkserver --enable-mfsmount
[root@lg mfs-1.6.15]# make && make install
創建掛載點
[root@localhost mfs-1.6.15]# mkdir /mfs
掛接MFS文件系統
[root@lg mfs-1.6.15]# /usr/local/mfs/bin/mfsmount /mnt -H 192.168.1.116
mfsmaster accepted connection with parameters: read-write,restricted_ip ; root m apped to root:root
mfsmaster accepted connection with parameters: read-write,restricted_ip ; root m apped to root:root
這時就可以用CGI站點監控,mfsmaster主機登陸http://127.0.0.1:9425
觀看到整個MFS系統的運行狀況了,謝謝大家!!!