博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
GlusterFS
阅读量:6847 次
发布时间:2019-06-26

本文共 5822 字,大约阅读时间需要 19 分钟。

Netkiller Linux Storage 手札

File System, Network File System, Distributed Filesystem...

MrNeo Chan陈景峰(BG7NYT)

中国广东省深圳市宝安区龙华镇溪山美地
518109
+86 755 29812080
+86 755 29812080

 

版权 © 2010, 2011 Netkiller(Neo Chan). All rights reserved.

版权声明

转载请与作者联系,转载时请务必标明文章原始出处和作者信息及本声明。

 

文档出处:  | 

文档最近一次更新于 Mon Jul 18 02:09:37 UTC 2011

2010-11-18

系列文档

下面是我多年积累下来的经验整理文档供大家参考:

 |  |  |  | 

 |  |  |  | 

 |  |  |  |  | 

 |  |  |  | 

 

 | 

GlusterFS

$ apt-cache search glusterfsglusterfs-client - clustered file-system (client package)glusterfs-dbg - GlusterFS debugging symbolsglusterfs-examples - example files for the glusterfs server and clientglusterfs-server - clustered file-system (server package)libglusterfs-dev - GlusterFS development libraries and headers (development files)libglusterfs0 - GlusterFS libraries and translator modules

5.1. glusterfs-server

$ sudo apt-get install glusterfs-server$ sudo cp /etc/glusterfs/glusterfsd.vol /etc/glusterfs/glusterfsd.vol.orig
$ cat /etc/glusterfs/glusterfsd.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/export        # Export this directoryend-volume### Add network serving capability to above brick.volume server  type protocol/server  option transport-type tcp# option transport-type unix# option transport-type ib-sdp# option transport.socket.bind-address 192.168.1.10     # Default is to listen on all interfaces# option transport.socket.listen-port 6996              # Default is 6996# option transport-type ib-verbs# option transport.ib-verbs.bind-address 192.168.1.10     # Default is to listen on all interfaces# option transport.ib-verbs.listen-port 6996              # Default is 6996# option transport.ib-verbs.work-request-send-size  131072# option transport.ib-verbs.work-request-send-count 64# option transport.ib-verbs.work-request-recv-size  131072# option transport.ib-verbs.work-request-recv-count 64# option client-volume-filename /etc/glusterfs/glusterfs-client.vol  subvolumes brick# NOTE: Access to any volume through protocol/server is denied by# default. You need to explicitly grant access through # "auth"# option.  option auth.addr.brick.allow * # Allow access to "brick" volumeend-volume
$ sudo mkdir /home/export$ sudo /etc/init.d/glusterfs-server start$ sudo /etc/init.d/glusterfs-server status * GlusterFS server is running.

5.2. glusterfs-client

 

$ sudo apt-get install glusterfs-client$ sudo cp /etc/glusterfs/glusterfs.vol /etc/glusterfs/glusterfs.vol.orig
# cat /etc/glusterfs/glusterfs.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 subvolumevolume client  type protocol/client  option transport-type tcp# option transport-type unix# option transport-type ib-sdp  option remote-host 192.168.80.1         # IP address of the remote brick# option transport.socket.remote-port 6996              # default server port is 6996# option transport-type ib-verbs# option transport.ib-verbs.remote-port 6996              # default server port is 6996# option transport.ib-verbs.work-request-send-size  1048576# option transport.ib-verbs.work-request-send-count 16# option transport.ib-verbs.work-request-recv-size  1048576# option transport.ib-verbs.work-request-recv-count 16# option transport-timeout 30          # seconds to wait for a reply                                       # from server for each request  option remote-subvolume brick        # name of the remote volumeend-volume### Add readahead feature#volume readahead#  type performance/read-ahead#  option page-size 1MB     # unit in bytes#  option page-count 2       # cache per file  = (page-count x page-size)#  subvolumes client#end-volume### Add IO-Cache feature#volume iocache#  type performance/io-cache#  option page-size 256KB#  option page-count 2#  subvolumes readahead#end-volume### Add writeback feature#volume writeback#  type performance/write-behind#  option aggregate-size 1MB#  option window-size 2MB#  option flush-behind off#  subvolumes iocache#end-volume
mkdir /mnt/glusterfsglusterfs -f /etc/glusterfs/glusterfs.vol /mnt/glusterfsormount -t glusterfs /etc/glusterfs/glusterfs.vol /mnt/glusterfs

fstab

/etc/glusterfs/glusterfs.vol  /mnt/glusterfs  glusterfs  defaults  0  0

5.3. Testing

client

touch /mnt/glusterfs/test1touch /mnt/glusterfs/test2

server

# ll /mnt/glusterfstotal 0-rw-r--r-- 1 root root 0 Jun 16 11:57 test1-rw-r--r-- 1 root root 0 Jun 16 11:57 test2

5.4. RAID

ref:

5.4.1. Mirror

例 6.1. Mirror

glusterfs-volgen --name store1 --raid 1 gluster1:/home/export gluster2:/home/export

5.4.2. Strip

例 6.2. Strip

glusterfs-volgen --name store1 --raid 0 gluster1:/home/export gluster2:/home/export
你可能感兴趣的文章
[置顶] 批处理命令
查看>>
谈谈不换行空格
查看>>
ubuntu 13.04 nginx.conf 配置详解
查看>>
Android调用系统的打电话和发短信界面(1.将消息内容带过去2.实现群发)
查看>>
如何在内网安装compass
查看>>
TF-IDF理解及其Java实现
查看>>
CRLF line terminators导致shell脚本报错:command not found
查看>>
LeetCode - Combination Sum
查看>>
Mysql 正则获取字段的交集【转】
查看>>
Java NIO2:缓冲区
查看>>
AngularJS 使用$sce控制代码安全检查
查看>>
Linux中ifreq 结构体分析和使用 及其在项目中的简单应用
查看>>
牛客网-《剑指offer》-重建二叉树
查看>>
民用飞机蓄电池选型
查看>>
unity, GUI.Button texture is black
查看>>
CSharpGL(10)两个纹理叠加
查看>>
Linux 删除用户
查看>>
WebApi系列~dynamic让你的省了很多临时类
查看>>
urllib2的异常处理
查看>>
架构之路(九)Session Per Request
查看>>