Skip to content

Commit bc70707

Browse files
2 nodes
1 parent 66d91b5 commit bc70707

3 files changed

Lines changed: 39 additions & 27 deletions

File tree

ansible_kafka_cluster/cp-ansible-inventory.yml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,40 +63,46 @@ all:
6363

6464
kafka_controller_inter_controller_listener_name: controller
6565

66-
kafka_controller_quorum_voters: "3001@ec2-54-194-116-74.eu-west-1.compute.amazonaws.com:9093,3002@ec2-108-129-174-42.eu-west-1.compute.amazonaws.com:9093,3003@ec2-3-255-254-174.eu-west-1.compute.amazonaws.com:9093"
66+
kafka_controller_quorum_voters: "3001@ec2-3-252-104-19.eu-west-1.compute.amazonaws.com:9093,3002@ec2-108-130-103-28.eu-west-1.compute.amazonaws.com:9093,3003@ec2-34-245-64-96.eu-west-1.compute.amazonaws.com:9093"
6767

6868
kafka_controller:
6969
hosts:
70-
ec2-54-194-116-74.eu-west-1.compute.amazonaws.com:
71-
ansible_host: 54.194.116.74
70+
ec2-3-252-104-19.eu-west-1.compute.amazonaws.com:
71+
ansible_host: 3.252.104.19
7272
kafka_controller_id: 3001
7373
node_id: 3001
74-
ec2-108-129-174-42.eu-west-1.compute.amazonaws.com:
75-
ansible_host: 108.129.174.42
74+
ec2-108-130-103-28.eu-west-1.compute.amazonaws.com:
75+
ansible_host: 108.130.103.28
7676
kafka_controller_id: 3002
7777
node_id: 3002
78-
ec2-3-255-254-174.eu-west-1.compute.amazonaws.com:
79-
ansible_host: 3.255.254.174
78+
ec2-34-245-64-96.eu-west-1.compute.amazonaws.com:
79+
ansible_host: 34.245.64.96
8080
kafka_controller_id: 3003
8181
node_id: 3003
8282

8383
kafka_broker:
8484
hosts:
85-
ec2-3-252-233-200.eu-west-1.compute.amazonaws.com:
86-
ansible_host: 3.252.233.200
85+
ec2-108-130-82-0.eu-west-1.compute.amazonaws.com:
86+
ansible_host: 108.130.82.0
8787
node_id: 1
88-
ec2-34-242-78-83.eu-west-1.compute.amazonaws.com:
89-
ansible_host: 34.242.78.83
88+
ec2-34-253-89-140.eu-west-1.compute.amazonaws.com:
89+
ansible_host: 34.253.89.140
9090
node_id: 2
91-
ec2-54-76-246-112.eu-west-1.compute.amazonaws.com:
92-
ansible_host: 54.76.246.112
91+
ec2-54-75-59-47.eu-west-1.compute.amazonaws.com:
92+
ansible_host: 54.75.59.47
9393
node_id: 3
94-
ec2-54-171-206-34.eu-west-1.compute.amazonaws.com:
95-
ansible_host: 54.171.206.34
94+
ec2-3-251-77-125.eu-west-1.compute.amazonaws.com:
95+
ansible_host: 3.251.77.125
9696
node_id: 4
9797

9898
kafka_connect:
9999
hosts:
100+
ec2-54-217-66-144.eu-west-1.compute.amazonaws.com:
101+
ansible_host: 54.217.66.144
102+
node_id: 1
103+
ec2-34-243-2-32.eu-west-1.compute.amazonaws.com:
104+
ansible_host: 34.243.2.32
105+
node_id: 2
100106

101107
zookeeper:
102108
hosts: {}

ansible_kafka_cluster/inventory.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,43 @@ all:
66
kafka_brokers:
77
hosts:
88
kafka-broker-1:
9-
ansible_host: 3.252.233.200
9+
ansible_host: 108.130.82.0
1010
node_id: 1
1111
kafka-broker-2:
12-
ansible_host: 34.242.78.83
12+
ansible_host: 34.253.89.140
1313
node_id: 2
1414
kafka-broker-3:
15-
ansible_host: 54.76.246.112
15+
ansible_host: 54.75.59.47
1616
node_id: 3
1717
kafka-broker-4:
18-
ansible_host: 54.171.206.34
18+
ansible_host: 3.251.77.125
1919
node_id: 4
2020

2121
kafka_controllers:
2222
hosts:
2323
kafka-controller-1:
24-
ansible_host: 54.194.116.74
24+
ansible_host: 3.252.104.19
2525
node_id: 1
2626
kafka-controller-2:
27-
ansible_host: 108.129.174.42
27+
ansible_host: 108.130.103.28
2828
node_id: 2
2929
kafka-controller-3:
30-
ansible_host: 3.255.254.174
30+
ansible_host: 34.245.64.96
3131
node_id: 3
3232

3333
kafka_connect:
3434
hosts:
35+
kafka-connect-1:
36+
ansible_host: 54.217.66.144
37+
node_id: 1
38+
kafka-connect-2:
39+
ansible_host: 34.243.2.32
40+
node_id: 2
3541

3642
observability:
3743
hosts:
3844
observability-1:
39-
ansible_host: 52.48.44.235
45+
ansible_host: 54.74.204.122
4046

4147
vars:
4248
ansible_user: ubuntu

kafka_rest_api/generate-inventory.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ echo "✅ State file downloaded successfully"
2424
echo ""
2525
echo "📊 Parsing Kafka Connect IP and hostname..."
2626

27-
# Extract Kafka Connect Public IP and DNS
28-
CONNECT_PUBLIC_IP=$(echo "$STATE_JSON" | jq -r '.outputs.kafka_connect_public_ip.value' 2>/dev/null || echo "")
29-
CONNECT_PUBLIC_DNS=$(echo "$STATE_JSON" | jq -r '.outputs.kafka_connect_public_dns.value' 2>/dev/null || echo "")
30-
CONNECT_PRIVATE_IP=$(echo "$STATE_JSON" | jq -r '.outputs.kafka_connect_private_ip.value' 2>/dev/null || echo "")
27+
# Extract Kafka Connect Public IP and DNS (First node only)
28+
CONNECT_PUBLIC_IP=$(echo "$STATE_JSON" | jq -r '.outputs.kafka_connect_public_ip.value[0]' 2>/dev/null || echo "")
29+
CONNECT_PUBLIC_DNS=$(echo "$STATE_JSON" | jq -r '.outputs.kafka_connect_public_dns.value[0]' 2>/dev/null || echo "")
30+
CONNECT_PRIVATE_IP=$(echo "$STATE_JSON" | jq -r '.outputs.kafka_connect_private_ip.value[0]' 2>/dev/null || echo "")
3131

3232
# Validate IPs were extracted
3333
if [ -z "$CONNECT_PUBLIC_IP" ] && [ -z "$CONNECT_PUBLIC_DNS" ]; then

0 commit comments

Comments
 (0)