From 0ae36b62980b43faf773c8759dd59bc86ee41dfb Mon Sep 17 00:00:00 2001 From: Victor Cabezas Date: Fri, 5 Mar 2021 12:54:39 +0100 Subject: [PATCH 1/2] Add quorumListenOnAllIPs configuration option --- manifests/init.pp | 1 + manifests/params.pp | 1 + templates/conf/zoo.cfg.erb | 3 +++ 3 files changed, 5 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 3fd3ff9..a553ddf 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -86,6 +86,7 @@ Boolean $use_sasl_auth = $zookeeper::params::use_sasl_auth, String $zoo_dir = $zookeeper::params::zoo_dir, String $zoo_main = $zookeeper::params::zoo_main, + Boolean $quorum_listen_on_all_ips = $zookeeper::params::quorum_listen_on_all_ips, # log4j properties String $environment_file = $zookeeper::params::environment_file, String $log4j_prop = $zookeeper::params::log4j_prop, diff --git a/manifests/params.pp b/manifests/params.pp index 594f5e5..2a8268c 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -126,6 +126,7 @@ $client_ip = undef # use e.g. $::ipaddress if you want to bind to single interface $client_port = 2181 $secure_client_port = undef + $quorum_listen_on_all_ips = false $datastore = '/var/lib/zookeeper' # datalogstore used to put transaction logs in separate location than snapshots $datalogstore = undef diff --git a/templates/conf/zoo.cfg.erb b/templates/conf/zoo.cfg.erb index 3b821d7..7f1c7bb 100644 --- a/templates/conf/zoo.cfg.erb +++ b/templates/conf/zoo.cfg.erb @@ -59,6 +59,9 @@ secureClientPort=<%= scope.lookupvar("zookeeper::secure_client_port") %> <%= "server.#{id}=#{host}:%s:%s%s" % [scope.lookupvar("zookeeper::election_port"), scope.lookupvar("zookeeper::leader_port"), observer_text ] %> <%- end -%> +# Bind election_port and leader_port to all interfaces (0.0.0.0) +quorumListenOnAllIPs=<%= scope.lookupvar("zookeeper::quorum_listen_on_all_ips") %> + # To avoid seeks ZooKeeper allocates space in the transaction log file in # blocks of preAllocSize kilobytes. The default block size is 64M. One reason # for changing the size of the blocks is to reduce the block size if snapshots From 312e277d44b213eeaaad3f50f4baa8b2bb8d7293 Mon Sep 17 00:00:00 2001 From: Victor Cabezas Date: Fri, 5 Mar 2021 13:34:32 +0100 Subject: [PATCH 2/2] Don't remove CLASSPATH option unless it's actually using systemd --- templates/conf/environment.erb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/conf/environment.erb b/templates/conf/environment.erb index 6a3a7ef..56913c8 100644 --- a/templates/conf/environment.erb +++ b/templates/conf/environment.erb @@ -1,7 +1,10 @@ NAME=zookeeper ZOOCFGDIR=<%= scope.lookupvar("zookeeper::cfg_dir") %> -<% if scope.lookupvar('zookeeper::install_method') != 'archive' and scope.lookupvar('zookeeper::service_provider') != 'systemd' -%> +<% if scope.lookupvar('zookeeper::install_method') != 'archive' and + (scope.lookupvar('zookeeper::service_provider') != 'systemd' or + (scope.lookupvar('zookeeper::service_provider') == 'systemd' and !scope.lookupvar('zookeeper::manage_service_file')) + )-%> # TODO this is really ugly # How to find out, which jars are needed? # seems, that log4j requires the log4j.properties file to be in the classpath