ansible-middleware / amq_streams

Apache License 2.0
9 stars 7 forks source link

Add custom zookeeper id for each host based in inventory #81

Closed gbaufake closed 1 year ago

gbaufake commented 1 year ago

Currently, the zookeeper id is defined as number on the inventory:

https://github.com/ansible-middleware/amq_streams/blob/7e9087c6a6e5c02ae06c2ea077f1c5560a19b53d/roles/amq_streams_zookeeper/tasks/main.yml#L28

If there is a variable zookepeer_id on inventory, it would be able to set it and define on the inventory

eg:

hostname1 zookeeper_id="101" 
hostname1 zookeeper_id="102" 
rmarting commented 1 year ago

Thanks @gbaufake for you suggestion, however I would like to understand the benefits of this variable. Using the index of the inventory is a simple way to identify the id of each zk in the ensemble, and we can reuse to identify the list of servers included in the ensemble (implemented here)

This approach is used too for the broker id:

https://github.com/ansible-middleware/amq_streams/blob/7e9087c6a6e5c02ae06c2ea077f1c5560a19b53d/roles/amq_streams_broker/templates/server.properties.j2#L26

Should your suggestion apply here too? Do the benefits apply in the same way?

Thanks

gbaufake commented 1 year ago

Yes I do think so,

I've created https://github.com/ansible-middleware/amq_streams/issues/82 for broker.id issue

Some installations of Kafka don't use the 0 to n order and prefer to have more detailed IDs on brokers and myid.