用kafka console的producer的时候产生错误



  • 用kafka console的producer的时候产生了这个错误:

    $ ./kafka-console-producer.sh --broker-list `docker-machine ip bigdata`:9092 --topic bigdata
    jkl
    [2016-10-22 18:50:16,202] WARN Bootstrap broker 192.168.99.100:9092 disconnected (org.apache.kafka.clients.NetworkClient)
    [2016-10-22 18:50:16,403] WARN Bootstrap broker 192.168.99.100:9092 disconnected (org.apache.kafka.clients.NetworkClient)
    [2016-10-22 18:50:16,604] WARN Bootstrap broker 192.168.99.100:9092 disconnected (org.apache.kafka.clients.NetworkClient)
    [2016-10-22 18:50:16,806] WARN Bootstrap broker 192.168.99.100:9092 disconnected (org.apache.kafka.clients.NetworkClient)
    [2016-10-22 18:50:17,007] WARN Bootstrap broker 192.168.99.100:9092 disconnected (org.apache.kafka.clients.NetworkClient)
    [2016-10-22 18:50:17,209] WARN Bootstrap broker 192.168.99.100:9092 disconnected (org.apache.kafka.clients.NetworkClient)
    [2016-10-22 18:50:17,410] WARN Bootstrap broker 192.168.99.100:9092 disconnected (org.apache.kafka.clients.NetworkClient)
    

    ip是对的

    $ docker-machine ip bigdata
    192.168.99.100
    

    里面docker的kafka也在运行:

    docker@bigdata:~$ docker ps
    CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS                                                                    NAMES
    c0b77ec77127        confluent/kafka       "/usr/local/bin/kafka"   17 minutes ago      Up 17 minutes       0.0.0.0:9092->9092/tcp                                                   kafka
    e3380f907ae1        confluent/zookeeper   "/usr/local/bin/zk-do"   18 minutes ago      Up 18 minutes       0.0.0.0:2181->2181/tcp, 0.0.0.0:2888->2888/tcp, 0.0.0.0:3888->3888/tcp   zookeeper
    d
    

    topic也弄好了

    $ ./kafka-topics.sh --create --zookeeper `docker-machine ip bigdata` --replication-factor 1 --partitions 1 --topic bigdata
    Created topic "bigdata".
    $ ./kafka-topics.sh --list --zookeeper `docker-machine ip bigdata`
    bigdata
    

    但是用producer发送消息的时候就是通过不了。求问是什么原因。



  • @goudanli 看看kafka和zookeeper的日志吧(docker logs 容器)




登录后回复
 

与 BitTiger Community 的连接断开,我们正在尝试重连,请耐心等待