Merge pull request #153596 from illustris/elasticsearch

main
Sandro 2 years ago committed by GitHub
commit ff0dd3afe0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      nixos/modules/services/search/elasticsearch.nix

@ -143,6 +143,17 @@ in
example = lib.literalExpression "[ pkgs.elasticsearchPlugins.discovery-ec2 ]";
};
restartIfChanged = mkOption {
type = types.bool;
description = ''
Automatically restart the service on config change.
This can be set to false to defer restarts on a server or cluster.
Please consider the security implications of inadvertently running an older version,
and the possibility of unexpected behavior caused by inconsistent versions across a cluster when disabling this option.
'';
default = true;
};
};
###### implementation
@ -153,6 +164,7 @@ in
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
path = [ pkgs.inetutils ];
inherit (cfg) restartIfChanged;
environment = {
ES_HOME = cfg.dataDir;
ES_JAVA_OPTS = toString cfg.extraJavaOptions;
@ -163,6 +175,8 @@ in
User = "elasticsearch";
PermissionsStartOnly = true;
LimitNOFILE = "1024000";
Restart = "always";
TimeoutStartSec = "infinity";
};
preStart = ''
${optionalString (!config.boot.isContainer) ''

Loading…
Cancel
Save