elasticsearch2: init at 2.2.0

changes by @globin:
 * updated 2.1.0 to 2.2.0
 * moved to a new derivation

closes #11446

Signed-off-by: Robin Gloster <mail@glob.in>
This commit is contained in:
Markus Wotringer
2016-02-13 15:03:09 +00:00
committed by Robin Gloster
parent c2b578386e
commit 4bc9e8a785
4 changed files with 82 additions and 4 deletions
@@ -9,6 +9,8 @@ let
network.host: ${cfg.listenAddress}
network.port: ${toString cfg.port}
network.tcp.port: ${toString cfg.tcp_port}
# TODO: find a way to enable security manager
security.manager.enabled: false
cluster.name: ${cfg.cluster_name}
${cfg.extraConf}
'';
@@ -39,8 +41,8 @@ in {
package = mkOption {
description = "Elasticsearch package to use.";
default = pkgs.elasticsearch;
defaultText = "pkgs.elasticsearch";
default = pkgs.elasticsearch2;
defaultText = "pkgs.elasticsearch2";
type = types.package;
};
@@ -129,7 +131,9 @@ in {
wantedBy = [ "multi-user.target" ];
after = [ "network-interfaces.target" ];
path = [ pkgs.inetutils ];
environment = { ES_HOME = cfg.dataDir; };
environment = {
ES_HOME = cfg.dataDir;
};
serviceConfig = {
ExecStart = "${cfg.package}/bin/elasticsearch -Des.path.conf=${configDir} ${toString cfg.extraCmdLineOptions}";
User = "elasticsearch";
@@ -137,10 +141,11 @@ in {
};
preStart = ''
mkdir -m 0700 -p ${cfg.dataDir}
if [ "$(id -u)" = 0 ]; then chown -R elasticsearch ${cfg.dataDir}; fi
# Install plugins
ln -sfT ${esPlugins}/plugins ${cfg.dataDir}/plugins
ln -sfT ${cfg.package}/lib ${cfg.dataDir}/lib
if [ "$(id -u)" = 0 ]; then chown -R elasticsearch ${cfg.dataDir}; fi
'';
postStart = mkBefore ''
until ${pkgs.curl}/bin/curl -s -o /dev/null ${cfg.listenAddress}:${toString cfg.port}; do