git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #67684 from indiscipline/minio

nixos/minio: allow multiple data directories for erasure coding

commit4c87cb87a2db6b9eb43541c1cf83f2a2f725fa25 authortaku0 <taku0@users.noreply.github.com> dateTue 13 Apr 2021, 18:29 (6 years ago) parent74df3bb9ffc4ad
2 files changed+11−6
nixos/doc/manual/release-notes/rl-2105.xml+6 nixos/modules/services/web-servers/minio.nix+5−6
nixos/doc/manual/release-notes/rl-2105.xml+6
@@ -669,6 +669,12 @@ environment.systemPackages = [
669669 Environment variables can be set using <option>environment.variables</option>.
670670 </para>
671671 </listitem>
672+ <listitem>
673+ <para>
674+ <option>services.minio.dataDir</option> changed type to a list of paths, required for specifiyng multiple data directories for using with erasure coding.
675+ Currently, the service doesn't enforce nor checks the correct number of paths to correspond to minio requirements.
676+ </para>
677+ </listitem>
672678 </itemizedlist>
673679 </section>
674680
nixos/modules/services/web-servers/minio.nix+5−6
@@ -18,9 +18,9 @@ in
1818 };
1919
2020 dataDir = mkOption {
21− default = "/var/lib/minio/data";
22− type = types.path;
23− description = "The data directory, for storing the objects.";
21+ default = [ "/var/lib/minio/data" ];
22+ type = types.listOf types.path;
23+ description = "The list of data directories for storing the objects. Use one path for regular operation and the minimum of 4 endpoints for Erasure Code mode.";
2424 };
2525
2626 configDir = mkOption {
@@ -74,15 +74,14 @@ in
7474 config = mkIf cfg.enable {
7575 systemd.tmpfiles.rules = [
7676 "d '${cfg.configDir}' - minio minio - -"
77− "d '${cfg.dataDir}' - minio minio - -"
78− ];
77+ ] ++ (map (x: "d '" + x + "' - minio minio - - ") cfg.dataDir);
7978
8079 systemd.services.minio = {
8180 description = "Minio Object Storage";
8281 after = [ "network.target" ];
8382 wantedBy = [ "multi-user.target" ];
8483 serviceConfig = {
85− ExecStart = "${cfg.package}/bin/minio server --json --address ${cfg.listenAddress} --config-dir=${cfg.configDir} ${cfg.dataDir}";
84+ ExecStart = "${cfg.package}/bin/minio server --json --address ${cfg.listenAddress} --config-dir=${cfg.configDir} ${toString cfg.dataDir}";
8685 Type = "simple";
8786 User = "minio";
8887 Group = "minio";