美文网首页
[Sheepdog] 单节点多硬盘

[Sheepdog] 单节点多硬盘

作者: AustinPup | 来源:发表于2018-12-12 11:11 被阅读0次

介绍


多硬盘支持意味着我们能在一个节点上管理多块硬盘。以前,我们必须在每个磁盘上运行sheepdog。本地磁盘的管理和我们的节点管理一样智能。 意味着,sheep守护进程能自动处理磁盘故障,重新平衡/恢复数据对象,动态热插拔磁盘,不需要人工介入。
基本原理如下: 实现RAID 0类似机制,在没有奇偶校验或者复制的情况下,在本地磁盘分配sheep对象。相反,当我们需要修复故障磁盘丢失的数据,或者为新添加的磁盘迁移数据时,它依赖sheepdog的复制存储功能。总之,MD能获得类似底层RAID-0磁盘的高性能,且具有恢复功能。
MD在每一个sheep上需要一个私有的一致性哈希环来用于对象分发。MD层对sheep节点管理来说是完全透明的,意味着热插拔磁盘时不会导致sheep节点发生对象迁移。
MD能自动处理很多场景,支持不同尺寸的磁盘,当磁盘故障(新添加磁盘)时也能满足VM 的IO请求,即使多个磁盘同时故障,新磁盘插入故障. MD处理对VM是透明的,当所有磁盘损坏后,sheep仅充当网关作用。

启动MD

MD是sheep内带功能。不需要额外操作启动。建议命令如下

sheep /path/to/meta-store,/path/to/disk1{,/path/to/disk2,...}

Meta-store 是一个单点故障的存储位置,我们会在meta-stroe中存储epoch文件和配置文件,只有几KB大小。建议将meta-store 放在和操作系统一个分区上。
当然你也可以将meta-store 和 object-store放在同一个文件路径下。命令如下:
···
sheep /path/to/store # both meta-store and object-store are located in /path/to/store as old sheep
···
等同于下面命令

sheep /path/to/store,/path/to/store/obj 

升级旧版sheep

命令如下:

$ collie cluster shutdown
# upgrade the sheep binary 
$ sheep /path/to/store # works as before, put objects and meta data in the same directory

如果你想分开meta-stroe和object-store(建议如此),需要人工做以下操作:

1. $ collie cluster shutdown
2. $ mkdir /object-store1
3. $ mv /store1/obj/* /object-store1
4. $ sheep /store1,/object-store1
5. repeat {2,3,4} on node2

热插拔

新磁盘需要支持xattr。命令如下:

Three command added:
 $ collie node md info # show information about md of this node
 $ collie node md info --all # show information about md of all nodes
 $ collie node md plug path1{,path2,...} # plug disk(s) into node
 $ collie node md unplug path1{,path2,...} # unplug disk(s) into node

MD如何交互nodechange事件

MD恢复和节点改变事件逻辑相同,所以下一个事件(磁盘|节点)将取代前一个,并且多个事件会合并成一个,以便于最小化对象恢复。

FAQ

我能暂停自动磁盘恢复以便临时更换磁盘?

 $ collie cluster recover disable # stop the recovery if node or disk is failed
 $ #do what you want to do#
 $ collie cluster recover enable # enable the automatic recovery  

相关文章

网友评论

      本文标题:[Sheepdog] 单节点多硬盘

      本文链接:https://www.haomeiwen.com/subject/akeuhqtx.html