Skip to content

Commit

Permalink
Added ability to specify randomize_hosts param for ZK client (#107)
Browse files Browse the repository at this point in the history
Co-authored-by: Evgenii Kopanev <[email protected]>
  • Loading branch information
ekopanev and Evgenii Kopanev authored Feb 28, 2024
1 parent 4c7c9d9 commit 3e4e914
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ch_tools/chadmin/internal/zookeeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,9 @@ def _get_zk_client(ctx):
no_chroot = args.get("no_chroot", False)
no_ch_config = args.get("no_ch_config", False)
zk_root_path = args.get("zk_root_path", None)
zk_randomize_hosts = (
ctx.obj["config"].get("zookeeper", {}).get("randomize_hosts", True)
)

if no_ch_config:
if not host:
Expand Down Expand Up @@ -468,4 +471,5 @@ def _get_zk_client(ctx):
logger=logging.getLogger(),
use_ssl=use_ssl,
verify_certs=verify_ssl_certs,
randomize_hosts=zk_randomize_hosts,
)
3 changes: 3 additions & 0 deletions ch_tools/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"listing_table_database": "default",
}
},
"zookeeper": {
"randomize_hosts": True,
},
}


Expand Down

0 comments on commit 3e4e914

Please sign in to comment.