三、安装主控备份服务器Metalogger server
1.安装
#useradd mfs -s /sbin/nologin
#tar -zxvf mfs-1.6.11.tar.gz
#cd mfs-1.6.11
#./configure --prefix=/usr/local/mfs --with-default-user=mfs --with- default-group=mfs --disable-mfschunkserver --disable-mfsmount
#make
#make install
2.copy配置文件
#cd /usr/local/etc
#cp mfsmetalogger.cfg.dist mfsmetalogger.cfg
3.mfsmetalogger.cfg文件详解
[root@localhost etc]# cat mfsmetalogger.cfg
# WORKING_USER = mfs
# WORKING_GROUP = mfs
# SYSLOG_IDENT = mfsmetalogger
# LOCK_MEMORY = 0
# NICE_LEVEL = -19
# DATA_PATH = /usr/local/mfs/var/mfs
# BACK_LOGS = 50
#META_DOWNLOAD_FREQ = 24
# MASTER_RECONNECTION_DELAY = 5
MASTER_HOST = 119.147.146.246
# MASTER_PORT = 9419
# MASTER_TIMEOUT = 60
# deprecated, to be removed in MooseFS 1.7
# LOCK_FILE = /var/run/mfs/mfsmetalogger.lock
META_DOWNLOAD_FREQ,元数据备份文件下载请求频率,默认24H,即每隔一天从元数据服务器上下载一个metadata.mfs.back文件。当元数据服务器关闭或者出故障时,metadata.mfs.back文件将消失,此时要恢复整个MFS,需要从元数据日志服务器中取的该文件。注意,这个文件和日志文件共同使用才可以恢复整个被损毁的分布式文件系统。
MASTER_HOST,这个文件中需要修改的是MASTER_HOST变量,这个变量的值是MASTER SERVER 的IP地址
4.启动元数据日志服务器
[root@localhost ~]# /usr/local/mfs/sbin/mfsmetalogger start
working directory: /usr/local/mfs/var/mfs
lockfile created and locked
initializing mfsmetalogger modules ...
mfsmetalogger daemon initialized properly
5.开机启动
echo "/usr/local/mfs/sbin/mfsmetalogger" >> /etc/rc.local
查看MFS进程
[root@localhost ~]# ps -ef | grep mfs
mfs 16373 1 0 19:55 ? 00:00:00 /usr/local/mfs/sbin/mfsmetalogger start
查看MFS通讯端口是否打开
[root@localhost ~]# lsof -i:9419
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
mfsmetalo 16373 mfs 7u IPv4 119836 TCP 119.147.146.248:42981->119.147.146.246:9419 (ESTABLISHED)