Starting with gluster-block

Introduction

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.

About gluster-block

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 …

Installing gluster-block

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

Prerequisites
  • 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:
https://github.com/gluster/gluster-block#gluster-block

Demo (More detailed)

Community

  • Please join our mailing list
  • To ask a question or start a discussion, you can also raise an issue
  • IRC: #gluster-devel on Freenode

INSTALL GUIDE
https://github.com/gluster/gluster-block/blob/master/INSTALL
https://github.com/gluster/gluster-block/issues/215 (Ubuntu)

USAGE GUIDE
https://github.com/gluster/gluster-block/blob/master/README.md
https://github.com/gluster/gluster-block/tree/master/docs
https://github.com/gluster/gluster-block/blob/master/tests/basic.t


My next blog will talk about ‘How to achieve High-Availability Block-Device’

Thanks for your time!



Advertisements

2 thoughts on “Starting with gluster-block

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s