ep21: kafka cluster without zookeeper

preview_player
Показать описание
In this episode
---
- Use Apache Kafka to generate a cluster ID
- Use the Bitnami Docker Compose file to lab a Kafka cluster
- Create some topics with different parameters

kafka image
---
docker search kafka | head

bitnami kafka
---

create folder
---
sudo mkdir /opt/kafka
sudo chown rui:rui /opt/kafka
cd /opt/kafka

bitnami kafka cluster
---

echo $clusterid

update config
---
#clusterid

#expose port

#advertised listener
kafkaip=$(hostname -I| awk '{print $1}')
echo $kafkaip

start instance
----
docker-compose up -d

kafka topic
---
docker-compose ps

desc topic
---
#check leader for topic1
```
Topic: lab-topic1 TopicId: wsLqJnorQuqAhsNK3ap_rw PartitionCount: 1 ReplicationFactor: 1 Configs:
Topic: lab-topic1 Partition: 0 Leader: 1 Replicas: 1 Isr: 1
```

docker-compose stop kafka-1
```
Topic: lab-topic1 TopicId: wsLqJnorQuqAhsNK3ap_rw PartitionCount: 1 ReplicationFactor: 1 Configs:
Topic: lab-topic1 Partition: 0 Leader: none Replicas: 1 Isr: 1

```
Рекомендации по теме