producer: C:\kafka_2.11-2.0.0\kafka_2.11-2.0.0>.\bin\windows\kafka-console-producer.bat --broker-list localhost:9092 --topic zxc >hi [2018-09-19 10:30:46,191] WARN [Producer clientId=console-producer] Error while fetching metadata with correlation id 1 : {zxc=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient) [2018-09-19 10:30:46,301] WARN [Producer clientId=console-producer] Error while fetching metadata with correlation id 3 : {zxc=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient) >hdsa >dsa > consumer : C:\kafka_2.11-2.0.0\kafka_2.11-2.0.0>.\bin\windows\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic zxc --from-beginning pause [2018-09-19 10:33:00,493] WARN [Consumer clientId=consumer-1, groupId=console-consumer-309] Connection to node 0 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient) [2018-09-19 10:33:01,633] WARN [Consumer clientId=consumer-1, groupId=console-consumer-309] Connection to node 0 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient) [2018-09-19 10:33:02,900] WARN [Consumer clientId=consumer-1, groupId=console-consumer-309] Connection to node 0 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient) zookpeer: [2018-09-19 10:30:46,175] INFO Got user-level KeeperException when processing sessionid:0x1000019a8de0000 type:setData cxid:0x41 zxid:0x1f txntype:-1 reqpath:n/a Error Path:/config/topics/zxc Error:KeeperErrorCode = NoNode for /config/topics/zxc (org.apache.zookeeper.server.PrepRequestProcessor) [2018-09-19 10:32:49,993] INFO Got user-level KeeperException when processing sessionid:0x1000019a8de0000 type:setData cxid:0x51 zxid:0x25 txntype:-1 reqpath:n/a Error Path:/config/topics/consumer_offsets Error:KeeperErrorCode = NoNode for /config/topics/consumer_offsets (org.apache.zookeeper.server.PrepRequestProcessor) [2018-09-19 10:32:59,369] WARN Exception causing close of session 0x1000019a8de0000: 远程主机强迫关闭了一个现有的连接。 (org.apache.zookeeper.server.NIOServerCnxn) [2018-09-19 10:32:59,369] INFO Closed socket connection for client /127.0.0.1:49708 which had sessionid 0x1000019a8de0000 (org.apache.zookeeper.server.NIOServerCnxn) [2018-09-19 10:33:06,837] INFO Expiring session 0x1000019a8de0000, timeout of 6000ms exceeded (org.apache.zookeeper.server.ZooKeeperServer) [2018-09-19 10:33:06,837] INFO Processed session termination for sessionid: 0x1000019a8de0000 (org.apache.zookeeper.server.PrepRequestProcessor) server: s-48,consumer_offsets-11,consumer_offsets-14,consumer_offsets-20,consumer_offsets-0,consumer_offsets-39,consumer_offsets-45,consumer_offsets-1,consumer_offsets-26,consumer_offsets-29,consumer_offsets-10 and stopped moving logs for partitions because they are in the failed log directory C:\kafka_2.11-2.0.0\kafka-logs. (kafka.server.ReplicaManager) [2018-09-19 10:32:58,868] INFO Stopping serving logs in dir C:\kafka_2.11-2.0.0\kafka-logs (kafka.log.LogManager) [2018-09-19 10:32:58,868] ERROR Shutdown broker because all log dirs in C:\kafka_2.11-2.0.0\kafka-logs have failed (kafka.log.LogManager)
你编辑下命令,里面加入 pause 暂停,看看打什么错误。
producer:
C:\kafka_2.11-2.0.0\kafka_2.11-2.0.0>.\bin\windows\kafka-console-producer.bat --broker-list localhost:9092 --topic zxc
>hi
[2018-09-19 10:30:46,191] WARN [Producer clientId=console-producer] Error while fetching metadata with correlation id 1 : {zxc=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2018-09-19 10:30:46,301] WARN [Producer clientId=console-producer] Error while fetching metadata with correlation id 3 : {zxc=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
>hdsa
>dsa
>
consumer :
C:\kafka_2.11-2.0.0\kafka_2.11-2.0.0>.\bin\windows\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic zxc --from-beginning pause
[2018-09-19 10:33:00,493] WARN [Consumer clientId=consumer-1, groupId=console-consumer-309] Connection to node 0 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2018-09-19 10:33:01,633] WARN [Consumer clientId=consumer-1, groupId=console-consumer-309] Connection to node 0 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
[2018-09-19 10:33:02,900] WARN [Consumer clientId=consumer-1, groupId=console-consumer-309] Connection to node 0 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
zookpeer:
[2018-09-19 10:30:46,175] INFO Got user-level KeeperException when processing sessionid:0x1000019a8de0000 type:setData cxid:0x41 zxid:0x1f txntype:-1 reqpath:n/a Error Path:/config/topics/zxc Error:KeeperErrorCode = NoNode for /config/topics/zxc (org.apache.zookeeper.server.PrepRequestProcessor)
[2018-09-19 10:32:49,993] INFO Got user-level KeeperException when processing sessionid:0x1000019a8de0000 type:setData cxid:0x51 zxid:0x25 txntype:-1 reqpath:n/a Error Path:/config/topics/consumer_offsets Error:KeeperErrorCode = NoNode for /config/topics/consumer_offsets (org.apache.zookeeper.server.PrepRequestProcessor)
[2018-09-19 10:32:59,369] WARN Exception causing close of session 0x1000019a8de0000: 远程主机强迫关闭了一个现有的连接。 (org.apache.zookeeper.server.NIOServerCnxn)
[2018-09-19 10:32:59,369] INFO Closed socket connection for client /127.0.0.1:49708 which had sessionid 0x1000019a8de0000 (org.apache.zookeeper.server.NIOServerCnxn)
[2018-09-19 10:33:06,837] INFO Expiring session 0x1000019a8de0000, timeout of 6000ms exceeded (org.apache.zookeeper.server.ZooKeeperServer)
[2018-09-19 10:33:06,837] INFO Processed session termination for sessionid: 0x1000019a8de0000 (org.apache.zookeeper.server.PrepRequestProcessor)
server:
s-48,consumer_offsets-11,consumer_offsets-14,consumer_offsets-20,consumer_offsets-0,consumer_offsets-39,consumer_offsets-45,consumer_offsets-1,consumer_offsets-26,consumer_offsets-29,consumer_offsets-10 and stopped moving logs for partitions because they are in the failed log directory C:\kafka_2.11-2.0.0\kafka-logs. (kafka.server.ReplicaManager)
[2018-09-19 10:32:58,868] INFO Stopping serving logs in dir C:\kafka_2.11-2.0.0\kafka-logs (kafka.log.LogManager)
[2018-09-19 10:32:58,868] ERROR Shutdown broker because all log dirs in C:\kafka_2.11-2.0.0\kafka-logs have failed (kafka.log.LogManager)
pause是放在consumer启动命令后面吗,我放在后面启动server直接断开
不是额,脚本里面。生产者看着没错。
ERROR Shutdown broker because all log dirs in C:\kafka_2.11-2.0.0\kafka-logs have failed (kafka.log.LogManager)
你看下你这个错
这个是kafka配置,启动会生成的目录,C:\kafka_2.11-2.0.0\kafka-logs这个是他的位置 这个错误我一直看不明白
关注下路径问题,我也只能根据你提供的错误信息帮你分析问题。
因为我在x86和x64上的配置路径都一样 ,会不会是x86和x64里面会有什么区别呢,博主在Windowsx86上装过kafka没
没额,32位的。
你的答案