From 746b82bd4a6226f40b89d97856576fcaa117cb5c Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Sun, 7 Apr 2019 05:02:51 +0200 Subject: nixos/cassandra: Allow setting of seed addresses Allow for more intuitive specifying of seed node addresses with Nix syntax. --- nixos/modules/services/databases/cassandra.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/services/databases/cassandra.nix b/nixos/modules/services/databases/cassandra.nix index af0c29405c8f..ee6c092f0a45 100644 --- a/nixos/modules/services/databases/cassandra.nix +++ b/nixos/modules/services/databases/cassandra.nix @@ -13,7 +13,7 @@ let endpoint_snitch = "SimpleSnitch"; seed_provider = [{ class_name = "org.apache.cassandra.locator.SimpleSeedProvider"; - parameters = [ { seeds = "127.0.0.1"; } ]; + parameters = [ { seeds = concatStringsSep "," cfg.seedAddresses; } ]; }]; data_file_directories = [ "${cfg.homeDir}/data" ]; commitlog_directory = "${cfg.homeDir}/commitlog"; @@ -163,6 +163,16 @@ in { XML logback configuration for cassandra ''; }; + seedAddresses = mkOption { + type = types.listOf types.str; + default = [ "127.0.0.1" ]; + description = '' + The addresses of hosts designated as contact points in the cluster. A + joining node contacts one of the nodes in the seeds list to learn the + topology of the ring. + Set to 127.0.0.1 for a single node cluster. + ''; + }; allowClients = mkOption { type = types.bool; default = true; -- cgit v1.2.3