Skip to content

Commit

Permalink
Merge pull request #67684 from indiscipline/minio
Browse files Browse the repository at this point in the history
nixos/minio: allow multiple data directories for erasure coding
  • Loading branch information
taku0 committed Apr 13, 2021
2 parents 74df3bb + 9ffc4ad commit 4c87cb8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 6 additions & 0 deletions nixos/doc/manual/release-notes/rl-2105.xml
Expand Up @@ -669,6 +669,12 @@ environment.systemPackages = [
Environment variables can be set using <option>environment.variables</option>.
</para>
</listitem>
<listitem>
<para>
<option>services.minio.dataDir</option> changed type to a list of paths, required for specifiyng multiple data directories for using with erasure coding.
Currently, the service doesn't enforce nor checks the correct number of paths to correspond to minio requirements.
</para>
</listitem>
</itemizedlist>
</section>

Expand Down
11 changes: 5 additions & 6 deletions nixos/modules/services/web-servers/minio.nix
Expand Up @@ -18,9 +18,9 @@ in
};

dataDir = mkOption {
default = "/var/lib/minio/data";
type = types.path;
description = "The data directory, for storing the objects.";
default = [ "/var/lib/minio/data" ];
type = types.listOf types.path;
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.";
};

configDir = mkOption {
Expand Down Expand Up @@ -74,15 +74,14 @@ in
config = mkIf cfg.enable {
systemd.tmpfiles.rules = [
"d '${cfg.configDir}' - minio minio - -"
"d '${cfg.dataDir}' - minio minio - -"
];
] ++ (map (x: "d '" + x + "' - minio minio - - ") cfg.dataDir);

systemd.services.minio = {
description = "Minio Object Storage";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/minio server --json --address ${cfg.listenAddress} --config-dir=${cfg.configDir} ${cfg.dataDir}";
ExecStart = "${cfg.package}/bin/minio server --json --address ${cfg.listenAddress} --config-dir=${cfg.configDir} ${toString cfg.dataDir}";
Type = "simple";
User = "minio";
Group = "minio";
Expand Down

0 comments on commit 4c87cb8

Please sign in to comment.