客户端安装脚本
环境准备
yum install -y wget gcc gcc-c++ automake autoconf libtool make zlib-devel
wget https://github.com/moosefs/moosefs/archive/master.zip
cd moosefs-master
./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs --disable-mfschunkserver --disable-mfsmount
make
make install
cd ..
wget https://github.com/libfuse/libfuse/archive/fuse-3.2.3.tar.gz
也可以自己上传
cd fuse-2.9.5
./configure
make
make install
echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH' >>/etc/profile
source /etc/profile
安装后可以通过ls /usr/local/mfs
查看安装目录bin etc lib sbin share
。
配置
cd /usr/local/mfs/etc/mfs/
for f in *.sample;do cp "$f" "${f%.sample}";done
cd ${APP_HOME}/mfs/var/mfs
cp metadata.mfs.empty metadata.mfs
chown -R mfs:mfs /usr/local/mfs
客户端安装
/home/work/local/mfs/bin/mfsmount -H <master_ip> /home/work/logs/
chunkserver安装
vim /usr/local/mfs/etc/mfs/mfschunkserver.cfg
vim /usr/local/mfs/etc/mfs/mfshdd.cfg
/usr/local/mfs/sbin/mfschunkserver start
master-server安装
/usr/local/mfs/sbin/mfsmasterserver start
metalogger安装
vim /usr/local/mfs/etc/mfs/mfsmetalogger.cfg
/usr/local/mfs/sbin/mfsmetalogger start
cgi安装
/usr/local/mfs/sbin/mfscgiserv -P 端口
# 不能用./mfscgiserv的status来查看状态
错误解决
安装fuse
./configure以后出现如下错误:
configure: WARNING:
******************************************************************
* Please install util-linux version 2.18 or later which supports *
* --fake and --no-canonicalize options in mount and umount *
******************************************************************
http://www.linuxfromscratch.org/blfs/view/7.8/postlfs/fuse.html
解决方式
http://www.linuxfromscratch.org/blfs/view/7.8/postlfs/fuse.html
安装mfsmount
./configure xxxx --enable-mfsmount后提示如下:
checking for FUSE... no
configure: error: mfsmount build was forced, but fuse library is too old or not installed
解决方案:
echo 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH' >>/etc/profile
source /etc/profile
继续安装,出现:
/bin/mount:unrecognized option `--no-canonicalize'
........
........
errorin fuse_mount
这是mount工具版本太低导致,升级mount工具即可:
下载地址:https://cdn.kernel.org/pub//linux/utils/util-linux/v2.17/
tar -jxvf util-linux-ng-2.17.tar.bz2
cd util-linux-ng-2.17
./configure --prefix=/usr/local/util-linux-ng
make && make install
mv /bin/mount{,.off}
ln -s /usr/local/util-linux-ng/bin/mount /bin