分类: 服务器与存储
2014-08-29 17:47:22
访问方式
1. GlusterNative Client
2. NFSv3 protocol
3. CIFS
① GlusterNative Client
1. 安装
wget -P /etc/yum.repos.d
# yum -y installglusterfs-fuse glusterfs
# modprobe fuse
# glusterfs–-version
2. 挂载GlusterFs
# mount -t glusterfsHOSTNAME-OR-IPADDRESS:/VOLNAME MOUNTDIR
Forexample:
# mount.glusterfs g1:/SR-volume /tmp/volume/
这样client就可以通过读写/tmp/volume/ 访问GlusterFs了。
需要自动挂载时,将下面内容写入文件 /etc/fstab中:
g1:/SR-volume /tmp/volume/ glusterfs defaults,_netdev 0 0
Mounting Options
backupvolfile-server=server-name
server-name为gluster的节点名字。mount.glusterfs g1:/SR-volume /tmp/volume/ 此时如果g1宕机,则客户端无法访问glusterfs;如果使用该选项指定另外一个server-name,即:
mount.glusterfs -o backupvolfile-server=g2 g1:/SR-volume /tmp/volume/ ,如果g2是在线状态,即便g1宕机,客户端也可以访问glusterfs。可以指定多个server-name。
fetch-attempts=N
尝试连接gluster server的次数,如果超过N次,则认为改节点不可用。
log-file=LOG-FILE
File to use for logging[default:/var/log/glusterfs/glusterfs.log]
log-level=LOG-LEVEL
Logging severity. Valid options are TRACE, DEBUG, WARNING, ERROR, CRITICAL INFO and NONE[default: INFO]
ro Mount the filesystem read-only
volfile-id=KEY
Volume key or name of the volumefile to be fetched from server
transport=TRANSPORT-TYPE
Transport type to get volume filefrom server [default: tcp]
volume-name=VOLUME-NAME
Volume name to be used for MOUNT-POINT [default: topmost volume in VOLUME-FILE]
direct-io-mode= [enable|disable]
Use direct I/O mode in fusekernel module
[default: "off" if bigwrites are supported, else
"on" for fds not openedwith O_RDONLY]
acl for enabling posix-ACLs
worm making the mount WORM - Write Once, Read Manytype
selinux enable selinux on GlusterFS mount
fopen-keep-cache
Do not purge the cache on fileopen.
Forexample:
# mount.glusterfs -o ro,acl,worm,direct-io-mode=enable,fopen-keep-cacheg1:/SR-volume /tmp/volume/
2.1 自动挂载
vi /etc/fstab
===========================================================
g1:/SR-volume /tmp/volume/ glusterfs ro,acl,defaults 0 0
===========================================================
②NFS
1. 安装
yum install –y rpcbind nfs-utils
2. 挂载GlusterFs
mount -t nfs g1:/SR-volume /tmp/volume/
2.1 自动挂载
vi /etc/fstab
===========================================================
g1:/SR-volume /tmp/volume/ nfs defaults 0 0
===========================================================
③CIFS
用于 Mac OS及Windonws系统;以samba服务为基础。