Skip to content

Commit

Permalink
Added ability to specify randomize_hosts param for ZK client
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgenii Kopanev committed Feb 26, 2024
1 parent 4c7c9d9 commit d9b9c60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ch_tools/chadmin/internal/zookeeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ 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 +469,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 d9b9c60

Please sign in to comment.