实验说明:
https://github.com/moosefs/moosefs/releases 本验证环境采用3.0.116版本
wget https://github.com/moosefs/moosefs/archive/refs/tags/v3.0.116.tar.gz
yum install wget;
wet
yum install gcc;
yum install gcc-c+;
yum install openssl-devel;(不确定是否需要)
yum install fuse-devel;(编译mfsmount需要)
[root@bogon soft]# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda1 xfs 3e7960d0-3e27-4d22-9d26-dcb15fd17cdd /boot
└─sda2 LVM2_member kQzSHp-1kUy-XUFx-cUli-39SY-D01u-ybAqb0
├─centos-root xfs 0b878c82-1937-41e3-8ebd-6258cbaed394 /
├─centos-swap swap 09b7a442-ea79-4b5c-9df6-8d2c6ee46322 [SWAP]
└─centos-home xfs e1857c42-45ae-4c4f-beef-19fbbe2b113e /home
sdb
sdc
mkfs.xfs /dev/sdb -f
[root@bogon soft]# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda1 xfs 3e7960d0-3e27-4d22-9d26-dcb15fd17cdd /boot
└─sda2 LVM2_member kQzSHp-1kUy-XUFx-cUli-39SY-D01u-ybAqb0
├─centos-root xfs 0b878c82-1937-41e3-8ebd-6258cbaed394 /
├─centos-swap swap 09b7a442-ea79-4b5c-9df6-8d2c6ee46322 [SWAP]
└─centos-home xfs e1857c42-45ae-4c4f-beef-19fbbe2b113e /home
sdb xfs 25856cc8-250c-45c8-9169-90ba1215149e
sdc xfs 6479c685-ac17-4c59-8e61-2b3c0122acf8
mkdir /mnt/hd1
mkdir /mnt/hd2
-- 编辑/etc/fstab,添加挂载盘
UUID=25856cc8-250c-45c8-9169-90ba1215149e /mnt/hd1 xfs defaults 0 0
UUID=6479c685-ac17-4c59-8e61-2b3c0122acf8 /mnt/hd2 xfs defaults 0 0
groupadd mfs
useradd -g mfs mfs
chown -R mfs:mfs /mnt/hd1
chown -R mfs:mfs /mnt/hd2
./configure --enable-mfsmount
make -j 6
make install
主要启动mfsmaster,mfschunkserver,mfsmetalogger;
如果是分布式启动,需要在每个节点上为 mfsmaster 所在节点(192.168.46.8)增加一个别名 mfsmaster(在96-99上分别执行如下命令) echo "192.168.46.8 mfsmaster " >> /etc/hosts
执行启动命令,默认会报错,找不到cfg文件
[root@bogon bin]# /usr/local/sbin/mfsmaster start
cannot load config file: /usr/local/etc/mfs/mfsmaster.cfg
can‘t load config file: /usr/local/etc/mfs/mfsmaster.cfg - using defaults
open files limit has been set to: 16384
working directory: /usr/local/var/mfs
lockfile created and locked
initializing mfsmaster modules ...
mfsexports configuration file (/usr/local/etc/mfs/mfsexports.cfg) not found - please create one (you can copy /usr/local/etc/mfs/mfsexports.cfg.sample to get a base configuration)
no exports defined !!!
init: exports manager failed !!!
error occurred during initialization - exiting
[root@bogon mfs]# cp mfsmaster.cfg.sample mfsmaster.cfg
[root@bogon mfs]# cp mfshdd.cfg.sample mfshdd.cfg
[root@bogon mfs]# cp mfschunkserver.cfg.sample mfschunkserver.cfg
[root@bogon mfs]# cp mfsmetalogger.cfg.sample mfsmetalogger.cfg
[root@bogon mfs]# cp mfstopology.cfg.sample mfstopology.cfg
[root@bogon mfs]# cp mfsexports.cfg.sample mfsexports.cfg
[root@bogon mfs]# /usr/local/sbin/mfsmaster start
open files limit has been set to: 16384
working directory: /usr/local/var/mfs
lockfile created and locked
initializing mfsmaster modules ...
exports file has been loaded
topology file has been loaded
loading metadata ...
can‘t find metadata.mfs - try using option ‘-a‘
init: metadata manager failed !!!
error occurred during initialization - exiting
chown -R mfs:mfs /usr/local/var/mfs
open files limit has been set to: 16384
working directory: /usr/local/var/mfs
lockfile created and locked
initializing mfsmaster modules ...
exports file has been loaded
topology file has been loaded
loading metadata ...
can‘t find metadata.mfs - try using option ‘-a‘
init: metadata manager failed !!!
error occurred during initialization - exiting
cp /home/soft/moosefs-3.0.116/mfsdata/metadata.mfs /usr/local/var/mfs/
[root@bogon mfs]# /usr/local/sbin/mfsmaster start
open files limit has been set to: 16384
working directory: /usr/local/var/mfs
lockfile created and locked
initializing mfsmaster modules ...
exports file has been loaded
topology file has been loaded
loading metadata ...
metadata file has been loaded
no charts data file - initializing empty charts
master <-> metaloggers module: listen on *:9419
master <-> chunkservers module: listen on *:9420
main master server module: listen on *:9421
mfsmaster daemon initialized properly
chunkserver主要涉及到挂载盘,启动前先修改mfshdd.cfg文件,添加挂载盘
修改mfschunkserver.cfg文件,将MASTER_HOST注释打开,并设置masterip,如:MASTER_HOST = 192.168.46.8
启动mfschunksever
[root@bogon mfs]# /usr/local/sbin/mfschunkserver start
open files limit has been set to: 16384
working directory: /usr/local/var/mfs
lockfile created and locked
setting glibc malloc arena max to 4
setting glibc malloc arena test to 4
initializing mfschunkserver modules ...
hdd space manager: path to scan: /mnt/hd2/
hdd space manager: path to scan: /mnt/hd1/
hdd space manager: start background hdd scanning (searching for available chunks)
main server module: listen on *:9422
no charts data file - initializing empty charts
mfschunkserver daemon initialized properly
启动前,参考mfschunkserver,需要将cfg中的MASTER_HOST进行修改 /usr/local/sbin/mfsmetalogger start
启动监控界面 python /usr/local/bin/mfscgiserv
默认防火墙可能开启,需先关闭防火墙 systemctl stop firewalld
前端打开网页 网页未显示内容是mfsmaster未配置导致,可以手动输入mfsmaster的ip地址,即可
临时挂载可采用 mfsmount /mnt/mfs/ -H 192.168.46.8 df -h可以看到挂载盘
./configure --enable-mfsmount
原文:https://www.cnblogs.com/yanhuiw/p/15303010.html
评论 ( 0 )