From fdb111d7a5269b92be536c1ba29d81a145c51708 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 23 Jun 2017 20:56:05 +0100 Subject: [PATCH] Move zookeeper_hosts to zookeeper section To anticipate future use of zookeeper by more than just the scheduler, create a new 'zookeeper' section in zuul.conf similar to the 'gearman' section. The 'hosts' entry is the only setting there now, but others may be added later. Change-Id: Ib0bb2dfdc96fa0eb4aad2b4700de2f2004ea15f2 --- doc/source/admin/components.rst | 11 +++++++---- etc/zuul.conf-sample | 4 +++- zuul/cmd/scheduler.py | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/doc/source/admin/components.rst b/doc/source/admin/components.rst index 7e681b1683..b91e7e7eb2 100644 --- a/doc/source/admin/components.rst +++ b/doc/source/admin/components.rst @@ -51,6 +51,13 @@ Client connection information for gearman. **ssl_key** Optional: An openssl file containing the client private key in PEM format. +zookeeper +""""""""" + +**hosts** + A list of zookeeper hosts for Zuul to use when communicating with + Nodepool. ``hosts=zk1.example.com,zk2.example.com,zk3.example.com`` + zuul """" @@ -59,10 +66,6 @@ zuul starting jobs for a change. Used by zuul-scheduler only. ``status_url=https://zuul.example.com/status`` -**zookeeper_hosts** - A list of zookeeper hosts for Zuul to use when communicating with - Nodepool. ``zookeeper_hosts=zk1.example.com,zk2.example.com,zk3.example.com`` - Scheduler --------- diff --git a/etc/zuul.conf-sample b/etc/zuul.conf-sample index 9d74a3b213..48f23a5a7e 100644 --- a/etc/zuul.conf-sample +++ b/etc/zuul.conf-sample @@ -4,6 +4,9 @@ server=127.0.0.1 ;ssl_cert=/path/to/client.pem ;ssl_key=/path/to/client.key +[zookeeper] +hosts=127.0.0.1:2181 + [gearman_server] start=true ;ssl_ca=/path/to/ca.pem @@ -12,7 +15,6 @@ start=true [zuul] status_url=https://zuul.example.com/status -zookeeper_hosts=127.0.0.1:2181 [scheduler] tenant_config=/etc/zuul/main.yaml diff --git a/zuul/cmd/scheduler.py b/zuul/cmd/scheduler.py index ae77260716..b7b12fe312 100755 --- a/zuul/cmd/scheduler.py +++ b/zuul/cmd/scheduler.py @@ -150,8 +150,8 @@ class Scheduler(zuul.cmd.ZuulApp): nodepool = zuul.nodepool.Nodepool(self.sched) zookeeper = zuul.zk.ZooKeeper() - zookeeper_hosts = get_default(self.config, 'zuul', 'zookeeper_hosts', - '127.0.0.1:2181') + zookeeper_hosts = get_default(self.config, 'zookeeper', + 'hosts', '127.0.0.1:2181') zookeeper.connect(zookeeper_hosts)