免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4722 | 回复: 1
打印 上一主题 下一主题

[RAID与磁盘阵列] MFS 分布式存储系统文档 [复制链接]

论坛徽章:
4
ChinaUnix专家徽章
日期:2015-07-27 10:05:26IT运维版块每日发帖之星
日期:2015-09-01 06:20:00IT运维版块每日发帖之星
日期:2016-07-29 06:20:00PHP
日期:2016-10-25 16:08:01
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-12-23 14:02 |只看该作者 |倒序浏览

MFS 分布式存储系统文档
(for debian)

































2009-12-21





目录

1.产品介绍... 3
2.安装准备... 3
3.安装步骤... 4
3.1 安装主服务器: 4
3.2安装存储服务器... 5
4.测试... 7
5.IO性能测试... 7
6.附录... 8































1.产品介绍
MFS(moosefs)是一款分布式存储系统,可以将文件分布式存储到多台服务器上.
结构分为3部分:
元数据服务器:
主数据服务器master只能有1台(容易出现单点故障),负责管理文件系统.
数据存储服务器chunkserver:
  数据存储服务器chunkserver,存储数据,多个chunkserver直接数据互相同步.
客户端:
使用MFS文件系统来存储和访问的主机称为MFS的客户端,成功挂接MFS文件系统以后,就可以像以前使用NFS一样共享这个虚拟性的存储了。(可以挂载到分区)
结构图如下(图1):
图1
2.安装准备
下载:
#wget http://www.moosefs.com/files/mfs-1.5.12.tar.gz
服务器准备
建议使用3台服务器进行测试,2台存储,一台客户端
性能测试工具准备
读写性能测试工具:
iozone
bonnie++
网站访问测试:
ab
autobench
httperf
httpload
flood
webbench
客户端安装fuse支持包
#apt-get install fuse-utils libfuse-dev

3.安装步骤
3.1 安装主服务器:
添加用户:
#useradd mfs -s /bin/false
编译安装:
#./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs
#make&&make install;
配置元服务器:
#vi /usr/local/mfs/etc/mfsmaster.cfg
内容如下:
WORKING_USER = mfs   //用户
WORKING_GROUP = mfs  //用户组

LOCK_FILE = /var/run/mfs/mfsmaster.pid //lock文件路径,如果系统没有需要手工创建,并将属主改成mfs
DATA_PATH = /usr/local/mfs/var/mfs    //元数据存放路径,如果没有需要手工创建,并将属主改成mfs
SYSLOG_IDENT = mfsmaster         //日志级别

# BACK_LOGS = 50                 //后台日志

REPLICATIONS_DELAY_INIT = 300   //同步延时时间
REPLICATIONS_DELAY_DISCONNECT = 3600  //同步超时时间

MATOCS_LISTEN_HOST = *        //监听主机
MATOCS_LISTEN_PORT = 9420      //即元数据服务器使用9420这个监听端口来接受数据存储服务器chunkserver端的连接

MATOCU_LISTEN_HOST = *                   //监听主机
MATOCU_LISTEN_PORT = 9421      //元数据服务器在9421端口监听,用以接受客户端对MFS进行远程挂接(客户端以mfsmount挂接MFS)

# CHUNKS_LOOP_TIME = 300         //存储循环时间
# CHUNKS_DEL_LIMIT = 100          //删除时间
# CHUNKS_REP_LIMIT = 15           //重复时间

启动主服务器
#/usr/local/mfs/sbin//mfsmaster start
注意:
如果正常,系统日志会有记录,另外如果要关闭主服务器,使用/usr/local/mfs/sbin/mfsmaster –s 这种方式,如果直接使用kill杀死进程,将导致下次启动时出现找不到相关文件,而不能正常启动服务器。这个一定要谨慎。当然,如果发生了这个事情,还是可以通过 mfsmetastore 来恢复的。
3.2安装存储服务器
添加用户组
# useradd mfs -s /bin/false (debian)
编译安装:
为了区分,加入--disable-mfsmaster参数
#./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs --disable-mfsmaster
#make &&make install ;
配置chunkserver:
#vi /usr/local/mfs/etc/mfschunkserver.cfg
配置文件内容:
# WORKING_USER = mfs   //用户
# WORKING_GROUP = mfs  //用户组

# DATA_PATH = /usr/local/mfs/var/mfs   //数据存放路径
# LOCK_FILE = /var/run/mfs/mfschunkserver.pid    //LOCK文件存放路径
# SYSLOG_IDENT = mfschunkserver             //日志级别

# BACK_LOGS = 50

# MASTER_RECONNECTION_DELAY = 30      //重新连接延时

# MASTER_HOST = mfsmaster                  //MASTER服务器地址
# MASTER_PORT = 9420                      //端口

# MASTER_TIMEOUT = 60                     //超时时间

# CSSERV_LISTEN_HOST = *           //数据复制服务器地址
# CSSERV_LISTEN_PORT = 9422       //这个监听端口用于与其它数据存储服务器间的连接,通常是数据复制
# CSSERV_TIMEOUT = 60             //接收超时时间

# CSTOCS_TIMEOUT = 60            

# HDD_CONF_FILENAME = /usr/local/mfs/etc/mfshdd.cfg  //分配给MFS使用的磁盘空间配置文件的位置
更改配置文件
#vi /usr/local/mfs/etc/mfshdd.cfg
加入:
/home/mfs
注意:
这里需要将要存放数据的分区或硬盘写进去,并将属主修改成mfs,还有如果测试,可以创建一个大文件来共享
我们这里可以用一个分区来做测试
#mkdir /home/mfs
#chown –R mfs.mfs /home/mfs
启动:
#/usr/local/mfs/sbin/mfschunkserver start;
注意:
跟主数据服务器master相似,执行命令 /usr/local/mfs/sbin/mfschunkserver –s , chunkserver服务就停下来了。为了使系统重启过程能自动启动chunkserver 服务,可以通过在/etc/rc.local文件追加行  /usr/local/mfs/sbin/mfschunkserver start 来达到这个目的(master的自动重启处理也可同样处理)。
3.3 客户端安装配置
#创建用户
#useradd mfs –s /bin/false
编译安装:
为了区别,客户端不用安装master和chunkserver
#modprobe fuse
#./configure --prefix=/usr/local/mfs --with-default-user=mfs --with-default-group=mfs --disable-mfsmaster --disable-mfschunkserver --enable-mfsmount
#make &&make install
挂载:
#mkdir /mnt/mfs
#/usr/local/mfs/bin/mfsmount –h xxx.xxx.xxx
常用MFSMOUNT 参数:
-w 指定mount路径,默认为/mnf/mfs
-h 指定MASTER服务器地址
-p 指定端口默认9421

4.测试
  测试/mnt/mfs目录的数据读写情况,并关闭一台存储服务器,测试数据读写的完整性
5.IO性能测试
使用bonnie测试MFS
#bonnie -d /mnt/mfs/ -s 16000 -m mfs -uroot
结果:
Version  1.03       ------Sequential Output------   --Sequential Input-               --Random-
                    -Per Chr- --Block-- -Rewrite-       -Per Chr- --Block--            --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec  %CP K/sec %CP K/sec %CP  /sec %CP
mfs          16000M  8618  11  8298   1      1017   0  9474   8 10350   0  74.0   0
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete--        -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec    %CP  /sec %CP  /sec %CP  /sec %CP
                 16   373   0   469   0       477   0   389   0   471   0   477   0
mfs,16000M,8618,11,8298,1,1017,0,9474,8,10350,0,74.0,0,16,373,0,469,0,477,0,389,0,471,0,477,0
说明:
测试数据为16G,写数据为8618K/S,重写1017K/S,读为9474K/S,对CPU的占用很低

使用bonnie测试本地磁盘读写
# bonnie -d /home/datatest/ -s 16000 -m mfs –uroot
结果:
Version  1.03       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
mfs          16000M 44339  50 48861  11 25263   3 60090  62 59792   5 266.0   0
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++
mfs,16000M,44339,50,48861,11,25263,3,60090,62,59792,5,266.0,0,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
说明:
测试数据16G,写数据速度为44339K/S,重写25263K/S,读为60090K/S
从上面2个数据来看,磁盘I/O性能是本地磁盘的1/6左右,本地磁盘为RAID5.
6.附录
configure 说明
`configure' configures MFS 1.5.12 to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit  显示帮助
      --help=short        display options specific to this package 显示这个包的特定选项
      --help=recursive    display the short help of all the included packages 显示短帮助
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
               [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
               [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR           user executables [EPREFIX/bin]
  --sbindir=DIR          system admin executables [EPREFIX/sbin]
  --libexecdir=DIR       program executables [EPREFIX/libexec]
  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
  --libdir=DIR           object code libraries [EPREFIX/lib]
  --includedir=DIR       C header files [PREFIX/include]
  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR          info documentation [DATAROOTDIR/info]
  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR           man documentation [DATAROOTDIR/man]
  --docdir=DIR           documentation root [DATAROOTDIR/doc/mfs]
  --htmldir=DIR          html documentation [DOCDIR]
  --dvidir=DIR           dvi documentation [DOCDIR]
  --pdfdir=DIR           pdf documentation [DOCDIR]
  --psdir=DIR            ps documentation [DOCDIR]

Program names:
  --program-prefix=PREFIX            prepend PREFIX to installed program names
  --program-suffix=SUFFIX            append SUFFIX to installed program names
  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
  --target=TARGET   configure for building compilers for TARGET [HOST]

Optional Features:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --disable-dependency-tracking  speeds up one-time build
  --enable-dependency-tracking   do not reject slow dependency extractors
  --disable-largefile     omit support for large files
  --disable-mfsmaster     Don't build mfsmaster
  --disable-mfschunkserver
                          Don't build mfschunkserver
  --disable-mfsmount      Don't build mfsmount

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-default-user=USER
                          Choose default user to run daemons as
  --with-default-group=GROUP
                          Choose default group to run daemons as

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L if you have libraries in a
              nonstandard directory
  LIBS        libraries to pass to the linker, e.g. -l
  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I if
  CPP         C preprocessor
  PKG_CONFIG  path to pkg-config utility
  FUSE_CFLAGS C compiler flags for FUSE, overriding pkg-config
  FUSE_LIBS   linker flags for FUSE, overriding pkg-config

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to .


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/88527/showart_2128803.html

论坛徽章:
0
2 [报告]
发表于 2010-01-15 13:12 |只看该作者
1. qq群:
   102082446  (通关密码:我爱分布式文件系统)
2. bbs讨论:
    mfs权威指南(moosefs)分布式文件系统一站式解决方案(部署,性能测试)不断更新ing
     http://bbs.chinaunix.net/thread-1644309-1-1.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP