我已经建立了一个 3 节点 kafka 集群并使用 python 作为生产者,如下所示:
kafka_addr = "n0.xxx.com:9092,n1.xxx.com:9092,n2.xxx.com:9092"
producer = KafkaProducer(bootstrap_servers=kafka_addr)
当“n0”和“n1”可用但“n2”不可用(broker故障或网络错误)时,producer无法正常工作,发送到“n0n1”但抛出错误:
getaddrinfo failed for n2.xxx.com:9092, exception was [Errno 8] nodename nor servname provided, or not known. Is your advertised.host.name correct and resolvable?