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:
committed by
Robin Gloster
parent
c2b578386e
commit
4bc9e8a785
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user