Open hongbo-miao opened 4 days ago
Oh I got hint from https://github.com/dragomirr/ansible-role-kafka/issues/1#issuecomment-1607761845
I should set kafka_node_id
in my inventory file instead the playbook. (However, I am still not super clear when should I set in the playbook as well 🤔)
Here is my working version. Hope it saves some time for future people 😃
inventory.yaml
all:
children:
my_server_group:
hosts:
my-server:
ansible_host: 10.11.10.10
ansible_user: hongbo-miao
ansible_become_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
xxx
kafka_node_id: 0
playbook.yml
- name: Install Kafka
hosts: my-server
become: yes
roles:
- role: dragomirr.kafka
kafka_heap_size: 2G
kafka_install_dependencies: true
kafka_topics:
- name: production.iot.motor.proto
replication_factor: 1
partitions: 1
kafka_additional_config:
message.max.bytes: 1048576 # 1 MiB
Just re-open, it would be great to clarify when need set kafka_node_id
in the playbook. 😃
I am quite confused for this comment 🤔 And is "play" here actually "playbook"?
- hosts: servers
roles:
- role: dragomirr.kafka
# setting kafka_node_id in play is only valid if you have 1 kafka node
# if you have multiple kafka nodes you need to set unique kafka_node_id for each node
kafka_node_id: 0
For me, currently I only have 1 node, but kafka_node_id: 0
in playbook does not work for me. So why does the comment says "setting kafka_node_id in play is only valid if you have 1 kafka node" which is not true.
For "if you have multiple kafka nodes you need to set unique kafka_node_id for each node", let's say I have 3 nodes, do I need set different kafka_node_id
in
which is the case? Thanks!
I am using version
v0.10.0
. I am trying to set one instance Kafka.Experiment 1
When I set
kafka_node_id: 0
orkafka_node_id: 1
:It gives me error
Experiment 2
If I remove
kafka_node_id
fieldit gives me error
Any ideas? Thanks!
BTW, thank you for this Ansible role! I only found this Ansible role supports KRaft mode. 😃