Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/minio: allow multiple data directories for erasure coding #67684

Merged
merged 1 commit into from Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions nixos/doc/manual/release-notes/rl-2105.xml
Expand Up @@ -658,6 +658,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;
indiscipline marked this conversation as resolved.
Show resolved Hide resolved
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