feat(faunus-ater): new fileSystem configuration

This commit is contained in:
Malte Tammena 2024-02-12 09:58:49 +01:00
parent 822d5d4d10
commit acc44c2c5c
2 changed files with 96 additions and 34 deletions

View file

@ -35,40 +35,62 @@ in {
device = cryptRoot.encrypted.blkDev;
};
fileSystems."/" = {
fileSystems = {
"/" = {
device = "rpool/local/root";
fsType = "zfs";
options = ["zfsutil"];
inherit (cryptRoot) encrypted;
};
fileSystems."/boot" = {
"/boot" = {
device = "/dev/disk/by-uuid/9071-3F2A";
fsType = "vfat";
};
fileSystems."/nix" = {
"/nix" = {
device = "rpool/local/nix";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/persist" = {
"/persist" = {
device = "rpool/safe/persist";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/data/dirty" = {
"/data/dirty" = {
device = "zdirty";
fsType = "zfs";
options = ["zfsutil"];
};
fileSystems."/data/archive" = {
device = "zarchive";
fsType = "zfs";
options = ["zfsutil" "nofail"];
"/data/hdd/1" = {
device = "/dev/disk/by-uuid/7f651391-1098-49c1-a2f7-38e91ac43efa";
fsType = "ext4";
options = ["defaults" "nofail"];
};
"/data/hdd/2" = {
device = "/dev/disk/by-uuid/bb946f66-c3cb-4f5d-b79c-3754c5c8e1ea";
fsType = "ext4";
options = ["defaults" "nofail"];
};
"/data/hdd/3" = {
device = "/dev/disk/by-uuid/af52a67b-32c6-437c-8916-260caab81540";
fsType = "ext4";
options = ["defaults" "nofail"];
};
"/data/hdd/4" = {
device = "/dev/disk/by-uuid/09437c69-91d6-4afe-a475-fe7cdab62ddb";
fsType = "ext4";
options = ["defaults" "nofail"];
};
"/data/hdd/5" = {
device = "/dev/disk/by-uuid/8508e5d9-9065-4b5f-b50f-1386a5c9430a";
fsType = "ext4";
options = ["defaults" "nofail"];
};
};
# === Swap ===

View file

@ -11,15 +11,21 @@
};
s3.port = builtins.toString config.state.services.s3.port;
seaweedfsVolume = number: {
seaweedfsVolume = {
number,
dir,
disk,
}: let
port = 8081 + number;
in {
enable = true;
description = "SeaweedFS Volume ${builtins.toString number}";
after = ["network.target"];
wantedBy = ["multi-user.target"];
serviceConfig = {
Type = "simple";
ExecStart = "${weed} volume -dir=./data -mserver=${master.ip}:${master.port} -ip=${master.ip} -minFreeSpace=50G -max=0";
WorkingDirectory = "/data/dirty/seaweedfs";
ExecStart = "${weed} volume -dir=. -mserver=${master.ip}:${master.port} -ip=${master.ip} -port ${builtins.toString port} -dataCenter=home1 -rack=rack1 -minFreeSpace=50G -max=0 -disk=${disk}";
WorkingDirectory = dir;
User = "seaweed";
Group = "seaweed";
Restart = "always";
@ -41,6 +47,11 @@ in {
systemd.tmpfiles.rules = [
"d /data/dirty/seaweedfs 0770 seaweed seaweed -"
"d /data/hdd/1 0770 seaweed seaweed -"
"d /data/hdd/2 0770 seaweed seaweed -"
"d /data/hdd/3 0770 seaweed seaweed -"
"d /data/hdd/4 0770 seaweed seaweed -"
"d /data/hdd/5 0770 seaweed seaweed -"
"d /data/dirty/seaweedfs/data 0770 seaweed seaweed -"
"d /data/dirty/seaweedfs/filer 0770 seaweed seaweed -"
"L+ /data/dirty/seaweedfs/filer/filer.toml - - - - ${filerConfig}"
@ -63,8 +74,37 @@ in {
SyslogIdentifier = "seaweedfs-master";
};
};
# First volume
seaweedfs-volume-1 = seaweedfsVolume 1;
# volumes
seaweedfs-volume-dirty = seaweedfsVolume {
number = 1;
dir = "/data/dirty/seaweedfs/data";
disk = "ssd";
};
seaweedfs-volume-archive-1 = seaweedfsVolume {
number = 2;
dir = "/data/hdd/1";
disk = "hdd";
};
seaweedfs-volume-archive-2 = seaweedfsVolume {
number = 3;
dir = "/data/hdd/2";
disk = "hdd";
};
seaweedfs-volume-archive-3 = seaweedfsVolume {
number = 4;
dir = "/data/hdd/3";
disk = "hdd";
};
seaweedfs-volume-archive-4 = seaweedfsVolume {
number = 5;
dir = "/data/hdd/4";
disk = "hdd";
};
seaweedfs-volume-archive-5 = seaweedfsVolume {
number = 6;
dir = "/data/hdd/5";
disk = "hdd";
};
# Filer
seaweedfs-filer = {
enable = true;