{"id":83,"date":"2023-08-05T07:35:09","date_gmt":"2023-08-05T07:35:09","guid":{"rendered":"http:\/\/it4home.dk\/?p=83"},"modified":"2023-08-06T09:18:31","modified_gmt":"2023-08-06T09:18:31","slug":"setting-up-glusterfs-distributed-file-system-on-raspberry-pi-cluster","status":"publish","type":"post","link":"https:\/\/it4home.dk\/index.php\/2023\/08\/05\/setting-up-glusterfs-distributed-file-system-on-raspberry-pi-cluster\/","title":{"rendered":"Setting Up GlusterFS Distributed File System on Raspberry Pi Cluster"},"content":{"rendered":"<div class=\"pdfprnt-buttons pdfprnt-buttons-post pdfprnt-top-right\"><a href=\"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts\/83?print=pdf\" class=\"pdfprnt-button pdfprnt-button-pdf\" target=\"_blank\" ><\/a><a href=\"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts\/83?print=print\" class=\"pdfprnt-button pdfprnt-button-print\" target=\"_blank\" ><img decoding=\"async\" src=\"https:\/\/it4home.dk\/wp-content\/plugins\/pdf-print\/images\/print.png\" alt=\"image_print\" title=\"Print Content\" \/><\/a><\/div>\n<p class=\"wp-block-paragraph\">Introduction:<br>GlusterFS is a distributed file system designed to work across multiple nodes, providing high availability and scalability. In this guide, we&#8217;ll show you how to set up GlusterFS on a Raspberry Pi cluster to create a shared storage pool.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Note: Ensure you have configured the hosts file on the server and worker nodes, as mentioned in the instructions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Step 1: Install GlusterFS<br>On the server and worker nodes, install GlusterFS with the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\nsudo apt install -y glusterfs-server\nsudo systemctl enable --now glusterd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Step 2: Peer All Nodes<br>From the master node (RPISWARM), peer all the nodes to the GlusterFS pool:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gluster peer probe RPIWORK1\ngluster peer probe RPIWORK2\ngluster peer probe RPIWORK3<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Step 3: Create Gluster Volume<br>On the master node (RPISWARM), create the Gluster volume across the GlusterFS pool:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir -p \/gluster\/volumes\nsudo gluster volume create staging-gfs replica 4 RPISWARM:\/gluster\/volumes RPIWORK1:\/gluster\/volumes RPIWORK2:\/gluster\/volumes RPIWORK3:\/gluster\/volumes force<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Step 4: Start the Gluster Volume<br>On the master node (RPISWARM), start the Gluster volume:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo gluster volume start staging-gfs<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Step 5: Auto Start GlusterFS Mount on Reboot<br>On the master node (RPISWARM), add an entry to the <code>\/etc\/fstab<\/code> file to auto-mount the GlusterFS volume:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo su\necho 'localhost:\/staging-gfs \/mnt glusterfs defaults,_netdev,backupvolfile-server=localhost 0 0' &gt;&gt; \/etc\/fstab\nmount.glusterfs localhost:\/staging-gfs \/mnt\nchown -R root:docker \/mnt\nexit<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Step 6: Verify GlusterFS Mount<br>Verify that the GlusterFS volume is mounted with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>df -h\nsudo mount.glusterfs localhost:\/staging-gfs \/mnt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Conclusion:<br>You&#8217;ve successfully set up GlusterFS on your Raspberry Pi cluster, creating a distributed file system that provides shared storage across multiple nodes. GlusterFS enables you to distribute data across the nodes, improving data availability and performance. With this configuration, you can leverage the power of GlusterFS to build resilient and scalable storage solutions for your Raspberry Pi cluster.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Happy distributed file system management!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction:GlusterFS is a distributed file system designed to work across multiple nodes, providing high availability and scalability. In this guide, we&#8217;ll show you how to set up GlusterFS on a Raspberry Pi cluster to&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":205,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[2],"tags":[35],"class_list":["post-83","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker","tag-ok"],"_links":{"self":[{"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts\/83","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/comments?post=83"}],"version-history":[{"count":2,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts\/83\/revisions"}],"predecessor-version":[{"id":135,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/posts\/83\/revisions\/135"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/media\/205"}],"wp:attachment":[{"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/media?parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/categories?post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it4home.dk\/index.php\/wp-json\/wp\/v2\/tags?post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}