访问glusterfs- 配置GlusterFS 客户端
访问glusterfs卷有多种方式.
1.使用Gluster Native Client 模式:这种方式提供了高并发,高性能,传输失败恢复机制,但只适用于GNU/Linux.
2.使用NFS协议:NFS v3 版本访问.在GNU/Linux系统已经大量测试过,NFS 也可以实现在其它操作系统上, FreeBSD, Mac OS X, windows系列,包括Windows 7 (专业版本以上版本) ,Windows Server 2003. 这些NFS 实现方式使用的是gluster NFS server.
3.使用CIFS协议:适合windows系列操作系统使用,Microsoft Windows 的 SAMBA 客户端. 在这种访问模式下, 客户端必须安装Samba软件包.
Gluster Native Client
Gluster Native Client 是基于运行在用户空间的FUSE-based 客户端 . Gluster Native Client 是官方推荐的,是高并发读,高写入性能访问卷最佳模式 .
下面就基于这种模式安装测试
安装Gluster Native Client
在安装Gluster Native Client之前,必须确保FUSE模块已经在客户端操作系统上加载,执行下面的操作确认:
-
添加FUSE内核模块:
点击(此处)折叠或打开
- [root@192_168_165_88 ~]# modprobe fuse
- [root@192_168_165_88 ~]# lsmod |grep fuse
- fuse 49237 4
- [root@192_168_165_88 ~]# modprobe fuse
-
验证FUSE模块已经被正确加载:
点击(此处)折叠或打开
- [root@192_168_165_88 ~]# dmesg |grep -i fuse
- fuse init (API version 7.10)
- [root@192_168_165_88 ~]# dmesg |grep -i fuse
Red Hat Package Manager (RPM) 系统安装
-
安装依赖包:
点击(此处)折叠或打开
- [root@192_168_165_88 ~]# yum -y install openssh-server wget fuse fuse-libs openib libibverbs
-
- Transaction Summary
- =================================================================================================================================================
- Install 4 Package(s)
- Update 4 Package(s)
- Remove 0 Package(s)
-
- Total download size: 1.8 M
-
- Installed:
- fuse.i386 0:2.7.4-8.el5 fuse-libs.i386 0:2.7.4-8.el5 libibverbs.i386 0:1.1.6-3.el5 openib.noarch 0:1.5.4.1-4.el5
-
- Updated:
- openssh-server.i386 0:4.3p2-82.el5 wget.i386 0:1.11.4-3.el5_8.2
-
- Dependency Updated:
- openssh.i386 0:4.3p2-82.el5 openssh-clients.i386 0:4.3p2-82.el5
-
- [root@192_168_165_88 ~]# yum -y install openssh-server wget fuse fuse-libs openib libibverbs
-
确定在glusterfs服务器上开启TCP与UDP端口:24007,24008 .另外,还要打开brick的起始端口 49152 (instead of 24009 onwards as with previous releases). The brick ports assignment scheme is now compliant with IANA guidelines. For example: if you have five bricks, you need to have ports 49152 to 49156 open.
You can use the following chains with iptables:
$ sudo iptables -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 24007:24008 -j ACCEPT $ sudo iptables -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 49152:49156 -j ACCEPT
Note
If you already have iptable chains, make sure that the above ACCEPT rules precede the DROP rules. This can be achieved by providing a lower rule number than the DROP rule.
-
在每个客户端操作系统上安装glusterfs, glusterfs-fuse, and glusterfs-rdma RPM包. glusterfs 包含 Gluster Native Client.glusterfs-fuse 包含挂载FUSE 转换,glusterfs-rdma 包含 OpenFabrics RDMA module for Infiniband.
You can download the software at GlusterFS download page.
-
Install Gluster Native Client on the client.
$ sudo rpm -i glusterfs-3.3.0qa30-1.x86_64.rpm $ sudo rpm -i glusterfs-fuse-3.3.0qa30-1.x86_64.rpm $ sudo rpm -i glusterfs-rdma-3.3.0qa30-1.x86_64.rpm
Note
The RDMA module is only required when using Infiniband.
未完...
参考:http://gluster.readthedocs.org/en/latest/Administrator%20Guide/Setting%20Up%20Clients/