weixin_45661471 2020-04-20 11:11 采纳率: 72.7%
浏览 1243
已结题

docker 安装kafka一直无法测试生产者生产消息成功

1.docker 安装kafka一直无法测试生产者生产消息成功

docker安装完kafka之后,创建topic没有报错
bash-4.4# kafka-topics.sh --create --zookeeper 118.190.26.133:2181 --replication-factor 1 --partitions 1 --topic mytest_topic
WARNING: Due to limitations in metric names, topics with a period ('.') or underscore ('_') could collide. To avoid issues it is best to use either, but not both.
Created topic mytest_topic.

但是运行生产者时候出现了一下错误
bash-4.4# kafka-console-producer.sh --broker-list 118.190.26.133:9092 --topic mytest_topic

[2020-04-20 02:50:33,086] WARN [Producer clientId=console-producer] Connection to node -1 (/118.190.26.133:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2020-04-20 02:50:33,087] WARN [Producer clientId=console-producer] Bootstrap broker 118.190.26.133:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[2020-04-20 02:50:33,175] WARN [Producer clientId=console-producer] Connection to node -1 (/118.190.26.133:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2020-04-20 02:50:33,175] WARN [Producer clientId=console-producer] Bootstrap broker 118.190.26.133:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[2020-04-20 02:50:33,277] WARN [Producer clientId=console-producer] Connection to node -1 (/118.190.26.133:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2020-04-20 02:50:33,277] WARN [Producer clientId=console-producer] Bootstrap broker 118.190.26.133:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[2020-04-20 02:50:33,480] WARN [Producer clientId=console-producer] Connection to node -1 (/118.190.26.133:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2020-04-20 02:50:33,480] WARN [Producer clientId=console-producer] Bootstrap broker 118.190.26.133:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[2020-04-20 02:50:33,934] WARN [Producer clientId=console-producer] Connection to node -1 (/118.190.26.133:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2020-04-20 02:50:33,934] WARN [Producer clientId=console-producer] Bootstrap broker 118.190.26.133:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[2020-04-20 02:50:34,741] WARN [Producer clientId=console-producer] Connection to node -1 (/118.190.26.133:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)

以下是server.propertise配置文件信息
connect-distributed.properties connect-log4j.properties consumer.properties server.properties zookeeper.properties
bash-4.4# vi server.properties

Licensed to the Apache Software Foundation (ASF) under one or more

contributor license agreements. See the NOTICE file distributed with

this work for additional information regarding copyright ownership.

The ASF licenses this file to You under the Apache License, Version 2.0

(the "License"); you may not use this file except in compliance with

the License. You may obtain a copy of the License at

#

http://www.apache.org/licenses/LICENSE-2.0

#

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

see kafka.server.KafkaConfig for additional details and defaults

############################# Server Basics #############################

The id of the broker. This must be set to a unique integer for each broker.

broker.id=0
advertised.host.name=master
############################# Socket Server Settings #############################

The address the socket server listens on. It will get the value returned from

java.net.InetAddress.getCanonicalHostName() if not configured.

FORMAT:

listeners = listener_name://host_name:port

EXAMPLE:

listeners = PLAINTEXT://your.host.name:9092

listeners=PLAINTEXT://0.0.0.0:9092

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://118.190.26.133:9092

  • 写回答

1条回答 默认 最新

  • 关注
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog