問題描述
參考Github上 Event Hub的示例代碼(Using Apache Flink with Event Hubs for Apache Kafka Ecosystems : https://github.com/Azure/azure-event-hubs-for-kafka/tree/master/tutorials/flink),使用Apache Flink kafka連接中國區(qū)的Azure Event Hub,遇到 **Kafka error: No resolvable bootstrap urls **
kafkashaded.org.apache.kafka.common.KafkaException: Failed to construct kafka consumer
Caused by: kafkashaded.org.apache.kafka.common.config.ConfigException: No resolvable bootstrap urls given in bootstrap.servers
根據(jù)文檔只修改了下圖中紅色標(biāo)記的部分:
問題解答
根據(jù)錯誤消息旬陡,知道是** bootstrap servers url** 的配置錯誤,bootstrap.servers=mynamespace.servicebus.windows.net:9093, 因為Github上的示例代碼以Global Azure的Event Hub服務(wù)的終結(jié)點為例试躏,而當(dāng)前使用的是中國區(qū)的Azure Event Hub斩披。中國區(qū)正確的 Endpoint 為: bootstrap.servers=mynamespace. servicebus.chinacloudapi.cn:9093
This error message occurs when an invalid hostname or IP address is passed to the
kafka.bootstrap.servers
configuration, The Kafka bootstrap server is not running at the given hostname or IP address.
參考資料
Using Apache Flink with Event Hubs for Apache Kafka Ecosystems : https://github.com/Azure/azure-event-hubs-for-kafka/tree/master/tutorials/flink
Kafka error: ****No resolvable bootstrap urls:https://learn.microsoft.com/en-us/azure/databricks/kb/streaming/kafka-no-resolvable-bootstrap-urls
當(dāng)在復(fù)雜的環(huán)境中面臨問題,格物之道需:濁而靜之徐清晕粪,安以動之徐生挤悉。 云中,恰是如此!
分類: 【Azure 事件中心】
標(biāo)簽: Event Hub Kafka error, No resolvable bootstrap urls