This blog is a getting start guide with gluster-block project. Gluster-block has many features, hence I have decided not to dump everything in one single page. I’ll split the details and write short guide in individual blogs covering each of its features.
Here will walk through the introduction to gluster-block, how to configure this in its simplest form with a single server node and attach it on a client.
Gluster-block is a framework for gluster block storage, which aims at making Gluster backed block storage creation and maintenance as simple as possible.
As of today, gluster-block serves tcmu based block devices. Tcmu allows userspace programs to act as iSCSI targets.
And thanks to tcmu-runner project, for implementing one such userspace pass-through with gluster as backend for tcmu, which had made our life easy.
This is just the beginning, in the future gluster-block project will embed many ways to provision block storage backed by glusterfs.
Example: via qemu-tcmu, via nbd, via kernel loopback and more …
I will be using a Fedora-29 instance here, but one can also use CentOs or Ubuntu as well, our users have already tried and mentioned it works well for them,
Gluster-block package is already part of Fedora collection
[server ~]# dnf install gluster-block
Just in case if you still cannot get gluster-block-v0.4 (latest stable release), you better source install
[server ~]# git clone https://github.com/gluster/gluster-block.git
[server ~]# cd gluster-block
[server ~]# dnf install gcc autoconf automake make file libtool libuuid-devel json-c-devel glusterfs-api-devel glusterfs-server tcmu-runner targetcli rpcgen libtirpc-devel
[server ~]# ./autogen.sh && ./configure && make -j install
Creating the block volume
- A block hosting gluster volume
- Open 24007(for glusterd) 24010(gluster-blockd) 3260(iscsi targets) 111(rpcbind) ports and glusterfs service in your firewall
Create a block hosting gluster volume, which will host block volume
[server ~]# dnf install glusterfs-server
[server ~]# systemctl start glusterd
[server ~]# gluster volume create hosting-volume <Host-IP>:/brick force
[server ~]# gluster volume start hosting-volume
Lets now create block volume on the above created hosting-volume
[server ~]# systemctl start gluster-blockd
[server ~]# gluster-block create hosting-volume/block-volume <Host-IP> 1GiB –json-pretty
Attaching the block volume
[client ~]# dnf install iscsi-initiator-utils
[client ~]# systemctl start iscsid.service
Discover and login to the block volume
[client ~]# iscsiadm -m discovery -t st -p <Host-IP> -l
Get the device listed
[client ~]# lsblk
Format the device
[client ~]# mkfs.xfs /dev/sdX
Mount the block device
[client ~]# mount /dev/sdX /mnt
Learn how to gracefully logout and delete the block volume:
Demo (More detailed)
- Please join our mailing list
- To ask a question or start a discussion, you can also raise an issue
- IRC: #gluster-devel on Freenode
My next blog will talk about ‘How to achieve High-Availability Block-Device’Thanks for your time!