From fbe16ec430d2de005896a9471a1c43b6262f90ee Mon Sep 17 00:00:00 2001 From: rishabh singh Date: Mon, 12 Dec 2022 11:33:18 +0530 Subject: [PATCH 1/4] support zk in service list --- examples/bin/start-druid-main.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/bin/start-druid-main.py b/examples/bin/start-druid-main.py index d1f4e6114918..60da253e526d 100644 --- a/examples/bin/start-druid-main.py +++ b/examples/bin/start-druid-main.py @@ -50,6 +50,7 @@ MIDDLE_MANAGER = "middleManager" TASKS = "tasks" INDEXER = "indexer" +ZK = "zk" DEFAULT_SERVICES = [ BROKER, @@ -65,7 +66,8 @@ COORDINATOR, HISTORICAL, MIDDLE_MANAGER, - INDEXER + INDEXER, + ZK ] SERVICE_MEMORY_RATIO = { @@ -221,16 +223,21 @@ def parse_arguments(args): for service in services: if service not in SUPPORTED_SERVICES: - raise ValueError('Invalid service name {0}, should be one of {1}'.format(service, DEFAULT_SERVICES)) + raise ValueError('Invalid service name {0}, should be one of {1}'.format(service, SUPPORTED_SERVICES)) if service in service_list: raise ValueError('{0} is specified multiple times'.format(service)) + if service == ZK: + zk = True + continue + service_list.append(service) if INDEXER in services and MIDDLE_MANAGER in services: raise ValueError('one of indexer and middleManager can run') + if len(service_list) == 0: # start all services service_list = DEFAULT_SERVICES From ba56084770d44b79c3d61ecf2c2c7fd65cd7a039 Mon Sep 17 00:00:00 2001 From: rishabh singh Date: Mon, 12 Dec 2022 12:46:38 +0530 Subject: [PATCH 2/4] remove zk arg --- examples/bin/start-druid-main.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/examples/bin/start-druid-main.py b/examples/bin/start-druid-main.py index 60da253e526d..ae09510c71d1 100644 --- a/examples/bin/start-druid-main.py +++ b/examples/bin/start-druid-main.py @@ -117,6 +117,8 @@ def configure_parser(): sample usage: start-druid Start up all the services (including zk). + services config is read from conf/druid/auto. + zk config is always read from conf/zk. start-druid -m=100g Start up all the services (including zk) using a total memory of 100GB. @@ -135,10 +137,10 @@ def configure_parser(): from the given root directory. Calculates memory requirements for each service, if required, using upto 80% of the total system memory. start-druid -m=100g \\ - -s=broker,router \\ + -s=broker,router,zk \\ -c=conf/druid/single-server/custom \\ - --zk Starts broker, router and zookeeper. + broker and router config is read from given root directory. zookeeper config is read from conf/zk. """ ) @@ -148,25 +150,22 @@ def configure_parser(): 'in the given conf directory. e.g. 500m, 4g, 6g\n') parser.add_argument('--services', '-s', type=str, required=False, help='List of services to be started, subset of \n' - '{broker, router, middleManager, historical, coordinator-overlord, indexer}. \n' + '{broker, router, middleManager, historical, coordinator-overlord, indexer, zk}. \n' 'If the argument is not given, broker, router, middleManager, historical, coordinator-overlord \n' - 'and zookeeper is started. e.g. -s=broker,historical') + 'and zk is started. e.g. -s=broker,historical') parser.add_argument('--config', '-c', type=str, required=False, help='Relative path to the directory containing common and service \n' 'specific properties to be overridden. \n' 'This directory must contain \'_common\' directory with \n' '\'common.jvm.config\' & \'common.runtime.properties\' files. \n' 'If this argument is not given, config from \n' - 'conf/druid/auto directory is used.\n') + 'conf/druid/auto directory is used.\n' + 'Note. zk config cannot be overriden.\n') parser.add_argument('--compute', action='store_true', help='Does not start Druid, only displays the memory allocated \n' 'to each service if started with the given total memory.\n') - parser.add_argument('--zk', '-zk', action='store_true', - help='Specification to run zookeeper, \n' - 'zk config is picked up from conf/zk.') parser.add_argument('--verbose', action='store_true', help='Log details') - parser.set_defaults(zk=False) parser.set_defaults(compute=False) parser.set_defaults(verbose=False) @@ -210,8 +209,6 @@ def parse_arguments(args): if args.compute: compute = True - if args.zk: - zk = True if args.config is not None: config = resolve_path(os.path.join(os.getcwd(), args.config)) if is_dir(config) is False: From 207d62472e582bbb3569c440d8084bcf5d371612 Mon Sep 17 00:00:00 2001 From: rishabh singh Date: Mon, 12 Dec 2022 15:11:54 +0530 Subject: [PATCH 3/4] use full name: zk -> zookeeper --- examples/bin/start-druid-main.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/bin/start-druid-main.py b/examples/bin/start-druid-main.py index ae09510c71d1..59fdc6ef5aa1 100644 --- a/examples/bin/start-druid-main.py +++ b/examples/bin/start-druid-main.py @@ -50,7 +50,7 @@ MIDDLE_MANAGER = "middleManager" TASKS = "tasks" INDEXER = "indexer" -ZK = "zk" +ZK = "zookeeper" DEFAULT_SERVICES = [ BROKER, @@ -137,11 +137,11 @@ def configure_parser(): from the given root directory. Calculates memory requirements for each service, if required, using upto 80% of the total system memory. start-druid -m=100g \\ - -s=broker,router,zk \\ + -s=broker,router,zookeeper \\ -c=conf/druid/single-server/custom \\ Starts broker, router and zookeeper. - broker and router config is read from given root directory. - zookeeper config is read from conf/zk. + Configs for broker and router are read from the specified root directory. + Config for zookeeper is read from conf/zk. """ ) parser.add_argument('--memory', '-m', type=str, required=False, @@ -150,9 +150,9 @@ def configure_parser(): 'in the given conf directory. e.g. 500m, 4g, 6g\n') parser.add_argument('--services', '-s', type=str, required=False, help='List of services to be started, subset of \n' - '{broker, router, middleManager, historical, coordinator-overlord, indexer, zk}. \n' + '{broker, router, middleManager, historical, coordinator-overlord, indexer, zookeeper}. \n' 'If the argument is not given, broker, router, middleManager, historical, coordinator-overlord \n' - 'and zk is started. e.g. -s=broker,historical') + 'and zookeeper is started. e.g. -s=broker,historical') parser.add_argument('--config', '-c', type=str, required=False, help='Relative path to the directory containing common and service \n' 'specific properties to be overridden. \n' From 136bf9ffa5da88773d76a7fe2a695bbb050c755f Mon Sep 17 00:00:00 2001 From: rishabh singh Date: Mon, 12 Dec 2022 15:17:22 +0530 Subject: [PATCH 4/4] minor change --- examples/bin/start-druid-main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bin/start-druid-main.py b/examples/bin/start-druid-main.py index 59fdc6ef5aa1..844933b830f6 100644 --- a/examples/bin/start-druid-main.py +++ b/examples/bin/start-druid-main.py @@ -160,7 +160,7 @@ def configure_parser(): '\'common.jvm.config\' & \'common.runtime.properties\' files. \n' 'If this argument is not given, config from \n' 'conf/druid/auto directory is used.\n' - 'Note. zk config cannot be overriden.\n') + 'Note. zookeeper config cannot be overriden.\n') parser.add_argument('--compute', action='store_true', help='Does not start Druid, only displays the memory allocated \n' 'to each service if started with the given total memory.\n')