mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-08 05:03:40 +00:00
Merge pull request #11048 from offlinehacker/pkgs/influxdb/update_0.9.4
influxdb: 0.8.3 -> 0.9.4, fix module
This commit is contained in:
commit
be067811ff
@ -5,43 +5,103 @@ with lib;
|
|||||||
let
|
let
|
||||||
cfg = config.services.influxdb;
|
cfg = config.services.influxdb;
|
||||||
|
|
||||||
influxdbConfig = pkgs.writeText "config.toml" ''
|
configOptions = recursiveUpdate {
|
||||||
bind-address = "${cfg.bindAddress}"
|
meta = {
|
||||||
|
bind-address = ":8088";
|
||||||
|
commit-timeout = "50ms";
|
||||||
|
dir = "${cfg.dataDir}/meta";
|
||||||
|
election-timeout = "1s";
|
||||||
|
heartbeat-timeout = "1s";
|
||||||
|
hostname = "localhost";
|
||||||
|
leader-lease-timeout = "500ms";
|
||||||
|
retention-autocreate = true;
|
||||||
|
};
|
||||||
|
|
||||||
[logging]
|
data = {
|
||||||
level = "info"
|
dir = "${cfg.dataDir}/data";
|
||||||
file = "stdout"
|
wal-dir = "${cfg.dataDir}/wal";
|
||||||
|
max-wal-size = 104857600;
|
||||||
|
wal-enable-logging = true;
|
||||||
|
wal-flush-interval = "10m";
|
||||||
|
wal-partition-flush-delay = "2s";
|
||||||
|
};
|
||||||
|
|
||||||
[admin]
|
cluster = {
|
||||||
port = ${toString cfg.adminPort}
|
shard-writer-timeout = "5s";
|
||||||
assets = "${pkgs.influxdb}/share/influxdb/admin"
|
write-timeout = "5s";
|
||||||
|
};
|
||||||
|
|
||||||
[api]
|
retention = {
|
||||||
port = ${toString cfg.apiPort}
|
enabled = true;
|
||||||
${cfg.apiExtraConfig}
|
check-interval = "30m";
|
||||||
|
};
|
||||||
|
|
||||||
[input_plugins]
|
http = {
|
||||||
${cfg.inputPluginsConfig}
|
enabled = true;
|
||||||
|
auth-enabled = false;
|
||||||
|
bind-address = ":8086";
|
||||||
|
https-enabled = false;
|
||||||
|
log-enabled = true;
|
||||||
|
pprof-enabled = false;
|
||||||
|
write-tracing = false;
|
||||||
|
};
|
||||||
|
|
||||||
[raft]
|
monitor = {
|
||||||
dir = "${cfg.dataDir}/raft"
|
store-enabled = false;
|
||||||
${cfg.raftConfig}
|
store-database = "_internal";
|
||||||
|
store-interval = "10s";
|
||||||
|
};
|
||||||
|
|
||||||
[storage]
|
admin = {
|
||||||
dir = "${cfg.dataDir}/db"
|
enabled = true;
|
||||||
${cfg.storageConfig}
|
bind-address = ":8083";
|
||||||
|
https-enabled = false;
|
||||||
|
};
|
||||||
|
|
||||||
[cluster]
|
graphite = [{
|
||||||
${cfg.clusterConfig}
|
enabled = false;
|
||||||
|
}];
|
||||||
|
|
||||||
[sharding]
|
udp = [{
|
||||||
${cfg.shardingConfig}
|
enabled = false;
|
||||||
|
}];
|
||||||
|
|
||||||
[wal]
|
collectd = {
|
||||||
dir = "${cfg.dataDir}/wal"
|
enabled = false;
|
||||||
${cfg.walConfig}
|
typesdb = "${pkgs.collectd}/share/collectd/types.db";
|
||||||
|
database = "collectd_db";
|
||||||
|
port = 25826;
|
||||||
|
};
|
||||||
|
|
||||||
${cfg.extraConfig}
|
opentsdb = {
|
||||||
|
enabled = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
continuous_queries = {
|
||||||
|
enabled = true;
|
||||||
|
log-enabled = true;
|
||||||
|
recompute-previous-n = 2;
|
||||||
|
recompute-no-older-than = "10m";
|
||||||
|
compute-runs-per-interval = 10;
|
||||||
|
compute-no-more-than = "2m";
|
||||||
|
};
|
||||||
|
|
||||||
|
hinted-handoff = {
|
||||||
|
enabled = true;
|
||||||
|
dir = "${cfg.dataDir}/hh";
|
||||||
|
max-size = 1073741824;
|
||||||
|
max-age = "168h";
|
||||||
|
retry-rate-limit = 0;
|
||||||
|
retry-interval = "1s";
|
||||||
|
};
|
||||||
|
} cfg.extraConfig;
|
||||||
|
|
||||||
|
configFile = pkgs.runCommand "config.toml" {
|
||||||
|
buildInputs = [ pkgs.remarshal ];
|
||||||
|
} ''
|
||||||
|
remarshal -if json -of toml \
|
||||||
|
< ${pkgs.writeText "config.json" (builtins.toJSON configOptions)} \
|
||||||
|
> $out
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@ -82,124 +142,10 @@ in
|
|||||||
type = types.path;
|
type = types.path;
|
||||||
};
|
};
|
||||||
|
|
||||||
bindAddress = mkOption {
|
|
||||||
default = "127.0.0.1";
|
|
||||||
description = "Address where influxdb listens";
|
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
|
|
||||||
adminPort = mkOption {
|
|
||||||
default = 8083;
|
|
||||||
description = "The port where influxdb admin listens";
|
|
||||||
type = types.int;
|
|
||||||
};
|
|
||||||
|
|
||||||
apiPort = mkOption {
|
|
||||||
default = 8086;
|
|
||||||
description = "The port where influxdb api listens";
|
|
||||||
type = types.int;
|
|
||||||
};
|
|
||||||
|
|
||||||
apiExtraConfig = mkOption {
|
|
||||||
default = ''
|
|
||||||
read-timeout = "5s"
|
|
||||||
'';
|
|
||||||
description = "Extra influxdb api configuration";
|
|
||||||
example = ''
|
|
||||||
ssl-port = 8084
|
|
||||||
ssl-cert = /path/to/cert.pem
|
|
||||||
read-timeout = "5s"
|
|
||||||
'';
|
|
||||||
type = types.lines;
|
|
||||||
};
|
|
||||||
|
|
||||||
inputPluginsConfig = mkOption {
|
|
||||||
default = "";
|
|
||||||
description = "Configuration of influxdb extra plugins";
|
|
||||||
example = ''
|
|
||||||
[input_plugins.graphite]
|
|
||||||
enabled = true
|
|
||||||
port = 2003
|
|
||||||
database = "graphite"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
raftConfig = mkOption {
|
|
||||||
default = ''
|
|
||||||
port = 8090
|
|
||||||
'';
|
|
||||||
description = "Influxdb raft configuration";
|
|
||||||
type = types.lines;
|
|
||||||
};
|
|
||||||
|
|
||||||
storageConfig = mkOption {
|
|
||||||
default = ''
|
|
||||||
write-buffer-size = 10000
|
|
||||||
'';
|
|
||||||
description = "Influxdb raft configuration";
|
|
||||||
type = types.lines;
|
|
||||||
};
|
|
||||||
|
|
||||||
clusterConfig = mkOption {
|
|
||||||
default = ''
|
|
||||||
protobuf_port = 8099
|
|
||||||
protobuf_timeout = "2s"
|
|
||||||
protobuf_heartbeat = "200ms"
|
|
||||||
protobuf_min_backoff = "1s"
|
|
||||||
protobuf_max_backoff = "10s"
|
|
||||||
|
|
||||||
write-buffer-size = 10000
|
|
||||||
max-response-buffer-size = 100
|
|
||||||
|
|
||||||
concurrent-shard-query-limit = 10
|
|
||||||
'';
|
|
||||||
description = "Influxdb cluster configuration";
|
|
||||||
type = types.lines;
|
|
||||||
};
|
|
||||||
|
|
||||||
leveldbConfig = mkOption {
|
|
||||||
default = ''
|
|
||||||
max-open-files = 40
|
|
||||||
lru-cache-size = "200m"
|
|
||||||
max-open-shards = 0
|
|
||||||
point-batch-size = 100
|
|
||||||
write-batch-size = 5000000
|
|
||||||
'';
|
|
||||||
description = "Influxdb leveldb configuration";
|
|
||||||
type = types.lines;
|
|
||||||
};
|
|
||||||
|
|
||||||
shardingConfig = mkOption {
|
|
||||||
default = ''
|
|
||||||
replication-factor = 1
|
|
||||||
|
|
||||||
[sharding.short-term]
|
|
||||||
duration = "7d"
|
|
||||||
split = 1
|
|
||||||
|
|
||||||
[sharding.long-term]
|
|
||||||
duration = "30d"
|
|
||||||
split = 1
|
|
||||||
'';
|
|
||||||
description = "Influxdb sharding configuration";
|
|
||||||
type = types.lines;
|
|
||||||
};
|
|
||||||
|
|
||||||
walConfig = mkOption {
|
|
||||||
default = ''
|
|
||||||
flush-after = 1000
|
|
||||||
bookmark-after = 1000
|
|
||||||
index-after = 1000
|
|
||||||
requests-per-logfile = 10000
|
|
||||||
'';
|
|
||||||
description = "Influxdb write-ahead log configuration";
|
|
||||||
type = types.lines;
|
|
||||||
};
|
|
||||||
|
|
||||||
extraConfig = mkOption {
|
extraConfig = mkOption {
|
||||||
default = "";
|
default = {};
|
||||||
description = "Extra configuration options for influxdb";
|
description = "Extra configuration options for influxdb";
|
||||||
type = types.string;
|
type = types.attrs;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -215,7 +161,7 @@ in
|
|||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
after = [ "network-interfaces.target" ];
|
after = [ "network-interfaces.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = ''${cfg.package}/bin/influxdb -config "${influxdbConfig}"'';
|
ExecStart = ''${cfg.package}/bin/influxd -config "${configFile}"'';
|
||||||
User = "${cfg.user}";
|
User = "${cfg.user}";
|
||||||
Group = "${cfg.group}";
|
Group = "${cfg.group}";
|
||||||
PermissionsStartOnly = true;
|
PermissionsStartOnly = true;
|
||||||
@ -224,11 +170,6 @@ in
|
|||||||
mkdir -m 0770 -p ${cfg.dataDir}
|
mkdir -m 0770 -p ${cfg.dataDir}
|
||||||
if [ "$(id -u)" = 0 ]; then chown -R ${cfg.user}:${cfg.group} ${cfg.dataDir}; fi
|
if [ "$(id -u)" = 0 ]; then chown -R ${cfg.user}:${cfg.group} ${cfg.dataDir}; fi
|
||||||
'';
|
'';
|
||||||
postStart = mkBefore ''
|
|
||||||
until ${pkgs.curl}/bin/curl -s -o /dev/null 'http://${cfg.bindAddress}:${toString cfg.apiPort}/'; do
|
|
||||||
sleep 1;
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
users.extraUsers = optional (cfg.user == "influxdb") {
|
users.extraUsers = optional (cfg.user == "influxdb") {
|
||||||
|
24
pkgs/development/tools/remarshal/default.nix
Normal file
24
pkgs/development/tools/remarshal/default.nix
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{ lib, goPackages, fetchFromGitHub }:
|
||||||
|
|
||||||
|
goPackages.buildGoPackage rec {
|
||||||
|
name = "remarshal-${rev}";
|
||||||
|
rev = "0.3.0";
|
||||||
|
goPackagePath = "github.com/dbohdan/remarshal";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
rev = "v${rev}";
|
||||||
|
owner = "dbohdan";
|
||||||
|
repo = "remarshal";
|
||||||
|
sha256 = "0lhsqca3lq3xvdwsmrngv4p6b7k2lkbfnxnk5qj6jdd5y7f4b496";
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = with goPackages; [ toml yaml-v2 ];
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Convert between TOML, YAML and JSON";
|
||||||
|
license = licenses.mit;
|
||||||
|
homepage = https://github.com/dbohdan/remarshal;
|
||||||
|
maintainers = with maintainers; [ offline ];
|
||||||
|
platforms = with platforms; linux;
|
||||||
|
};
|
||||||
|
}
|
@ -1,37 +1,29 @@
|
|||||||
{ stdenv, fetchurl, makeWrapper, zlib, bzip2 }:
|
{ lib, goPackages, fetchFromGitHub }:
|
||||||
|
|
||||||
assert stdenv.isLinux;
|
goPackages.buildGoPackage rec {
|
||||||
|
name = "influxdb-${rev}";
|
||||||
|
rev = "v0.9.4";
|
||||||
|
goPackagePath = "github.com/influxdb/influxdb";
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
src = fetchFromGitHub {
|
||||||
name = "influxdb-${version}";
|
inherit rev;
|
||||||
version = "0.8.3";
|
owner = "influxdb";
|
||||||
arch = if stdenv.system == "x86_64-linux" then "amd64" else "386";
|
repo = "influxdb";
|
||||||
|
sha256 = "0yarymppnlpf2xab57i8jx595v47s5mdwnf13719mc1fv3q84yqn";
|
||||||
src = fetchurl {
|
|
||||||
url = "http://s3.amazonaws.com/influxdb/${name}.${arch}.tar.gz";
|
|
||||||
sha256 = if arch == "amd64" then
|
|
||||||
"e625902d403434c799f9d9ffc2592a3880f82d435423fde7174e5e4fe0f41148" else
|
|
||||||
"5abe9f432553e66c8aff86c4311eba16b874678d04b52bfe9e2019c01059ec78";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ makeWrapper ];
|
excludedPackages = "test";
|
||||||
|
|
||||||
installPhase = ''
|
propagatedBuildInputs = with goPackages; [
|
||||||
install -D influxdb $out/bin/influxdb
|
raft raft-boltdb snappy crypto gogo.protobuf pool pat toml
|
||||||
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/bin/influxdb
|
gollectd statik liner
|
||||||
wrapProgram "$out/bin/influxdb" \
|
];
|
||||||
--prefix LD_LIBRARY_PATH : "${stdenv.cc.cc}/lib:${stdenv.cc.cc}/lib64:${zlib}/lib:${bzip2}/lib"
|
|
||||||
|
|
||||||
mkdir -p $out/share/influxdb
|
meta = with lib; {
|
||||||
cp -R admin scripts config.toml $out/share/influxdb
|
description = "An open-source distributed time series database";
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
|
||||||
description = "Scalable datastore for metrics, events, and real-time analytics";
|
|
||||||
homepage = http://influxdb.com/;
|
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
|
homepage = https://influxdb.com/;
|
||||||
maintainers = [ maintainers.offline ];
|
maintainers = with maintainers; [ offline ];
|
||||||
platforms = ["i686-linux" "x86_64-linux"];
|
platforms = with platforms; linux;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -2780,6 +2780,8 @@ let
|
|||||||
|
|
||||||
pytrainer = callPackage ../applications/misc/pytrainer { };
|
pytrainer = callPackage ../applications/misc/pytrainer { };
|
||||||
|
|
||||||
|
remarshal = (callPackage ../development/tools/remarshal { }).bin // { outputs = [ "bin" ]; };
|
||||||
|
|
||||||
openmpi = callPackage ../development/libraries/openmpi { };
|
openmpi = callPackage ../development/libraries/openmpi { };
|
||||||
|
|
||||||
openmodelica = callPackage ../applications/science/misc/openmodelica { };
|
openmodelica = callPackage ../applications/science/misc/openmodelica { };
|
||||||
@ -9304,9 +9306,7 @@ let
|
|||||||
riak = callPackage ../servers/nosql/riak/1.3.1.nix { };
|
riak = callPackage ../servers/nosql/riak/1.3.1.nix { };
|
||||||
riak2 = callPackage ../servers/nosql/riak/2.1.1.nix { };
|
riak2 = callPackage ../servers/nosql/riak/2.1.1.nix { };
|
||||||
|
|
||||||
influxdb = callPackage ../servers/nosql/influxdb { };
|
influxdb = (callPackage ../servers/nosql/influxdb { }).bin // { outputs = [ "bin" ]; };
|
||||||
|
|
||||||
influxdb-backup = goPackages.influxdb-backup.bin // { outputs = [ "bin" ]; };
|
|
||||||
|
|
||||||
hyperdex = callPackage ../servers/nosql/hyperdex { };
|
hyperdex = callPackage ../servers/nosql/hyperdex { };
|
||||||
|
|
||||||
@ -9391,7 +9391,7 @@ let
|
|||||||
|
|
||||||
pyMAILt = builderDefsPackage (callPackage ../servers/xmpp/pyMAILt) {};
|
pyMAILt = builderDefsPackage (callPackage ../servers/xmpp/pyMAILt) {};
|
||||||
|
|
||||||
qpid-cpp = callPackage ../servers/amqp/qpid-cpp {
|
qpid-cpp = callPackage ../servers/amqp/qpid-cpp {
|
||||||
boost = boost155;
|
boost = boost155;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1622,15 +1622,6 @@ let
|
|||||||
goPackageAliases = [ "github.com/go-inf/inf" ];
|
goPackageAliases = [ "github.com/go-inf/inf" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
influxdb = buildFromGitHub {
|
|
||||||
rev = "v0.9.3";
|
|
||||||
owner = "influxdb";
|
|
||||||
repo = "influxdb";
|
|
||||||
sha256 = "0hsvm8ls1g12j1d5ap396vqfpvd0g72hymhczdqg6z96h3zi90bx";
|
|
||||||
propagatedBuildInputs = [ raft raft-boltdb snappy crypto gogo.protobuf pool pat toml gollectd statik liner ];
|
|
||||||
excludedPackages = "test";
|
|
||||||
};
|
|
||||||
|
|
||||||
influxdb8-client = buildFromGitHub{
|
influxdb8-client = buildFromGitHub{
|
||||||
rev = "v0.8.8";
|
rev = "v0.8.8";
|
||||||
owner = "influxdb";
|
owner = "influxdb";
|
||||||
@ -1639,15 +1630,6 @@ let
|
|||||||
subPackages = [ "client" ];
|
subPackages = [ "client" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
influxdb-backup = buildFromGitHub {
|
|
||||||
rev = "4556edbffa914a8c17fa1fa1564962a33c6c7596";
|
|
||||||
date = "2014-07-28";
|
|
||||||
owner = "eckardt";
|
|
||||||
repo = "influxdb-backup";
|
|
||||||
sha256 = "2928063e6dfe4be7b69c8e72e4d6a5fc557f0c75e9625fadf607d59b8e80e34b";
|
|
||||||
buildInputs = [ eckardt.influxdb-go ];
|
|
||||||
};
|
|
||||||
|
|
||||||
eckardt.influxdb-go = buildGoPackage rec {
|
eckardt.influxdb-go = buildGoPackage rec {
|
||||||
rev = "8b71952efc257237e077c5d0672e936713bad38f";
|
rev = "8b71952efc257237e077c5d0672e936713bad38f";
|
||||||
name = "influxdb-go-${stdenv.lib.strings.substring 0 7 rev}";
|
name = "influxdb-go-${stdenv.lib.strings.substring 0 7 rev}";
|
||||||
|
Loading…
Reference in New Issue
Block a user