Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1369572
  • 博文数量: 140
  • 博客积分: 8518
  • 博客等级: 中将
  • 技术积分: 1822
  • 用 户 组: 普通用户
  • 注册时间: 2005-03-01 22:23
个人简介

嘿嘿!

文章分类
文章存档

2016年(2)

2015年(5)

2014年(6)

2013年(11)

2012年(11)

2011年(3)

2010年(4)

2009年(4)

2008年(8)

2007年(23)

2006年(26)

2005年(37)

分类: 服务器与存储

2013-08-31 17:21:44

Managing GlusterFS Volumes

1人收藏此文章, 发表于1年前(2012-08-01 22:14) , 已有453次阅读 ,共0个评论

调整volume的参数

命令:gluster volume set VOLNAME OPTION PARAMETER

 

Expanding Volumes

你可能想在线扩展卷的大小,例如:你想给分布式的卷中增加brick,以增加卷的容量。注意:当你给分布式复制卷和分布式条带卷中增加bricks 时,你增加的bricks的数目必须是复制或者条带数目的倍数,例如:你给一个分布式复制卷的replica为2,你在增加bricks的时候数量必须为 2、4、6、8等。

先把你想加入的存储服务器加入可信存储池中:

gluster peer probe HOSTNAME

然后再把该存储服务器上的cricks加入卷中:

gluster volume add-brick VOLNAME NEW-BRICK

接着查看卷信息

gluster volume info

最后要重新平衡一下卷上的文件,使新卷上也分布文件

 

Shrinking Volumes

你可能想在线缩小卷的大小,例如:当硬件损坏或者网络故障的时候,你可能想在卷中移除相关的bricks。注意:当你移除bricks的时候,你在 gluster的挂载点将不能继续访问数据,只有配置文件中的信息移除后你才能继续访问bricks的数据。当移除分布式复制卷或者分布式条带卷的时候, 移除的bricks数目必须是replica或者stripe的倍数。例如:一个分布式条带卷的stripe是2,当你移除bricks的时候必须是2、 4、6、8等。

移除bricks:

gluster volume remove-brick VOLNAME BRICK

检查卷信息:

gluster volume info

重新平衡卷,确保所有的文件都分布在bricks中。

 

Migrating Volumes

你可能想在线迁移一个brick中的数据到另一个brick中。

首先确保把相关的存储服务器加入可信存储池中。

迁移数据到另一个brick中:

gluster volume replace-brick VOLNAME BRICKNEW-BRICK start

如果有需要,你在中途中可以暂停迁移

gluster volume replace-brick VOLNAME BRICK NEW-BRICK  pause

如果有需要,你在中途中可以中断迁移

gluster volume replace-brick VOLNAME BRICK NEW-BRICK abort

检查brick迁移的进度状态

gluster volume replace-brick VOLNAME BRICK NEW-BRICK status

提交迁移数据从一个bricks到另一个brick

gluster volume replace-brick VOLNAME BRICK NEW-BRICK commit

 

Rebalancing Volumes

当你扩展或者缩小卷之后,需要重新在服务器直接重新平衡一下数据,重新平衡的操作被分为两个步骤:

1  Fix Layout

   修改扩展或者缩小后的布局,以确保文件可以存储到新增加的节点中。

2 Migrate Data

  重新平衡数据在新加入bricks节点之后。

* Fix Layout and Migrate Data

  先重新修改布局然后移动现有的数据(重新平衡)

 

你可以在在平衡过程中查看平衡信息:

gluster volume rebalance VOLNAME status

你也可以暂停平衡,再次启动平衡的时候会从上次暂停的地方继续开始平衡。

gluster volume rebalance VOLNAME stop

 

平衡布局是很有必要的,因为布局结构是静态的,当新的bricks加入现有卷,新创建的文件会分布到旧的bricks中,所以需要平衡布局结构,使 新加入的bricks生效。布局平衡只是使新布局生效,并不会在新的布局移动老的数据,如果你想在新布局生效后,重新平衡卷中的数据,还需要对卷中的数据 进行平衡。

gluster volume rebalance VOLNAME fix-layout start

gluster volume rebalance VOLNAME migrate-data start

也可以两步合一步同时操作

gluster volume rebalance VOLNAME start

你也可以删除/停止卷

gluster volume stop/delete VOLNAME

 

Triggering Self-Heal on Replicate

find gluster-mount -noleaf -print0 | xargs --null stat >/dev/null

 

Managing GlusterFS Geo-replication

GlusterFS Geo-replication provides a continuous, asynchronous, and incremental replication service

from one site to another over Local Area Networks (LANs), Wide Area Network (WANs), and across

the Internet.

 

Monitoring your GlusterFS Workload

1 Running GlusterFS Volume Profile Command

  Profile Command 提供接口查看一个卷中的每一个brick的IO信息。

 在查看相关信息之前,现必须启动profiling:

  gluster volume profile VOLNAME start

 然后查看相关IO信息

 gluster volume profile VOLNAME info

 查看完毕后关闭Profiling

 gluster volume profile VOLNAME stop

2 Running GlusterFS Volume TOP Command

  Top command 允许你查看bricks的性能例如:read, write, file open calls, file read calls, file write calls, directory open calls, and directory real calls

  查看打开的fd

  gluster volume top VOLNAME open [brick BRICK-NAME] [list-cnt cnt]

  查看调用次数最多的读调用

 gluster volume top VOLNAME read [brick BRICK-NAME] [list-cnt cnt]

  查看次数最多的写调用

 gluster volume top VOLNAME write [brick BRICK-NAME] [list-cnt cnt]

 查看次数最多的目录调用

 gluster volume top VOLNAME opendir [brick BRICK-NAME] [list-cnt cnt]

 gluster volume top VOLNAME readdir [brick BRICK-NAME] [list-cnt cnt]

 查看每个brick的读性能

 gluster volume top VOLNAME read-perf [bs blk-size count count] [brick BRICK-NAME] [list-cnt cnt]

 查看每个brick的写性能

  gluster volume top VOLNAME write-perf [bs blk-size count count] [brick BRICK-NAME] [list-cnt cnt]

 

Managing Directory Quota

目录配额允许你在glusterfs中限制目录/卷使用的磁盘空间,存储管理员可以在目录级别或者卷级别控制磁盘的使用率。你甚至可以给一个还未创建的目录设置地盘限制,当相应的目录创建后,该磁盘限制会立即生效。

要使用配额,则必须首先在相应的卷上开启配额:

gluster volume quota VOLNAME enable

如果不需要配额,也可以关闭他

gluster volume quota VOLNAME disable

 

1 设置磁盘限制

gluster volume quota VOLNAME limit-usage /directorylimit-value

 显示卷的磁盘限制信息

 gluster volume quota VOLNAME list [/directory name]

 

更新内存缓存大小,有时候为了性能的原因,quota caches the directory sizes on client。

gluster volume set VOLNAME features.quota-timeout value

消除磁盘限制

gluster volume quota VOLNAME remove /directory name

阅读(2704) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~