2018-05-21 02:09:31 +01:00
|
|
|
{ config, lib, pkgs, ...}:
|
2018-07-20 18:56:59 +01:00
|
|
|
|
2018-05-21 02:09:31 +01:00
|
|
|
with lib;
|
|
|
|
{
|
|
|
|
imports = [ ./yarn.nix ./hdfs.nix ];
|
|
|
|
|
|
|
|
options.services.hadoop = {
|
|
|
|
coreSite = mkOption {
|
|
|
|
default = {};
|
2021-01-29 12:01:42 +00:00
|
|
|
type = types.attrsOf types.anything;
|
2020-04-02 06:39:04 +01:00
|
|
|
example = literalExample ''
|
|
|
|
{
|
|
|
|
"fs.defaultFS" = "hdfs://localhost";
|
|
|
|
}
|
|
|
|
'';
|
2018-05-21 02:09:31 +01:00
|
|
|
description = "Hadoop core-site.xml definition";
|
|
|
|
};
|
|
|
|
|
|
|
|
hdfsSite = mkOption {
|
|
|
|
default = {};
|
2021-01-29 12:01:42 +00:00
|
|
|
type = types.attrsOf types.anything;
|
2020-04-02 06:39:04 +01:00
|
|
|
example = literalExample ''
|
|
|
|
{
|
|
|
|
"dfs.nameservices" = "namenode1";
|
|
|
|
}
|
|
|
|
'';
|
2018-05-21 02:09:31 +01:00
|
|
|
description = "Hadoop hdfs-site.xml definition";
|
|
|
|
};
|
|
|
|
|
|
|
|
mapredSite = mkOption {
|
|
|
|
default = {};
|
2021-01-29 12:01:42 +00:00
|
|
|
type = types.attrsOf types.anything;
|
2020-04-02 06:39:04 +01:00
|
|
|
example = literalExample ''
|
|
|
|
{
|
|
|
|
"mapreduce.map.cpu.vcores" = "1";
|
|
|
|
}
|
|
|
|
'';
|
2018-05-21 02:09:31 +01:00
|
|
|
description = "Hadoop mapred-site.xml definition";
|
|
|
|
};
|
|
|
|
|
|
|
|
yarnSite = mkOption {
|
|
|
|
default = {};
|
2021-01-29 12:01:42 +00:00
|
|
|
type = types.attrsOf types.anything;
|
2020-04-02 06:39:04 +01:00
|
|
|
example = literalExample ''
|
|
|
|
{
|
|
|
|
"yarn.resourcemanager.ha.id" = "resourcemanager1";
|
|
|
|
}
|
|
|
|
'';
|
2018-05-21 02:09:31 +01:00
|
|
|
description = "Hadoop yarn-site.xml definition";
|
|
|
|
};
|
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.hadoop;
|
|
|
|
defaultText = "pkgs.hadoop";
|
|
|
|
example = literalExample "pkgs.hadoop";
|
2021-01-24 09:19:10 +00:00
|
|
|
description = "";
|
2018-05-21 02:09:31 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
config = mkMerge [
|
2018-07-02 16:57:31 +01:00
|
|
|
(mkIf (builtins.hasAttr "yarn" config.users.users ||
|
|
|
|
builtins.hasAttr "hdfs" config.users.users) {
|
|
|
|
users.groups.hadoop = {
|
2018-05-21 02:09:31 +01:00
|
|
|
gid = config.ids.gids.hadoop;
|
|
|
|
};
|
|
|
|
})
|
|
|
|
|
|
|
|
];
|
|
|
|
}
|