mfs的元数据服务器的编译安装
wget http://ncu.dl.sourceforge.net/project/moosefs/moosefs/1.6.11/mfs-1.6.11.tar.gz tar -xf mfs-1.6.11.tar.gz cd mfs-1.6.11 useradd mfs -s /sbin/nologin ./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs make make install cd /usr/local/mfs/etc/ cp mfsmaster.cfg.dist mfsmaster.cfg [root@10 etc]# cat mfsmaster.cfg #mfsmaster.cfg为主配置文件,凡用#注释的均使用默认值 # WORKING_USER = mfs # WORKING_GROUP = mfs # SYSLOG_IDENT = mfsmaster # LOCK_MEMORY = 0 # NICE_LEVEL = -19 # EXPORTS_FILENAME = /usr/local/mfs/etc/mfsexports.cfg # DATA_PATH = /usr/local/mfs/var/mfs # BACK_LOGS = 50 # REPLICATIONS_DELAY_INIT = 300 # REPLICATIONS_DELAY_DISCONNECT = 3600 # MATOML_LISTEN_HOST = * # MATOML_LISTEN_PORT = 9419 # MATOCS_LISTEN_HOST = * # MATOCS_LISTEN_PORT = 9420 # MATOCU_LISTEN_HOST = * # MATOCU_LISTEN_PORT = 9421 # CHUNKS_LOOP_TIME = 300 # CHUNKS_DEL_LIMIT = 100 # CHUNKS_WRITE_REP_LIMIT = 1 # CHUNKS_READ_REP_LIMIT = 5 # REJECT_OLD_CLIENTS = 0 # deprecated, to be removed in MooseFS 1.7 # LOCK_FILE = /var/run/mfs/mfsmaster.lock cp mfsexports.cfg.dist mfsexports.cfg #mfsexports。cfg为权限控制文件 [root@10 etc]# cat mfsexports.cfg #* / ro #192.168.1.0/24 / rw #192.168.1.0/24 / rw,alldirs,maproot=0,password=passcode #10.0.0.0-10.0.0.5 /test rw,maproot=nobody,password=test * . rw #* / rw,alldirs,maproot=0 192.168.3.0/24 / rw,alldirs,maproot=0,password=123456 #其中 / 表示MooseFS根 .表示MFSMETA文件系统 cp ../var/mfs/metadata.mfs.empty /usr/local/mfs/var/mfs/metadata.mfs #启动mfs需要将默认的元数据文件改为metadata.mfs /usr/local/mfs/sbin/mfsmaster start #启动mfs 查看 [root@10 etc]# ps -ef | grep mfsmaster mfs 11211 1 0 15:14 ? 00:00:00 /usr/local/mfs/sbin/mfsmaster start 停止mfs [root@10 etc]# /usr/local/mfs/sbin/mfsmaster -s working directory: /usr/local/mfs/var/mfs sending SIGTERM to lock owner (pid:11211) waiting for termination ... terminated [root@10 etc]# -------------------------------------------------------------------------------------- 配置元数据日志服务器 元数据日志服务器只有一个配置文件 cp mfsmetalogger.cfg.dist mfsmetalogger.cfg 修改MASTER_HOST 192.168.3.10 启动元数据日志服务器,检查其进程,查看mfs通信端口 [root@10 etc]# /usr/local/mfs/sbin/mfsmetalogger start working directory: /usr/local/mfs/var/mfs lockfile created and locked initializing mfsmetalogger modules ... mfsmetalogger daemon initialized properly [root@10 etc]# ps -ef | grep mfs mfs 11455 1 0 15:25 ? 00:00:00 /usr/local/mfs/sbin/mfsmaster start mfs 11790 1 0 15:43 ? 00:00:00 /usr/local/mfs/sbin/mfsmetalogger start root 11805 5891 0 15:43 pts/1 00:00:00 grep mfs [root@10 etc]# lsof -i:9419 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME mfsmaster 11455 mfs 7u IPv4 27417 0t0 TCP *:9419 (LISTEN) -------------------------------------------------------------------------------- 安装配置数据存储服务器 需要用到的配置文件有两个,mfschunkserver.cfg mfsshdd.cfg,前者为主配置文件,后者用来指定服务器分配给mfs使用的空间 ,最好是单独的硬盘或者raid卷,至少是一个磁盘分区。 tar -xf mfs-1.6.11.tar.gz cd mfs-1.6.11 useradd mfs -s /sbin/nologin ./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs make make install cp mfschunkserver.cfg.dist mfschunkserver.cfg cp mfshdd.cfg.dist mfshdd.cfg 修改mfschunkserver.cfg 中MASTER_HOST 和MASTER_PORT MASTER_HOST = 192.168.3.10 MASTER_PORT = 9420 配置mfshdd.cfg [root@11 etc]# cat mfshdd.cfg /data chown mfs:mfs /data/ -R 启动数据存储服务器,并且检查mfs进程 [root@11 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@11 etc]# ps -ef | grep mfs mfs 10346 1 0 16:07 ? 00:00:00 /usr/local/mfs/sbin/mfschunkserver start root 10363 5605 0 16:07 pts/1 00:00:00 grep mfs ------------------------------------------------------------------------------------ mfs客户端的安装配置 mfs客户端以来fuse yum install fuse fuse-devel 加载fuse模块 modprobe fuse tar -xf mfs-1.6.11.tar.gz cd mfs-1.6.11 ./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs --enable-mfsmount make ; make install 挂载mfs文件系统 usr/local/mfs/bin/mfsmount -m /mnt/mfs -H 192.168.3.10 -p MFS Password: mfsmaster accepted connection with parameters: read-write,restricted_ip [root@12 /]# mount .................................................... mfsmeta#192.168.3.10:9421 on /mnt/mfs type fuse (rw,nosuid,nodev,allow_other,default_permissions) ------------------- 挂载MFSMETA文件系统 [root@12 /]# /usr/local/mfs/bin/mfsmount -m /mnt/mfsmeta/ -H 192.168.3.10 mfsmaster accepted connection with parameters: read-write,restricted_ip -------- [root@12 /]# ls -R /mnt/mfsmeta/ /mnt/mfsmeta/: reserved trash /mnt/mfsmeta/reserved: /mnt/mfsmeta/trash: undel /mnt/mfsmeta/trash/undel: [root@12 /]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 14G 3.7G 9.3G 29% / /dev/sda1 99M 13M 81M 14% /boot tmpfs 501M 0 501M 0% /dev/shm mfs#192.168.3.10:9421 17G 0 17G 0% /mnt/mfs [root@12 /]# mount mfs#192.168.3.10:9421 on /mnt/mfs type fuse (rw,nosuid,nodev,allow_other,default_permissions) mfsmeta#192.168.3.10:9421 on /mnt/mfsmeta type fuse (rw,nosuid,nodev,allow_other,default_permissions)------------------
如果启动mfscgiserv 报错,升级python
wget http://www.python.org/ftp/python/2.7/Python-2.7.tar.bz2 tar jfvx Python-2.7.tar.bz2 ./configure make all make install make clean make distclean /usr/local/bin/python2.7 -V Python 2.7 (r27:82500, Nov 2 2010, 19:25:22)[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2 软连接 mv /usr/bin/python /usr/bin/python-bak ln -s /usr/local/bin/python3.0 /usr/bin/python 升级安装好以后yum会无法使用 vim /usr/bin/yum 将文件头部的 #!/usr/bin/python 改成 #!/usr/bin/python2.4 ------------------------------------------------------------------ 通过mfscigserv监控客户端连接状态 详细请参阅chinaunix http://bbs.chinaunix.net/thread-1644309-1-1.html 百度文库 http://wenku.baidu.com/view/63670675f46527d3240ce08e.html sero的51cto博客 http://sery.blog.51cto.com/10037/263515/