gluster / glusterfs

Gluster Filesystem : Build your distributed storage in minutes
https://www.gluster.org
GNU General Public License v2.0
4.68k stars 1.08k forks source link

Gluster adds NBD(Network Block Device) support #633

Closed lxbsz closed 4 years ago

lxbsz commented 5 years ago

Currently we are supporting the Block device via the LIO/TCMU & gluster-block in Gluster, the IO path will be like:

/dev/sdXX(VFS, block layer, SCSI proto, iSCSI proto) from client side --> Network --> /dev/uioYY(iSCSI proto, SCSI proto, VFS).

But if we are using the iSCSI device as a local case, this will be a long path, there has two other ways to deal with this: 1, loop back device, this need to loop back to the kernel space twice. 2, nbd device, this could be loop back to the kernel space once.

In theory, the NBD will be more efficient than the loop back and the iSCSI ways.

There will be two step to add the NBD support: 1, add one tool based on the glfsapi. Under coding... 2, add on xlator like the nfs. Under coding...

Any idea and suggestion are welcome here. Thanks.

gluster-ant commented 5 years ago

A patch https://review.gluster.org/22276 has been posted that references this issue.

tools: add Network Block Device mapping tool support

The glusternbd tool will map the volume file to one nbd device. The steps will be:

This patch is based the nbd netlink feature and need to use the upstream kernel and in theory the nbd device number is unlimited.

Usage: nbd []

Commands: help display help for nbd commands

create <volname@host:/path> [prealloc <full|no>] <size SIZE>
    create path file on the volname volume, prealloc is no as default,
    and the SIZE is valid with B, K(iB), M(iB), G(iB), T(iB), P(iB), E(iB), Z(iB), Y(iB)

delete <volname@host:/path>
    delete path file on the volname volume

map <volname@host:/path> [nbd-device] [threads NUM] [timeout TIME] [daemon on|off]
    map path file to the nbd device, as default the threads 4, timeout 0 and daemon on

umap <nbd-device>
    umap the nbd device

list <mapd|umap|all>
    list the mapped|umapped|all nbd devices, all as default

version
    show version info and exit.

Change-Id: I7adb503ff38ee77df9471137cd32c6f6fb058f8f updates: #633 Signed-off-by: Xiubo Li xiubli@redhat.com

lxbsz commented 5 years ago

The new project is here: https://github.com/gluster/nbd-runner

stale[bot] commented 4 years ago

Thank you for your contributions. Noticed that this issue is not having any activity in last ~6 months! We are marking this issue as stale because it has not had recent activity. It will be closed in 2 weeks if no one responds with a comment here.

stale[bot] commented 4 years ago

Closing this issue as there was no update since my last update on issue. If this is an issue which is still valid, feel free to open it.