Gluster-Server

Gluster-Server

Docker app from testdasi's Repository

Overview

A docker running gluster server. This allows me to use a folder in the Unraid cache pool as persistent storage for Kubernetes / Docker Swarm through glusterfs. It works way better than NFS, especially for high-availability applications. For more detail readme, please refer to https://github.com/testdasi/gluster-server

gluster-server

A docker running gluster server. This primarily targets users of Unraid (and similar NAS OS) for which gluster cannot be installed but docker can. It then allows the host to run just like a normal gluster peer (e.g. to use Unraid as persistent storage for Kubernetes / Docker Swarm).

Bits and bobs:

  • Built for both Unraid and Raspberry Pi 4 but should work in other Linux amd64 / arm32v7 / arm32v6 / i386 docker environments.
  • I have only tested (and used) this with privileged=true. This is frowned upon by some as a very bad case of misconfiguration (e.g. wrong volume map) may harm the host, which kinda defeats the purpose of using docker. Of course, those folks haven't tried to install gluster on Slackware (e.g. Unraid), which is impossible.
    • Apparently, you can use volume "z" instead of "rw" to avoid needing privileged but I haven't tested that since privileged works well for me.
  • I recommend running with host network for best performance and having to avoid mapping the gazillion ports that gluster requires.
    • The docker exposes some selected ports e.g. for bridge mode which may or may not be sufficient for all use cases.
      • BRICK_PORT_RANGE variable will default to 49152-49162, which is usually more than enough for most uses. Keep in mind that gluster requires 1 dedicated port per brick.
  • Volume mappings:
    • /etc/glusterfs (for config)
    • /var/lib/glusterd (for metadata)
    • /var/log/glusterfs (for logs)
    • /etc/hosts (for persistent hosts file (not to be confused with docker host!) so you don't have to refer to peers with ip - because a lot of the gluster guides out there seem to be allergic to ip addresses) - optional
    • A folder for the brick (to allow easy access to the gluster bricks e.g. storing gluster bricks on Unraid cache drive - which is the main reason I built this)
      • CRITICAL: Do NOT let anything make changes directly to the brick folder (both host and container!).
  • Based on Debian Buster base image mainly because Raspbian Buster is derived from the same. This allows easier development, testing and building on my end.

Bonus (experimental) feature:

  • Now let's say you have got your Unraid server in a swarm but magic doesn't work because Unraid can't mount the gluster volume. Now if only you have got a gluster client somewhere... :D
    • Map a folder the same folder in the container to Unraid e.g. /mnt/cache/swarm
      • Make sure to pick rw [+ shared].
      • In case it's not obvious, your swarm services should be mapping to the same path too (e.g. /mnt/cache/swarm/nginx).
    • Set MOUNT_PATH = the container folder (e.g. /mnt/cache/swarm) [NO TRAILING SLASH!]
    • Set GLUSTER_VOL = comma-separated list of gluster volume names (e.g. vol01,vol02,vol03) [NO SPACE!]
    • Start the docker and after the server is loaded, those volumes will also be mounted and visible from Unraid i.e. your services should now be able to access the same storage location (e.g. /mnt/cache/swarm/vol01,/mnt/cache/swarm/vol02,/mnt/cache/swarm/vol03).
      • Your services should now be able to freely jump around the nodes, including Unraid.

Unraid example

docker run -d \
    --name='Gluster-server' \
    --net='host' \
    --privileged=true \
    -e TZ="Europe/London" \
    -e HOST_OS="Unraid" \
    -e BRICK_PORT_RANGE="49152-49162" \
    -e MOUNT_PATH="/mnt/cache/swarm" \
    -e GLUSTER_VOL="vol01,vol02,vol03" \
    -v '/mnt/user/appdata/gluster-server/metadata/':'/var/lib/glusterd':'rw' \
    -v '/mnt/user/appdata/gluster-server/log/':'/var/log/glusterfs':'rw' \
    -v '/mnt/user/appdata/gluster-server/config/':'/etc/glusterfs':'rw' \
    -v '/mnt/user/appdata/gluster-server/hosts':'/etc/hosts':'rw' \
    -v '/mnt/user/appdata/gluster-server/data/':'/gluster':'rw' \
    -v '/mnt/cache/swarm/':'/mnt/cache/swarm':'rw,shared' \
    'testdasi/gluster-server:latest'

Notes

  • I code for fun and my personal uses; hence, these niche functionalties that nobody asks for. ;)
  • If you like my work, a donation to my burger fund is very much appreciated.

Donate.

Install Gluster-Server on Unraid in a few clicks.

Find Gluster-Server in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for Gluster-Server Review the template variables and paths Click Install

Download Statistics

18,294
Total Downloads
408
This Month
229
Avg / Month

Total Downloads Over Time

Loading chart...

Related apps

Details

Repository
testdasi/gluster-server:latest
Last Updated2025-07-31
First Seen2021-04-14

Runtime arguments

Network
host
Shell
bash
Privileged
true

Template configuration

MetadataPathrw

Container Path: /var/lib/glusterd

Target
/var/lib/glusterd
Default
/mnt/user/appdata/gluster-server/metadata
Value
/mnt/user/appdata/gluster-server/metadata
ConfigPathrw

Container Path: /etc/glusterfs

Target
/etc/glusterfs
Default
/mnt/user/appdata/gluster-server/config
Value
/mnt/user/appdata/gluster-server/config
LogPathrw

Container Path: /var/log/glusterfs

Target
/var/log/glusterfs
Default
/mnt/user/appdata/gluster-server/log
Value
/mnt/user/appdata/gluster-server/log
DataPathrw

Container Path: /gluster

Target
/gluster
Default
/mnt/user/appdata/gluster-server/data
Value
/mnt/user/appdata/gluster-server/data
Host file (remove if not required)Pathrw

Container Path: /etc/hosts

Target
/etc/hosts
Default
/mnt/user/appdata/gluster-server/hosts
Value
/mnt/user/appdata/gluster-server/hosts
BRICK_PORT_RANGEVariable

Container Variable: BRICK_PORT_RANGE

Default
49152-49162
Value
49152-49162