您的位置:首页 > 其它

GlusterFS简单安装与配置

2014-09-15 17:22 337 查看

服务器:

IP:192.168.5.50

客户端:

IP:192.168.10

服务器端配置:

1、建立共享目录:

[root@test50 gdisk1]# pwd

/home/pubserver/gdisk1

2、建立服务目录:

/home/pubserver/gluster

3、服务端配置:

[root@test50 gdisk1]# cat /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.5.50 # 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

volume brick

type storage/posix

option directory /home/pubserver/gdisk1

end-volume

volume server

type protocol/server

option transport-type tcp

option transport.socket.bind-address 192.168.5.50

option transport.socket.listen-port 6996

subvolumes brick

option auth.addr.brick.allow 192.168.5.*

end-volume

4、启动服务

glusterfsd -f /etc/glusterfs/server.vol -l glusterfs.log

日志文件:glusterfs.log

客户端配置:

1、建立客户端的目录:

[root@localhost glusterfs]# pwd

/home/pubserver/glusterfs

2、配置客户端:

[root@localhost glusterfs]# cat /etc/glusterfs/client.vol

volume client

type protocol/client

option transport-type tcp

option remote-host 192.168.5.39

option transport.socket.remote-port 6996

option remote-subvolume brick

end-volume

3、启动客户端:

glusterfs -l glusterfs.log -f /etc/glusterfs/client.vol /mnt/

如果提示:mount Transport endpoint is not connected

这个错误,很可能是防火墙没有关闭的原因。

4、查看挂载文件:

[root@localhost glusterfs]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/sda2 48G 8.9G 36G 20% /

tmpfs 935M 80K 935M 1% /dev/shm

/dev/sda1 291M 81M 195M 30% /boot

/etc/glusterfs/client.vol

18G 3.3G 14G 20% /mnt

注:服务端的目录 /home/pubserver/gdisk1 被挂载到客户端的/mnt目录上。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: