我加了SASL以后 现在用shell 无法访问了,
./kafka-console-consumer.sh --bootstrap-server 127.0.0.1:9092 --topic test --group my-first-app --from-beginning
这是脚本 kafka-console-consumer.sh
if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then
export KAFKA_HEAP_OPTS="-Xmx512M"
fi
if [ "x$KAFKA_OPTS" = "x" ]; then
echo '加载了加密配置../config/kafka_client_jaas.conf'
export KAFKA_OPTS=-Djava.security.auth.login.config=/opt/program/kafka_2.13-2.6.0/config/kafka_client_jaas.conf
fi
echo $KAFKA_OPTS
exec $(dirname $0)/kafka-run-class.sh kafka.tools.ConsoleConsumer "$@"
[2021-05-20 15:51:31,234] WARN [Consumer clientId=consumer-my-first-app-1, groupId=my-first-app] Bootstrap broker 127.0.0.1:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[2021-05-20 15:51:31,568] WARN [Consumer clientId=consumer-my-first-app-1, groupId=my-first-app] Bootstrap broker 127.0.0.1:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[2021-05-20 15:51:32,056] WARN [Consumer clientId=consumer-my-first-app-1, groupId=my-first-app] Bootstrap broker 127.0.0.1:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[2021-05-20 15:51:32,287] WARN [Consumer clientId=consumer-my-first-app-1, groupId=my-first-app] Bootstrap broker 127.0.0.1:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[2021-05-20 15:51:32,575] WARN [Consumer clientId=consumer-my-first-app-1, groupId=my-first-app] Bootstrap broker 127.0.0.1:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[2021-05-20 15:51:33,064] WARN [Consumer clientId=consumer-my-first-app-1, groupId=my-first-app] Bootstrap broker 127.0.0.1:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[2021-05-20 15:51:33,368] WARN [Consumer clientId=consumer-my-first-app-1, groupId=my-first-app] Bootstrap broker 127.0.0.1:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[2021-05-20 15:51:33,582] WARN [Consumer clientId=consumer-my-first-app-1, groupId=my-first-app] Bootstrap broker 127.0.0.1:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[2021-05-20 15:51:34,070] WARN [Consumer clientId=consumer-my-first-app-1, groupId=my-first-app] Bootstrap broker 127.0.0.1:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)