Troubleshooting em clusters Kafka

Está tudo certo com o Kafka/MSK? Como checar isto?

Validando autenticação SCRAM

kubectl run -n default -i --tty vitalino-debug --image=ubuntu -- bash

apt update; apt install openjdk-8-jre vim wget tmux -y

cd /tmp
wget https://archive.apache.org/dist/kafka/3.5.1/kafka_2.13-3.5.1.tgz
tar -xvzf kafka_2.13-3.5.1.tgz
mv kafka_2.13-3.5.1 kafka

vim /tmp/users_jaas.conf
KafkaClient {
   org.apache.kafka.common.security.scram.ScramLoginModule required
   username="username"
   password="password123";
};

export KAFKA_OPTS=-Djava.security.auth.login.config=/tmp/users_jaas.conf
cp /etc/ssl/certs/java/cacerts /tmp/kafka.client.truststore.jks

vim /tmp/kafka/bin/client_sasl.properties
security.protocol=SASL_SSL
sasl.mechanism=SCRAM-SHA-512

/tmp/kafka/bin/kafka-topics.sh \
 --create \
 --bootstrap-server b-3.mskcluster.9z6kf3.c1.kafka.us-east-1.amazonaws.com:9096 \
 --command-config /tmp/kafka/bin/client_sasl.properties \
 --replication-factor 3 \
 --partitions 1 \
 --topic TopicTroubleshooting

/tmp/kafka/bin/kafka-console-producer.sh \
 --broker-list b-3.mskcluster.9z6kf3.c1.kafka.us-east-1.amazonaws.com:9096 \
 --topic TopicTroubleshooting \
 --producer.config /tmp/kafka/bin/client_sasl.properties

/tmp/kafka/bin/kafka-console-consumer.sh \
 --bootstrap-server b-3.mskcluster.9z6kf3.c1.kafka.us-east-1.amazonaws.com:9096 \
 --topic TopicTroubleshooting \
 --from-beginning \
 --consumer.config /tmp/kafka/bin/client_sasl.properties

Last updated