博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
network block device(nbd)
阅读量:7114 次
发布时间:2019-06-28

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

网络块设备是一个廉价的共享存储解决方案, 结合分布式文件系统可以构建比较有规模的共享块设备.
例如, 在以下架构里面, 分布式存储提供冗余,共享和扩展性. 
多台NBD提供冗余以及共享网络块设备.
NBD SERVER和分布式存储可以共享主机, 也可以分开主机. 

这个架构需要注意的问题,
例如操作系统层缓存, 当从nbd-server切换到另一个nbd-server时, 如果有缓存为写入镜像文件的话, 会导致数据丢失.

network block device(nbd) - 德哥@Digoal - PostgreSQL research

例子 : 
使用nbd构建Oracle-RAC : 
典型的例子, 使用共享存储.
network block device(nbd) - 德哥@Digoal - PostgreSQL research
使用NBD : 
network block device(nbd) - 德哥@Digoal - PostgreSQL research

NBD在WIKI中的介绍 : 

Network block device

From Wikipedia, the free encyclopedia

In , a network block device is a  whose content is provided by a remote machine. Typically, network block devices are used to access a storage device that does not physically reside in the local machine but on a remote one. As an example, the local machine can access a  that is attached to another computer.

Contents

 
 [] 

Kernel client/userspace server[]

Technically, a network block device is realized by two components. In the client machine, where the device node is to work, a kernel module named nbd controls the device. Whenever a program tries to access the device, this kernel module forwards the request to the server machine, where the data physically resides.

On the server machine, requests from the client are handled by a userspace program called nbd-server. This program is not implemented as a kernel module because all it has to do is to serve network requests, which in turn just requires regular access to the server filesystem.

Example[]

If the file /tmp/xxx on ComputerA has to be made accessible on ComputerB, one performs the following steps:

On ComputerA:

nbd-server 2000 /tmp/xxx

On ComputerB:

modprobe nbdnbd-client ComputerA 2000 /dev/nbd0

The file is now accessible on ComputerB as device /dev/nbd0. If the original file was for example a , it could be mounted for example via mount /dev/nbd0 /mnt/whatever.

The command modprobe nbd is not necessary if module loading is done automatically. Once the module is in the kernel, nbd-client is used to send commands to it, such as associating a given remote file to a given local nb device. To finish using /dev/nbd0, that is, to destroy its association with the file on other computer, one can run nbd-client -d /dev/nbd0 on ComputerB.

In this example, 2000 is the number of the server  through which the file is made accessible. Any available port could be used.

Availability[]

The network block device client module is available on  and .

Since the server is a userspace program, it can potentially run on every  platform. It was ported to .


在CentOS或RHEL下可以使用EPEL附加仓库安装nbd :
[root@150 postgresql-9.3.5]# yum install -y nbdLoaded plugins: fastestmirror, refresh-packagekit, security, versionlockLoading mirror speeds from cached hostfileepel/metalink                                                                                                | 5.4 kB     00:00      * base: mirrors.skyshe.cn * epel: mirrors.ustc.edu.cn * extras: mirrors.163.com * updates: centos.mirror.cdnetworks.combase                                                                                                         | 3.7 kB     00:00     extras                                                                                                       | 3.3 kB     00:00     updates                                                                                                      | 3.4 kB     00:00     updates/primary_db                                                                                           | 5.3 MB     00:21     Setting up Install ProcessResolving Dependencies--> Running transaction check---> Package nbd.x86_64 0:2.9.20-7.el6 will be installed--> Finished Dependency ResolutionDependencies Resolved==================================================================================================================================== Package                     Arch                           Version                              Repository                    Size====================================================================================================================================Installing: nbd                         x86_64                         2.9.20-7.el6                         epel                          43 kTransaction Summary====================================================================================================================================Install       1 Package(s)Total download size: 43 kInstalled size: 83 kDownloading Packages:nbd-2.9.20-7.el6.x86_64.rpm                                                                                  |  43 kB     00:00     Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction  Installing : nbd-2.9.20-7.el6.x86_64                                                                                          1/1   Verifying  : nbd-2.9.20-7.el6.x86_64                                                                                          1/1 Installed:  nbd.x86_64 0:2.9.20-7.el6                                                                                                         Complete!
包含的内容 : 
[root@150 postgresql-9.3.5]# rpm -ql nbd/usr/bin/nbd-server/usr/sbin/nbd-client/usr/share/doc/nbd-2.9.20/usr/share/doc/nbd-2.9.20/README/usr/share/doc/nbd-2.9.20/cliserv.h/usr/share/doc/nbd-2.9.20/nbd-tester-client.c/usr/share/doc/nbd-2.9.20/simple_test/usr/share/man/man1/nbd-server.1.gz/usr/share/man/man5/nbd-server.5.gz/usr/share/man/man8/nbd-client.8.gz
[参考]
1. 
2. 
3. 
4. 
5. 
6. 
7. 
8. 
9. 
man 1 nbd-server
man 5 nbd-server
man 8 nbd-client

转载地址:http://hbzel.baihongyu.com/

你可能感兴趣的文章
一步一步教你使用AgileEAS.NET基础类库进行应用开发-基础篇-演示ORM中的查询
查看>>
《C#高级编程》笔记系列--点滴记录(持续更新中……)
查看>>
采用泳道图工具跟踪项目进度或者问题解决进度
查看>>
sql server 2008学习1–系统数据库
查看>>
从微软的DBML文件中我们能学到什么(它告诉了我们什么是微软的重中之重)~三 分部类是否破坏了单一职责...
查看>>
HDU1004 Let the Balloon Rise
查看>>
value toDF is not a member of org.apache.spark.rdd.RDD
查看>>
高性能MySQL——Count(1) OR Count(*)?
查看>>
Spark源码分析之Worker
查看>>
CAS与spring3集成
查看>>
XenCenter导出虚拟机
查看>>
css中的disabled的使用
查看>>
Cookie禁用了Session还可以用吗?
查看>>
Python中*args 和**kwargs的用法
查看>>
决心书
查看>>
提高Python代码效率的方法
查看>>
如何学习Python数据分析?
查看>>
爱创课堂每日一题七十六天- 请解释什么是事件代理?
查看>>
运维39期决心书
查看>>
将数字转化为字符串
查看>>