如何解决kafka-python:使用 SASL_SSL + SCRAM-SHA-512 时在 recv 期间重置连接
我正在使用 kafka-python 使用 SASL 连接到 Kafka 集群
consumer = KafkaConsumer(bootstrap_servers=['fooserver1:9092','fooserver2:9092'],client_id='foo',api_version=(2,2,1),security_protocol='SASL_SSL',sasl_mechanism='SCRAM-SHA-512',sasl_plain_username='myusername',sasl_plain_password='password123')
但是我在连接时收到以下错误:
<BrokerConnection node_id=bootstrap-0 host=fooserver1:9092 <authenticating> [IPv4 ('my.ip.ad.dress',9092)]>: Error receiving reply from server
Traceback (most recent call last):
File "/opt/python/kafka/conn.py",line 692,in _try_authenticate_scram(data_len,) = struct.unpack('>i',self._recv_bytes_blocking(4))
File "/opt/python/kafka/conn.py",line 616,in _recv_bytes_blocking raise ConnectionError('Connection reset during recv')
ConnectionError: Connection reset during recv
我已确保为建立连接打开了适当的端口。 我需要帮助解决此错误。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。