目录

6.1. DRBD (Distributed Replicated Block Device)
6.1.1. disk and partition6.1.2. Installation6.1.3. configure6.1.4. Starting6.1.5. Using
6.2. Network Block Device protocol
6.2.1. nbd-server - Network Block Device protocol - server6.2.2. nbd-client - Network Block Device protocol - client
6.3. GridFS
6.3.1. nginx-gridfs6.3.2. lighttpd-gridfs
6.4. Moose File System
6.4.1. Master server installation6.4.2. Backup server (metalogger) installation 6.4.3. Chunk servers installation6.4.4. Users’ computers installation6.4.5. Testing MFS
6.5. LizardFS6.6. Ceph
6.6.1. Installation on Ubuntu6.6.2. Installation on CentOS
6.6.2.1. mon6.6.2.2. mds6.6.2.3. osd6.6.2.4. client6.6.2.5. RADOS Gateway
6.6.3. Block Devices
6.7. GlusterFS
6.7.1. glusterfs-server6.7.2. glusterfs-client6.7.3. Testing6.7.4. RAID
6.7.4.1. Mirror6.7.4.2. Strip
6.7.5. Filesystem Administration6.7.6. CentOS 6.3
6.8. Lustre6.9. MogileFS6.10. Kosmos distributed file system (KFS)6.11. Hadoop - HDFS6.12. BeeGFS - The Parallel Cluster File System6.13. Coda6.14. OpenAFS

6.1. DRBD (Distributed Replicated Block Device)

Homepage: http://www.drbd.org/

实验环境需要两台电脑,如果你没有,建议你使用VMware,并且为每一个虚拟机添加两块硬盘。

实验环境

  1. master: 192.168.0.1 DRBD:/dev/sdb

  2. slave: 192.168.0.2 DRBD:/dev/sdb

6.1.1. disk and partition

Each of the following steps must be completed on both nodes

show all of disk and partition

neo@master:~$ sudo sfdisk -s
/dev/sda:   8388608
/dev/sdb:   2097152
total: 10485760 blocks

create a new partition on the disk /dev/sdb

$ sudo cfdisk /dev/sdb         

you must have extended partition

check partition

neo@master:~$ sudo fdisk -lDisk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000301bdDevice Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         993     7976241   83  Linux
/dev/sda2             994        1044      409657+   5  Extended
/dev/sda5             994        1044      409626   82  Linux swap / SolarisDisk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         261     2096451    5  Extended
/dev/sdb5               1         261     2096419+  83  Linux

format /dev/sdb1

neo@master:~$ sudo mkfs.ext3 /dev/sdb1

you also can using other file system

reiserfs

neo@master:~$ sudo mkfs.reiserfs /dev/sdb1        

I suggest you using reiserfs.

6.1.2. Installation

Each of the following steps must be completed on both nodes

search drbd8-utils package

neo@master:~$ apt-cache search drbd
drbd8-utils - RAID 1 over tcp/ip for Linux utilities
drbd0.7-module-source - RAID 1 over tcp/ip for Linux module source
drbd0.7-utils - RAID 1 over tcp/ip for Linux utilities
drbdlinks - Manages symlinks into a shared DRBD partition

installation

neo@master:~$ sudo apt-get install drbd8-utils            

to add modules from the Linux Kernel

neo@master:~$ sudo modprobe drbd
neo@master:~$ lsmod |grep drbd
drbd                  213000  0
cn                      9632  1 drbd

6.1.3. configure

Each of the following steps must be completed on both nodes

backup configure file

neo@master:~$ sudo cp /etc/drbd.conf /etc/drbd.conf.old

edit /etc/drbd.conf

global { usage-count yes;
}
common {protocol C;
}
resource r0 {on master {device    /dev/drbd0;disk      /dev/sdb5;address   192.168.0.1:7789;meta-disk internal;}on slave {device    /dev/drbd0;disk      /dev/sdb5;address   10.1.1.32:7789;meta-disk internal;}
}

6.1.4. Starting

Each of the following steps must be completed on both nodes.

neo@master:~$ sudo drbdadm create-md r0
neo@master:~$ sudo drbdadm attach r0
neo@master:~$ sudo drbdadm connect r0
neo@master:~$ sudo drbdadm -- --overwrite-data-of-peer primary r0neo@slave:~$ sudo drbdadm create-md r0
neo@slave:~$ sudo drbdadm attach r0
neo@slave:~$ sudo drbdadm connect r0

master

neo@master:~$ sudo drbdadm create-md r0
v08 Magic number not found
md_offset 2146725888
al_offset 2146693120
bm_offset 2146627584Found some data==> This might destroy existing data! <==Do you want to proceed?
[need to type 'yes' to confirm] yesv07 Magic number not found
v07 Magic number not found
v08 Magic number not found
Writing meta data...
initialising activity log
NOT initialized bitmap
New drbd meta data block sucessfully created.
success

slave

neo@slave:~# sudo drbdadm create-md r0
v08 Magic number not found
md_offset 2146725888
al_offset 2146693120
bm_offset 2146627584Found some data==> This might destroy existing data! <==Do you want to proceed?
[need to type 'yes' to confirm] yesv07 Magic number not found
v07 Magic number not found
v08 Magic number not found
Writing meta data...
initialising activity log
NOT initialized bitmap
New drbd meta data block sucessfully created.
success

status

neo@master:~$ cat /proc/drbd
version: 8.0.11 (api:86/proto:86)
GIT-hash: b3fe2bdfd3b9f7c2f923186883eb9e2a0d3a5b1b build by phil@mescal, 2008-02-12 11:56:430: cs:StandAlone st:Primary/Unknown ds:UpToDate/DUnknown   r---ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0resync: used:0/31 hits:0 misses:0 starving:0 dirty:0 changed:0act_log: used:0/127 hits:0 misses:0 starving:0 dirty:0 changed:01: cs:Connected st:Secondary/Secondary ds:Diskless/Inconsistent C r---ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0

6.1.5. Using

master

neo@master:~$ sudo drbdadm primary all
neo@master:~$ sudo mkfs.reiserfs /dev/drbd0
neo@master:~$ sudo mkdir /mnt/drbd0
neo@master:~$ sudo mount /dev/drbd0 /mnt/drbd0/
neo@master:~$ sudo touch /mnt/drbd0/helloworld.tmp
neo@master:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             7.6G  1.3G  6.0G  18% /
varrun                125M  216K  125M   1% /var/run
varlock               125M  8.0K  125M   1% /var/lock
udev                  125M   60K  125M   1% /dev
devshm                125M     0  125M   0% /dev/shm
/dev/drbd0            2.0G   33M  2.0G   2% /mnt/drbd0
neo@master:~$ sudo dd if=/dev/zero of=/mnt/drbd0/tempfile1.tmp bs=104857600 count=1
1+0 records in
1+0 records out
104857600 bytes (105 MB) copied, 0.564911 s, 186 MB/s
neo@master:~$ sudo umount /mnt/drbd0/
neo@master:~$ sudo drbdadm secondary all

slave

neo@slave:~$ sudo drbdadm primary all
neo@slave:~$ sudo mkdir /mnt/drbd0
neo@slave:~$ sudo mount /dev/drbd0 /mnt/drbd0/
neo@slave:~$ ls /mnt/drbd0/
helloworld.tmp  tempfile1.tmp           

原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

第 6 章 Distributed File Systems相关推荐

  1. Linux 2.6内核配置说明(File systems文件系统)

    转载博客博主的网址  https://blog.csdn.net/liu1164316159/article/category/1588671 Second extended fs support E ...

  2. centos重启报错Umounting file systems:umount:/opt:device is busy

    系统重启报错: Umounting file systems:umount:/opt:device is busy 只能硬关机,回想一下最近刚安装了nod32 for linux x64的杀毒软件,开 ...

  3. Oracle ASM Cluster File Systems (ACFS)应用指南

    ACFS是oracle database 11gR2的一个新特性.关于ACFS的更多信息请参考官方文档.这篇文章是基于RAC环境写的,不知道在非RAC环境中,还能不能使用ACFS呢,有兴趣的朋友可以测 ...

  4. PacificA: Replication in Log-Based Distributed Storage Systems 论文理解

    PacificA: Replication in Log-Based Distributed Storage Systems 论文理解 思考:论文有个结论说,相比 GFS 具有中心化的实体,Pacif ...

  5. Introducing Microsoft Sync Framework: Sync Services for File Systems

    https://msdn.microsoft.com/en-us/sync/bb887623 Introduction to Microsoft Sync Framework File Synchro ...

  6. eclipse中import existing projects into workspace和open projects from file systems分别有什么用?

    初看上去感觉这两个没啥区别,一个是import existing projects into workspace,就是导入文件:一个是open projects from file systems,就 ...

  7. HDFS(hadoop distributed File System)详解

    HDFS(hadoop distributed File System)分布式文件系统 特点:高容错性(多个文本副本存储),价格低,高吞吐量. 常见的系统  gfs,HDFS.Lustre .Ceph ...

  8. 第一部分:基础知识(第一章)File | New | Project

    File | New | Project 你需要在Windows7下的Visual Studio 2010开发平台上安装Visual Studio 2010 Express for Windows P ...

  9. python3 第三十四章 - 聊聊File对象

    file 对象使用 open 函数来创建,下表列出了 file 对象常用的函数: 序号 方法及描述 实例  1 file.close() 关闭文件.关闭后文件不能再进行读写操作. 方法用于关闭一个已打 ...

最新文章

  1. 浅谈WebSocket
  2. 解决方法WindowsError: [Error 193] %1 is not a valid Win32 application
  3. 集群、负载均衡、分布式
  4. 服务器无线不能登录界面,Web认证无法跳转到登录页面
  5. Http基本身份验证在Spring Security中如何工作?
  6. 那些年,我写过的设置Windows系统变量的vbs脚本
  7. CENTOS6 X64 LAMP+GD SHELL脚本
  8. Visual Studio Code 编辑器 使用入门
  9. tensorflow基础:tf.data.Dataset.from_tensor_slices()
  10. Mybatis动态标签基本使用
  11. 新手怎样利用博客推广
  12. T SNE降维matlab程序,关于t-SNE降维方法
  13. 苹果笔记本怎么找文件夹_苹果电脑的文件存在哪里_苹果电脑把文件放到哪-win7之家...
  14. 笔记本电脑计计算机硬盘分区,笔记本电脑如何分区,教您笔记本电脑如何分盘...
  15. VOLTE_SRVCC和ESRVCC
  16. 深度学习7 Transformer系列实例分割Mask2Former
  17. 什么是Iot?什么是AIot?
  18. echarts修改横轴/xAxis的样式
  19. JavaScript高级程序设计[第3版]
  20. php标题 栏目不显示title,WordPress 首页title副标题不显示的解决方法

热门文章

  1. 在jsp页面实现保存登录用户名和密码
  2. bean 属性设置默认值_activiti7源码分析之引擎初始化与Bean注入
  3. c语言获取按键痕迹,c语言获得键盘的按键
  4. mysql命令查看过程内容_mysql查看存储过程命令
  5. sql 临时表_原创 | SQL优化之合理使用临时表
  6. 什么时候html的过渡版本,CSS过渡与转换
  7. html语言 怎么清除用户名 name= password=,在html页面中填写注册表单后,它会给出这个错误,并使用用户名和密码并将值存储在登录表单中...
  8. js function如何传入参数未字符串_JavaScript 学习之路- JS 小测验
  9. activemq 控制台怎么看生产信息_Jmeter中间件处理-ActiveMQ
  10. java环境变量设置的作用_JDK环境变量的配置及作用