feat(faunus-ater): master config for seaweedfs

This commit is contained in:
Malte Tammena 2024-02-13 12:20:46 +01:00
parent fe2a8c9a1d
commit 535904dfe3

View file

@ -38,6 +38,23 @@
enabled = true
dir = "./filerdb2"
'';
masterConfig = pkgs.writeText "master.toml" ''
[master.maintenance]
# periodically run these scripts are the same as running them from 'weed shell'
scripts = """
lock
ec.encode -fullPercent=95 -quietFor=1h
ec.rebuild -force
ec.balance -force
volume.deleteEmpty -quietFor=24h -force
volume.balance -force
volume.fix.replication
s3.clean.uploads -timeAgo=24h
unlock
"""
sleep_minutes = 720 # sleep 12h between each script execution
'';
in {
users.users.seaweed = {
isSystemUser = true;
@ -45,6 +62,11 @@ in {
};
users.groups.seaweed = {};
# Helpful to have `weed shell` available
environment.systemPackages = [
pkgs.seaweedfs
];
systemd.tmpfiles.rules = [
"d /data/dirty/seaweedfs 0770 seaweed seaweed -"
"d /data/hdd/1 0770 seaweed seaweed -"
@ -55,6 +77,7 @@ in {
"d /data/dirty/seaweedfs/data 0770 seaweed seaweed -"
"d /data/dirty/seaweedfs/filer 0770 seaweed seaweed -"
"L+ /data/dirty/seaweedfs/filer/filer.toml - - - - ${filerConfig}"
"L+ /data/dirty/seaweedfs/master.toml - - - - ${masterConfig}"
];
systemd.services = {