0
我試圖測試從一個環境連接到運行我們的kafka服務器的數字海洋拖放的連接。無法從遠程客戶端連接到數字海洋上的kafka服務器
我試圖運行./kafka-console-producer.sh --broker-list <HOST_NAME>:9092 --topic <topic>
而且我一直獲得迄今所採取
[2017-10-17 14:38:59,438] WARN Connection to node -1 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient) [2017-10-17 14:38:59,490] WARN Connection to node -1 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient) [2017-10-17 14:38:59,542] WARN Connection to node -1 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient) [2017-10-17 14:38:59,644] WARN Connection to node -1 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient) [2017-10-17 14:38:59,696] WARN Connection to node -1 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
步驟:
- 設置advertised.listeners到
PLAINTEXT://<ipaddress>:9092
- 添加到每個試圖連接的客戶端的/ etc/hosts
- 添加advertised.host和advertised.port
- 9092被接受的數字滄海一粟
- 卡夫卡的IPv4,而不是IPv6的
我的服務器的有關章節運行Ubuntu的安裝裏面的TCP連接的.properties文件(HOST_NAME是一個別名爲實際的主機名來保護隱私):
listeners=PLAINTEXT://HOST_NAME:9092
host.name=HOST_NAME
# Hostname and port the broker will advertise to producers and consumers. If not set,
# it uses the value for "listeners" if configured. Otherwise, it will use the value
# returned from java.net.InetAddress.getCanonicalHostName().
advertised.listeners=PLAINTEXT://HOST_NAME:9092
advertised.host.name=HOST_NAME
advertised.port=9092
我可以從LOCALMACHINE將自己連接的,但我在我的繩子結束瞭如何獲得一個啞巴小測試我懸掛在電線上。
我在做什麼錯?
防火牆規則?你應該允許入口流量到端口9092? –
我應該說,我在Ubuntu中添加了防火牆規則。我還需要設置一個特定的數字海洋防火牆嗎? – DoctaMag