Setting up the GlusterFS server

To set up the GlusterFS server, we need to configure several things:

  1. open ports for the clients to connect: we will actually disable the entire firewall for simplicity stakes, but we could be more precise in the ports we open

  2. Enable the systemd service for the GlusterFS server

  3. Define the export point

server = { pkgs, ... }: {
  # Disable the firewall
  networking.firewall.enable = false;

  # Enable the glusterfs server services
  services.glusterfs.enable = true;

  # Define a partition at /srv that will host the blocks
  fileSystems = {
    "/srv" = {
      device = "/dev/disk/by-partlabel/KDPL_TMP_disk0";
      fsType = "ext4";
    };
  };

  # we also add the htop package for light monitoring
  environment.systemPackages = with pkgs; [ htop ];
};

Note that the KDPL_TMP_disk0 label is only valid on Grid'5000.