Skip to content

Instantly share code, notes, and snippets.

@ambud
Last active June 12, 2017 21:54
Show Gist options
  • Save ambud/6d54ea699641391b1da741ac8be14f7c to your computer and use it in GitHub Desktop.
Save ambud/6d54ea699641391b1da741ac8be14f7c to your computer and use it in GitHub Desktop.
Ambari Kafka Rackawareness
rack="/default-rack"
i=0
for host in params.all_hosts:
if host == params.hostname:
rack=params.all_racks[i]
break
i=i+1
kafka_server_config['broker.rack']=rack
all_hosts = default("/clusterHostInfo/all_hosts", [])
all_racks = default("/clusterHostInfo/all_racks", [])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment