在http://www.gluster.org/可以了解到更多并可以下载到最新的安装包,glusterfs使用了fuse,fuse可以到http://fuse.sourceforge.net/进行下载
目的:做个简单的配置,类似NFS的配置
两台服务器IP分别为:
192.168.4.190----------------glusterfs_server
192.168.4.188----------------glusterfs_client
系统使用centos5.1,有个奇怪的问题是系统使用centos4.4的时候编译glusterfs的时候总报错,用centos5.1就没事,这问题还以待研究
1.首先安装fuse
tar -zxvf fuse-2.7.4.tar.gz
cd fuse-2.7.4
./configure -enable-dependency-tracking -enable-kernel-module -enable-lib -enable-util
make && make isntall
tar -zxvf glusterfs-2.0.0rc1.tar.gz
cd glusterfs-2.0.0rc1
./configure
make && make install
gluster_server端的操作
2.配置文件的修改
mv glusterfs-server.vol.sample glusterfs-server.vol
vi /usr/local/etc/glusterfs/glusterfs-server.vol
修改后内容如下:
type storage/posix
option directory /disk
end-volume
volume server
type protocol/server
option transport-type tcp
# option transport-type ib-sdp
# option transport-type ib-verbs
# option transport-type unix
# option ib-verbs-work-request-send-size 131072
# option ib-verbs-work-request-send-count 64
# option ib-verbs-work-request-recv-size 131072
# option ib-verbs-work-request-recv-count 64
option transport-type tcp/server
option bind-address 192.168.4.190
option listen-port 6996
# option client-volume-filename /etc/glusterfs/glusterfs-client.vol
subvolumes brick
option auth.addr.brick.allow *
end-volume
mv glusterfs-client.vol.sample glusterfs-client.vol
vi /usr/local/etc/glusterfs/glusterfs-client.vol
修改后内容如下:
type protocol/client
option transport-type tcp
# option transport-type unix
# option transport-type ib-sdp
# option transport-type ib-verbs
# option ib-verbs-work-request-send-size 1048576
# option ib-verbs-work-request-send-count 16
# option ib-verbs-work-request-recv-size 1048576
# option ib-verbs-work-request-recv-count 16
option remote-host 192.168.4.190
option remote-port 6996
# option transport-timeout 30
option remote-subvolume brick
end-volume
glusterfs_server端的操作
1.glusterfsd -f /usr/local/etc/glusterfs/glusterfs-server.vol 启动server端
2.ps -ef | grep glusterfs 查看进程存在不存在
3.netstat -ln | grep 6996 查看端口是否监听
1.modprobe -i fuse 加载fuse模块
2.glusterfs -l /tmp/glusterfs.log -f /usr/local/etc/glusterfs/glusterfs-client.vol /mnt 挂载到/mnt上,同时可以查看 /tmp下的glusterfs.log日志
3.[root@glusterfs_client]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/hda1 8.5G 5.0G 3.2G 62% /
tmpfs 125M 0 125M 0% /dev/shm
glusterfs 6.0G 147M 5.5G 3% /mnt
可以在/mnt下进行touch命令创建文件测试
by:jialisong
2009-06-24