元数据服务器 :MDT 192.168.6.132
数据存储服务器:MDS 192.168.6.133
客户端 :client 192.168.6.134
客户端 :client2 192.168.6.135
客户端通过fuse内核接口挂载元数据服务器,真实数据存在数据存储服务器!
1.安装元数据服务器 MDT 192.168.6.132
shell $> apt-get install libfuse-dev
shell $> tar zxvf mfs-1.5.12.tar.gz
shell $> ./configure --prefix=/usr/local/mfs --disable-mfsmount --disable-mfschunkserver --enable-mfsmaster --with-default-user=mfs --with-default-group=mfs
shell $> cd /usr/local/mfs
shell $> vim mfsmaster.cfg
WORKING_USER = mfs
WORKING_GROUP = mfs
LOCK_FILE = /var/run/mfs/mfsmaster.pid
DATA_PATH = /usr/local/mfs/var/mfs
SYSLOG_IDENT = mfsmaster
REPLICATIONS_DELAY_INIT = 300
REPLICATIONS_DELAY_DISCONNECT = 3600
MATOCS_LISTEN_HOST = *
MATOCS_LISTEN_PORT = 9420
MATOCU_LISTEN_HOST = *
MATOCU_LISTEN_PORT = 9421
CHUNKS_LOOP_TIME = 300
CHUNKS_DEL_LIMIT = 100
CHUNKS_REP_LIMIT = 15
shell $> mkdir -p /var/run/mfs
shell $> chown mfs.mms /var/run/mfs
shell $> /usr/local/mfs/sbin/mfsmaster start
tcp 0 0 0.0.0.0:9420 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:9421 0.0.0.0:* LISTEN
## 说明启动成功!
2.安装数据存储服务器! MDS 192.168.6.133
shell $> apt-get install libfuse-dev
shell $> tar zxvf mfs-1.5.12.tar.gz
shell $> ./configure --prefix=/usr/local/mfs --disable-mfsmount --enable-mfschunkserver --disable-mfsmaster --with-default-user=mfs --with-default-group=mfs
shell $> cd /usr/local/mfs
shell $> vim mfschunkserver.cfg
WORKING_USER = mfs
WORKING_GROUP = mfs
DATA_PATH = /usr/local/mfs/var/mfs
LOCK_FILE = /var/run/mfs/mfschunkserver.pid
SYSLOG_IDENT = mfschunkserver
MASTER_RECONNECTION_DELAY = 30
MASTER_HOST = 192.168.6.132 ##
修改为元数据服务器IP地址! MASTER_PORT = 9420
CSSERV_LISTEN_HOST = *
CSSERV_LISTEN_PORT = 9422
HDD_CONF_FILENAME = /usr/local/mfs/etc/mfshdd.cfg
shell $> vim mfshdd.cfg
shell $> mkdir -p /mnt/data
shell $> chown mfs.mfs /mnt/data
shell $> mkdir -p /var/run/mfs
shell $> chown mfs.mfs /var/run/mfs
shell $> /usr/local/mfs/sbin/mfschunkserver start
tcp 0 0 0.0.0.0:9422 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 192.168.6.133:38318 192.168.6.132:9420 ESTABLISHED 3.安装客户端 client 192.168.6.134 shell $> apt-get install libfuse-dev
shell $> tar zxvf mfs-1.5.12.tar.gz
shell $> ./configure --prefix=/usr/local/mfs --enable-mfsmount --disable-mfschunkserver --disable-mfsmaster --with-default-user=mfs --with-default-group=mfs
shell $> cd /usr/local/mfs
shell $> bin/mfsmount --help
mfsmount v. 1.5.12
usage: ./mfsmount [-r][-m][-c] [-v 0..2] [-h master host] [-p master port] [-l path] [-w mount point]
r: readonly mode
m: mount metadata
c: allow using cache
v: verbose level
defaults:
h: mfsmaster ###默认是 mfsmaster 计算机名
p: 9421 ### 默认是 9421 端口
l: / ### 默认被挂载路径
w: /mnt/mfs ### 默认挂载目录!
shell $> mkdir -p /mnt/mfs
shell $> bin/mfsmount -h 192.168.6.132 ###其他参数不用,使用默认!
/dev/sda1 on / type ext3 (rw,relatime,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
/proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
securityfs on /sys/kernel/security type securityfs (rw)
MFS on /mnt/mfs type fuse (rw,allow_other,default_permissions) ##说明挂载成功,新建文件与删除文件看看~
4.安装客户端2 client2 192.168.6.135
shell $> apt-get install libfuse-dev
shell $> tar zxvf mfs-1.5.12.tar.gz
shell $> ./configure --prefix=/usr/local/mfs --enable-mfsmount --disable-mfschunkserver --disable-mfsmaster --with-default-user=mfs --with-default-group=mfs
shell $> cd /usr/local/mfs
shell $> mkdir -p /mnt/mfs shell $> bin/mfsmount -h 192.168.6.132 ###其他参数不用,使用默认!
/dev/sda1 on / type ext3 (rw,relatime,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
/proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
securityfs on /sys/kernel/security type securityfs (rw)
MFS on /mnt/mfs type fuse (rw,allow_other,default_permissions) #### 切换到 客户端1 client 192.168.6.134 看一下
本文转自Deidara 51CTO博客,原文链接:http://blog.51cto.com/deidara/152586,如需转载请自行联系原作者