GFS说明:
Fastdfs号称小巧,速度快占用资源小,但据我了解他是提供api来进行操作的,而目前我还是希望可以像NFS一样,直接mount来使用,并且提供高的可用性,和文件的容错功能,一路扫下来,瞄准了glusterfs。Glusterfs是一个具有可以扩展到几个PB数量级的集群文件系统。它可以把多个不同类型的存储块通过Infiniband RDMA或者TCP/IP汇聚成一个大的并行网络文件系统。

在http://www.gluster.org/下载glusterfs
在http://fuse.sourceforge.net/下载fuse

Server:192.168.142.137
Clinet: 192.168.142.138

一 这个操作Server和Clinet端都要操作:
yum -y install kernel-devel  bison bison-devel 

首先是fuse的安装
wget http://sourceforge.net/projects/fuse/files/fuse-2.X/2.9.2/fuse-2.9.2.tar.gz/download
tar zxxvf fuse-2.9.2.tar.gz
./configure --enable-dependency-tracking --prefix=/usr/local/
make 
make install
如果没有什么错误,就是安装完毕了,接下来是glusterfs的安装

wget http://bits.gluster.com/pub/gluster/glusterfs/src/glusterfs-3.1.5.tar.gz
tar xzvf glusterfs-3.1.5.tar.gz 
   cd glusterfs-3.1.5
    ./configure 
    make
    make install
如果没有报错就是安装完毕了
    ldconfig 
    glusterfs --version
[root@Ser_142_137 ~]# gluster --version
glusterfs 3.1.5 built on Jan 16 2013 02:32:57
Repository revision: git://git.gluster.com/glusterfs.git
Copyright (c) 2006-2010 Gluster Inc. <http://www.gluster.com>
GlusterFS comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GlusterFS under the terms of the GNU Affero General Public License.




二 Server端配置文件
make -p /home/dir1
chmod 1777 /home/dir1
[root@Ser_142_137 ~]# vi /etc/glusterfs/server.vol 
### file: server-volume.vol.sample
#####################################
### GlusterFS Server Volume File ##
#####################################
#### CONFIG FILE RULES:
### "#" is comment character.
### - Config file is case sensitive
### - Options within a volume block can be in any order.
### - Spaces or tabs are used as delimitter within a line.
### - Multiple values to options will be : delimitted.
### - Each option should end within a line.
### - Missing or commented fields will assume default values.
### - Blank/commented lines are allowed.
### - Sub-volumes should already be defined above before referring.
### Export volume "brick" with the contents of "/home/export" directory.
volume brick
type storage/posix # POSIX FS translator
option directory /home/dir1 # Export this directory
end-volume
### Add network serving capability to above brick.
volume server
type protocol/server
option transport-type tcp/server
option bind-address 192.168.142.137 # Default is to listen on all interfaces
option listen-port 6996 # Default is 6996
subvolumes brick
option auth.addr.brick.allow * # Allow access to "brick" volume
end-volume


三 Clinet端配置文件操作
modprobe -i fuse
[root@Cli_142 ~]# vi /etc/glusterfs/client.vol 
### file: client-volume.vol.sample
#####################################
### GlusterFS Client Volume File ##
#####################################
#### CONFIG FILE RULES:
### "#" is comment character.
### - Config file is case sensitive
### - Options within a volume block can be in any order.
### - Spaces or tabs are used as delimitter within a line.
### - Each option should end within a line.
### - Missing or commented fields will assume default values.
### - Blank/commented lines are allowed.
### - Sub-volumes should already be defined above before referring.
### Add client feature and attach to remote subvolume
volume client0
type protocol/client
option transport-type tcp/client
option remote-host 192.168.142.137 # IP address of the remote brick
option remote-port 6996 # default server port is 6996
option remote-subvolume brick # name of the remote volume
end-volume

四 启动服务
Server:  gulsterfsd -f /etc/glusterfs/server.vol
         [root@Ser_142_137 ~]# ps ax|grep -v grep |grep gluster
          1238 ?        Ssl    0:00 glusterfs -f /etc/glusterfs/server.vol
          
Clinet:  glusterfs -l /tmp/glustfs.log -f /etc/glusterfs/client.vol  /mnt/
[root@Cli_142 ~]# df -h
文件系统              容量  已用  可用 已用%% 挂载点
/dev/mapper/VolGroup-lv_root
                       19G  2.2G   16G  13% /
tmpfs                 242M     0  242M   0% /dev/shm
/dev/sda1             485M   32M  429M   7% /boot
/etc/glusterfs/client.vol
                       19G  2.2G   16G  13% /mnt