下面给出的kafka生产者程序在Unix平台上运行时没有在Windows中运行(即当我在托管kafka代理的Unix中运行它时工作正常)。 Windows中不支持kafka生产者吗?我可以从Windows机器ping ip地址。请帮忙。
package kpkg;
import java.util.Properties;
import kafka.javaapi.producer.Producer;
import kafka.producer.KeyedMessage;
import kafka.producer.ProducerConfig;
public class KProducer {
/**
* @param args
*/
public static void main(String[] args)
{
// TODO Auto-generated method stub
Properties props = new Properties();
props.put("metadata.broker.list", "10.xx.xx.xx:9092");
props.put("serializer.class", "kafka.serializer.StringEncoder");
props.put("request.required.acks", "1");
ProducerConfig config = new ProducerConfig(props);
Producer<String, String> producer = new Producer<String, String>(config);
KeyedMessage<String, String> km = new KeyedMessage<String, String>("SriKafkaTopic" , "SriFirstMessage");
producer.send(km);
producer.close();
}
}
这是我得到的异常错误。
log4j:WARN找不到记录器的附加程序(kafka.utils.VerifiableProperties)。 log4j:WARN请正确初始化log4j系统。 SLF4J:无法加载类“org.slf4j.impl.StaticLoggerBinder”。 SLF4J:默认为无操作(NOP)记录器实现 SLF4J:有关详细信息,请参阅http://www.slf4j.org/codes.html#StaticLoggerBinder。 线程“main”中的异常kafka.common.FailedToSendMessageException:尝试3次后无法发送消息。 at kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:90) at kafka.producer.Producer.send(Producer.scala:76) at kafka.javaapi.producer.Producer.send(Producer.scala:33) 在kpkg.KProducer.main(KProducer.java:30)
这是server.log
的内容 [2014-06-06 16:24:07,342] INFO Verifying properties (kafka.utils.VerifiableProperties)
[2014-06-06 16:24:07,408] INFO Property broker.id is overridden to 0 (kafka.utils.VerifiableProperties)
[2014-06-06 16:24:07,409] INFO Property log.cleaner.enable is overridden to false (kafka.utils.VerifiableProperties)
[2014-06-06 16:24:07,409] INFO Property log.dirs is overridden to /tmp/kafka-logs (kafka.utils.VerifiableProperties)
[2014-06-06 16:24:07,409] INFO Property log.retention.check.interval.ms is overridden to 60000 (kafka.utils.VerifiableProperties)
[2014-06-06 16:24:07,409] INFO Property log.retention.hours is overridden to 168 (kafka.utils.VerifiableProperties)
[2014-06-06 16:24:07,409] INFO Property log.segment.bytes is overridden to 536870912 (kafka.utils.VerifiableProperties)
[2014-06-06 16:24:07,410] INFO Property num.io.threads is overridden to 8 (kafka.utils.VerifiableProperties)
[2014-06-06 16:24:07,410] INFO Property num.network.threads is overridden to 2 (kafka.utils.VerifiableProperties)
[2014-06-06 16:24:07,410] INFO Property num.partitions is overridden to 2 (kafka.utils.VerifiableProperties)
[2014-06-06 16:24:07,410] INFO Property port is overridden to 9092 (kafka.utils.VerifiableProperties)
[2014-06-06 16:24:07,410] INFO Property socket.receive.buffer.bytes is overridden to 1048576 (kafka.utils.VerifiableProperties)
[2014-06-06 16:24:07,410] INFO Property socket.request.max.bytes is overridden to 104857600 (kafka.utils.VerifiableProperties)
[2014-06-06 16:24:07,411] INFO Property socket.send.buffer.bytes is overridden to 1048576 (kafka.utils.VerifiableProperties)
[2014-06-06 16:24:07,411] INFO Property zookeeper.connect is overridden to localhost:2181 (kafka.utils.VerifiableProperties)
[2014-06-06 16:24:07,411] INFO Property zookeeper.connection.timeout.ms is overridden to 1000000 (kafka.utils.VerifiableProperties)
[2014-06-06 16:24:07,432] INFO [Kafka Server 0], starting (kafka.server.KafkaServer)
[2014-06-06 16:24:07,434] INFO [Kafka Server 0], Connecting to zookeeper on localhost:2181 (kafka.server.KafkaServer)
[2014-06-06 16:24:07,788] INFO Found clean shutdown file. Skipping recovery for all logs in data directory '/tmp/kafka-logs' (kafka.log.LogManager)
[2014-06-06 16:24:07,789] INFO Loading log 'SriKafkaTopic-0' (kafka.log.LogManager)
[2014-06-06 16:24:07,820] INFO Completed load of log SriKafkaTopic-0 with log end offset 11 (kafka.log.Log)
[2014-06-06 16:24:07,854] INFO Loading log 'test-0' (kafka.log.LogManager)
[2014-06-06 16:24:07,855] INFO Completed load of log test-0 with log end offset 2 (kafka.log.Log)
[2014-06-06 16:24:07,855] INFO Loading log 'test1-0' (kafka.log.LogManager)
[2014-06-06 16:24:07,856] INFO Completed load of log test1-0 with log end offset 0 (kafka.log.Log)
[2014-06-06 16:24:07,856] INFO Loading log 'test2-0' (kafka.log.LogManager)
[2014-06-06 16:24:07,857] INFO Completed load of log test2-0 with log end offset 1 (kafka.log.Log)
[2014-06-06 16:24:07,858] INFO Starting log cleanup with a period of 60000 ms. (kafka.log.LogManager)
[2014-06-06 16:24:07,861] INFO Starting log flusher with a default period of 9223372036854775807 ms. (kafka.log.LogManager)
[2014-06-06 16:24:07,887] INFO Awaiting socket connections on 0.0.0.0:9092. (kafka.network.Acceptor)
[2014-06-06 16:24:07,897] INFO [Socket Server on Broker 0], Started (kafka.network.SocketServer)
[2014-06-06 16:24:07,974] INFO Will not load MX4J, mx4j-tools.jar is not in the classpath (kafka.utils.Mx4jLoader$)
[2014-06-06 16:24:08,004] INFO 0 successfully elected as leader (kafka.server.ZookeeperLeaderElector)
[2014-06-06 16:24:08,307] INFO New leader is 0 (kafka.server.ZookeeperLeaderElector$LeaderChangeListener)
[2014-06-06 16:24:08,339] INFO Registered broker 0 at path /brokers/ids/0 with address master:9092. (kafka.utils.ZkUtils$)
[2014-06-06 16:24:08,346] INFO [Kafka Server 0], started (kafka.server.KafkaServer)
[2014-06-06 16:24:08,666] INFO [ReplicaFetcherManager on broker 0] Removed fetcher for partitions [test,0],[SriKafkaTopic,0],[test2,0],[test1,0] (kafka.server.ReplicaFetcherManager)
[2014-06-06 16:24:08,739] INFO [ReplicaFetcherManager on broker 0] Removed fetcher for partitions [test,0],[SriKafkaTopic,0],[test2,0],[test1,0] (kafka.server.ReplicaFetcherManager)
[2014-06-06 16:32:06,387] INFO Closing socket connection to /10.87.145.30. (kafka.network.Processor)
[2014-06-06 16:32:06,894] INFO Closing socket connection to /10.87.145.30. (kafka.network.Processor)
[2014-06-06 16:32:06,993] INFO Closing socket connection to /10.87.145.30. (kafka.network.Processor)
[2014-06-06 16:32:07,093] INFO Closing socket connection to /10.87.145.30. (kafka.network.Processor)
[2014-06-06 16:32:07,193] INFO Closing socket connection to /10.87.145.30. (kafka.network.Processor)
这是
的内容 2014-06-06T16:24:07.689+0530: 1.216: [GC 1.216: [ParNew: 26240K->738K(29504K), 0.0131100 secs] 26240K->738K(1045312K), 0.0131890 secs] [Times: user=0.02 sys=0.00, real=0.02 secs]
2014-06-06T16:24:08.475+0530: 2.002: [GC 2.002: [ParNew: 26978K->1175K(29504K), 0.0140800 secs] 26978K->1175K(1045312K), 0.0141450 secs] [Times: user=0.02 sys=0.00, real=0.01 secs]
2014-06-06T16:24:08.494+0530: 2.021: [GC [1 CMS-initial-mark: 0K(1015808K)] 1353K(1045312K), 0.0028850 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
2014-06-06T16:24:08.506+0530: 2.034: [CMS-concurrent-mark-start]
2014-06-06T16:24:08.657+0530: 2.185: [CMS-concurrent-mark: 0.148/0.151 secs] [Times: user=0.15 sys=0.00, real=0.15 secs]
2014-06-06T16:24:08.657+0530: 2.185: [CMS-concurrent-preclean-start]
2014-06-06T16:24:08.668+0530: 2.195: [CMS-concurrent-preclean: 0.011/0.011 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
2014-06-06T16:24:08.668+0530: 2.195: [CMS-concurrent-abortable-preclean-start]
CMS: abort preclean due to time 2014-06-06T16:24:13.672+0530: 7.200: [CMS-concurrent-abortable-preclean: 0.922/5.004 secs] [Times: user=0.91 sys=0.02, real=5.01 secs]
2014-06-06T16:24:13.672+0530: 7.200: [GC[YG occupancy: 8887 K (29504 K)]2014-06-06T16:24:13.672+0530: 7.200: [GC 7.200: [ParNew: 8887K->1559K(29504K), 0.0098440 secs] 8887K->1559K(1045312K), 0.0099560 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
7.210: [Rescan (parallel) , 0.0109290 secs]7.221: [weak refs processing, 0.0000060 secs]7.221: [class unloading, 0.0014740 secs]7.222: [scrub symbol & string
这是state-change.log的内容
[2014-06-06 16:24:08,198] TRACE Controller 0 epoch 8 started leader election for partition [test,0] (state.change.logger)
[2014-06-06 16:24:08,216] ERROR Controller 0 epoch 8 initiated state change for partition [test,0] from OfflinePartition to OnlinePartition failed (state.change.logger)
kafka.common.NoReplicaOnlineException: No replica for partition [test,0] is alive. Live brokers are: [Set()], Assigned replicas are: [List(0)]
at kafka.controller.OfflinePartitionLeaderSelector.selectLeader(PartitionLeaderSelector.scala:61)
at kafka.controller.PartitionStateMachine.electLeaderForPartition(PartitionStateMachine.scala:335)
at kafka.controller.PartitionStateMachine.kafka$controller$PartitionStateMachine$$handleStateChange(PartitionStateMachine.scala:184)
at kafka.controller.PartitionStateMachine$$anonfun$triggerOnlinePartitionStateChange$3.apply(PartitionStateMachine.scala:98)
at kafka.controller.PartitionStateMachine$$anonfun$triggerOnlinePartitionStateChange$3.apply(PartitionStateMachine.scala:95)
at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:743)
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:95)
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:95)
at scala.collection.Iterator$class.foreach(Iterator.scala:772)
at scala.collection.mutable.HashTable$$anon$1.foreach(HashTable.scala:157)
at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:190)
at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:45)
at scala.collection.mutable.HashMap.foreach(HashMap.scala:95)
at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:742)
at kafka.controller.PartitionStateMachine.triggerOnlinePartitionStateChange(PartitionStateMachine.scala:95)
at kafka.controller.PartitionStateMachine.startup(PartitionStateMachine.scala:68)
at kafka.controller.KafkaController.onControllerFailover(KafkaController.scala:311)
at kafka.controller.KafkaController$$anonfun$1.apply$mcV$sp(KafkaController.scala:161)
at kafka.server.ZookeeperLeaderElector.elect(ZookeeperLeaderElector.scala:63)
at kafka.server.ZookeeperLeaderElector$$anonfun$startup$1.apply$mcZ$sp(ZookeeperLeaderElector.scala:49)
at kafka.server.ZookeeperLeaderElector$$anonfun$startup$1.apply(ZookeeperLeaderElector.scala:47)
at kafka.server.ZookeeperLeaderElector$$anonfun$startup$1.apply(ZookeeperLeaderElector.scala:47)
at kafka.utils.Utils$.inLock(Utils.scala:538)
at kafka.server.ZookeeperLeaderElector.startup(ZookeeperLeaderElector.scala:47)
at kafka.controller.KafkaController$$anonfun$startup$1.apply$mcV$sp(KafkaController.scala:630)
at kafka.controller.KafkaController$$anonfun$startup$1.apply(KafkaController.scala:626)
at kafka.controller.KafkaController$$anonfun$startup$1.apply(KafkaController.scala:626)
at kafka.utils.Utils$.inLock(Utils.scala:538)
at kafka.controller.KafkaController.startup(KafkaController.scala:626)
at kafka.server.KafkaServer.startup(KafkaServer.scala:96)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:34)
at kafka.Kafka$.main(Kafka.scala:46)
at kafka.Kafka.main(Kafka.scala)
[2014-06-06 16:24:08,217] TRACE Controller 0 epoch 8 started leader election for partition [test2,0] (state.change.logger)
[2014-06-06 16:24:08,224] ERROR Controller 0 epoch 8 initiated state change for partition [test2,0] from OfflinePartition to OnlinePartition failed (state.change.logger)
kafka.common.NoReplicaOnlineException: No replica for partition [test2,0] is alive. Live brokers are: [Set()], Assigned replicas are: [List(0)]
at kafka.controller.OfflinePartitionLeaderSelector.selectLeader(PartitionLeaderSelector.scala:61)
at kafka.controller.PartitionStateMachine.electLeaderForPartition(PartitionStateMachine.scala:335)
at kafka.controller.PartitionStateMachine.kafka$controller$PartitionStateMachine$$handleStateChange(PartitionStateMachine.scala:184)
at kafka.controller.PartitionStateMachine$$anonfun$triggerOnlinePartitionStateChange$3.apply(PartitionStateMachine.scala:98)
at kafka.controller.PartitionStateMachine$$anonfun$triggerOnlinePartitionStateChange$3.apply(PartitionStateMachine.scala:95)
at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:743)
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:95)
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:95)
at scala.collection.Iterator$class.foreach(Iterator.scala:772)
at scala.collection.mutable.HashTable$$anon$1.foreach(HashTable.scala:157)
at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:190)
at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:45)
at scala.collection.mutable.HashMap.foreach(HashMap.scala:95)
at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:742)
at kafka.controller.PartitionStateMachine.triggerOnlinePartitionStateChange(PartitionStateMachine.scala:95)
at kafka.controller.PartitionStateMachine.startup(PartitionStateMachine.scala:68)
at kafka.controller.KafkaController.onControllerFailover(KafkaController.scala:311)
at kafka.controller.KafkaController$$anonfun$1.apply$mcV$sp(KafkaController.scala:161)
at kafka.server.ZookeeperLeaderElector.elect(ZookeeperLeaderElector.scala:63)
at kafka.server.ZookeeperLeaderElector$$anonfun$startup$1.apply$mcZ$sp(ZookeeperLeaderElector.scala:49)
at kafka.server.ZookeeperLeaderElector$$anonfun$startup$1.apply(ZookeeperLeaderElector.scala:47)
at kafka.server.ZookeeperLeaderElector$$anonfun$startup$1.apply(ZookeeperLeaderElector.scala:47)
at kafka.utils.Utils$.inLock(Utils.scala:538)
at kafka.server.ZookeeperLeaderElector.startup(ZookeeperLeaderElector.scala:47)
at kafka.controller.KafkaController$$anonfun$startup$1.apply$mcV$sp(KafkaController.scala:630)
at kafka.controller.KafkaController$$anonfun$startup$1.apply(KafkaController.scala:626)
at kafka.controller.KafkaController$$anonfun$startup$1.apply(KafkaController.scala:626)
at kafka.utils.Utils$.inLock(Utils.scala:538)
at kafka.controller.KafkaController.startup(KafkaController.scala:626)
at kafka.server.KafkaServer.startup(KafkaServer.scala:96)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:34)
at kafka.Kafka$.main(Kafka.scala:46)
at kafka.Kafka.main(Kafka.scala)
[2014-06-06 16:24:08,225] TRACE Controller 0 epoch 8 started leader election for partition [SriKafkaTopic,0] (state.change.logger)
[2014-06-06 16:24:08,235] ERROR Controller 0 epoch 8 initiated state change for partition [SriKafkaTopic,0] from OfflinePartition to OnlinePartition failed (state.change.logger)
kafka.common.NoReplicaOnlineException: No replica for partition [SriKafkaTopic,0] is alive. Live brokers are: [Set()], Assigned replicas are: [List(0)]
at kafka.controller.OfflinePartitionLeaderSelector.selectLeader(PartitionLeaderSelector.scala:61)
at kafka.controller.PartitionStateMachine.electLeaderForPartition(PartitionStateMachine.scala:335)
at kafka.controller.PartitionStateMachine.kafka$controller$PartitionStateMachine$$handleStateChange(PartitionStateMachine.scala:184)
at kafka.controller.PartitionStateMachine$$anonfun$triggerOnlinePartitionStateChange$3.apply(PartitionStateMachine.scala:98)
at kafka.controller.PartitionStateMachine$$anonfun$triggerOnlinePartitionStateChange$3.apply(PartitionStateMachine.scala:95)
at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:743)
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:95)
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:95)
at scala.collection.Iterator$class.foreach(Iterator.scala:772)
at scala.collection.mutable.HashTable$$anon$1.foreach(HashTable.scala:157)
at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:190)
at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:45)
at scala.collection.mutable.HashMap.foreach(HashMap.scala:95)
at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:742)
at kafka.controller.PartitionStateMachine.triggerOnlinePartitionStateChange(PartitionStateMachine.scala:95)
at kafka.controller.PartitionStateMachine.startup(PartitionStateMachine.scala:68)
at kafka.controller.KafkaController.onControllerFailover(KafkaController.scala:311)
at kafka.controller.KafkaController$$anonfun$1.apply$mcV$sp(KafkaController.scala:161)
at kafka.server.ZookeeperLeaderElector.elect(ZookeeperLeaderElector.scala:63)
at kafka.server.ZookeeperLeaderElector$$anonfun$startup$1.apply$mcZ$sp(ZookeeperLeaderElector.scala:49)
at kafka.server.ZookeeperLeaderElector$$anonfun$startup$1.apply(ZookeeperLeaderElector.scala:47)
at kafka.server.ZookeeperLeaderElector$$anonfun$startup$1.apply(ZookeeperLeaderElector.scala:47)
at kafka.utils.Utils$.inLock(Utils.scala:538)
at kafka.server.ZookeeperLeaderElector.startup(ZookeeperLeaderElector.scala:47)
at kafka.controller.KafkaController$$anonfun$startup$1.apply$mcV$sp(KafkaController.scala:630)
at kafka.controller.KafkaController$$anonfun$startup$1.apply(KafkaController.scala:626)
at kafka.controller.KafkaController$$anonfun$startup$1.apply(KafkaController.scala:626)
at kafka.utils.Utils$.inLock(Utils.scala:538)
at kafka.controller.KafkaController.startup(KafkaController.scala:626)
at kafka.server.KafkaServer.startup(KafkaServer.scala:96)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:34)
at kafka.Kafka$.main(Kafka.scala:46)
at kafka.Kafka.main(Kafka.scala)
[2014-06-06 16:24:08,243] TRACE Controller 0 epoch 8 started leader election for partition [test1,0] (state.change.logger)
[2014-06-06 16:24:08,268] ERROR Controller 0 epoch 8 initiated state change for partition [test1,0] from OfflinePartition to OnlinePartition failed (state.change.logger)
kafka.common.NoReplicaOnlineException: No replica for partition [test1,0] is alive. Live brokers are: [Set()], Assigned replicas are: [List(0)]
at kafka.controller.OfflinePartitionLeaderSelector.selectLeader(PartitionLeaderSelector.scala:61)
at kafka.controller.PartitionStateMachine.electLeaderForPartition(PartitionStateMachine.scala:335)
at kafka.controller.PartitionStateMachine.kafka$controller$PartitionStateMachine$$handleStateChange(PartitionStateMachine.scala:184)
at kafka.controller.PartitionStateMachine$$anonfun$triggerOnlinePartitionStateChange$3.apply(PartitionStateMachine.scala:98)
at kafka.controller.PartitionStateMachine$$anonfun$triggerOnlinePartitionStateChange$3.apply(PartitionStateMachine.scala:95)
at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:743)
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:95)
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:95)
at scala.collection.Iterator$class.foreach(Iterator.scala:772)
at scala.collection.mutable.HashTable$$anon$1.foreach(HashTable.scala:157)
at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:190)
at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:45)
at scala.collection.mutable.HashMap.foreach(HashMap.scala:95)
at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:742)
at kafka.controller.PartitionStateMachine.triggerOnlinePartitionStateChange(PartitionStateMachine.scala:95)
at kafka.controller.PartitionStateMachine.startup(PartitionStateMachine.scala:68)
at kafka.controller.KafkaController.onControllerFailover(KafkaController.scala:311)
at kafka.controller.KafkaController$$anonfun$1.apply$mcV$sp(KafkaController.scala:161)
at kafka.server.ZookeeperLeaderElector.elect(ZookeeperLeaderElector.scala:63)
at kafka.server.ZookeeperLeaderElector$$anonfun$startup$1.apply$mcZ$sp(ZookeeperLeaderElector.scala:49)
at kafka.server.ZookeeperLeaderElector$$anonfun$startup$1.apply(ZookeeperLeaderElector.scala:47)
at kafka.server.ZookeeperLeaderElector$$anonfun$startup$1.apply(ZookeeperLeaderElector.scala:47)
at kafka.utils.Utils$.inLock(Utils.scala:538)
at kafka.server.ZookeeperLeaderElector.startup(ZookeeperLeaderElector.scala:47)
at kafka.controller.KafkaController$$anonfun$startup$1.apply$mcV$sp(KafkaController.scala:630)
at kafka.controller.KafkaController$$anonfun$startup$1.apply(KafkaController.scala:626)
at kafka.controller.KafkaController$$anonfun$startup$1.apply(KafkaController.scala:626)
at kafka.utils.Utils$.inLock(Utils.scala:538)
at kafka.controller.KafkaController.startup(KafkaController.scala:626)
at kafka.server.KafkaServer.startup(KafkaServer.scala:96)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:34)
at kafka.Kafka$.main(Kafka.scala:46)
at kafka.Kafka.main(Kafka.scala)
[2014-06-06 16:24:08,433] TRACE Controller 0 epoch 8 sending UpdateMetadata request (Leader:0,ISR:0,LeaderEpoch:6,ControllerEpoch:7) with correlationId 3 to broker 0 for partition [test,0] (state.change.logger)
[2014-06-06 16:24:08,462] TRACE Controller 0 epoch 8 changed state of replica 0 for partition [test,0] from ReplicaDeletionIneligible to OnlineReplica (state.change.logger)
[2014-06-06 16:24:08,463] TRACE Controller 0 epoch 8 changed state of replica 0 for partition [test2,0] from ReplicaDeletionIneligible to OnlineReplica (state.change.logger)
[2014-06-06 16:24:08,463] TRACE Controller 0 epoch 8 changed state of replica 0 for partition [SriKafkaTopic,0] from ReplicaDeletionIneligible to OnlineReplica (state.change.logger)
[2014-06-06 16:24:08,464] TRACE Controller 0 epoch 8 changed state of replica 0 for partition [test1,0] from ReplicaDeletionIneligible to OnlineReplica (state.change.logger)
[2014-06-06 16:24:08,472] TRACE Controller 0 epoch 8 sending become-leader LeaderAndIsr request (Leader:0,ISR:0,LeaderEpoch:6,ControllerEpoch:7) with correlationId 4 to broker 0 for partition [test,0] (state.change.logger)
[2014-06-06 16:24:08,472] TRACE Controller 0 epoch 8 sending become-leader LeaderAndIsr request (Leader:0,ISR:0,LeaderEpoch:4,ControllerEpoch:7) with correlationId 4 to broker 0 for partition [test2,0] (state.change.logger)
[2014-06-06 16:24:08,472] TRACE Controller 0 epoch 8 sending become-leader LeaderAndIsr request (Leader:0,ISR:0,LeaderEpoch:3,ControllerEpoch:7) with correlationId 4 to broker 0 for partition [SriKafkaTopic,0] (state.change.logger)
[2014-06-06 16:24:08,473] TRACE Controller 0 epoch 8 sending become-leader LeaderAndIsr request (Leader:0,ISR:0,LeaderEpoch:5,ControllerEpoch:7) with correlationId 4 to broker 0 for partition [test1,0] (state.change.logger)
[2014-06-06 16:24:08,473] TRACE Controller 0 epoch 8 sending UpdateMetadata request (Leader:0,ISR:0,LeaderEpoch:6,ControllerEpoch:7) with correlationId 4 to broker 0 for partition [test,0] (state.change.logger)
[2014-06-06 16:24:08,473] TRACE Controller 0 epoch 8 sending UpdateMetadata request (Leader:0,ISR:0,LeaderEpoch:4,ControllerEpoch:7) with correlationId 4 to broker 0 for partition [test2,0] (state.change.logger)
[2014-06-06 16:24:08,474] TRACE Controller 0 epoch 8 sending UpdateMetadata request (Leader:0,ISR:0,LeaderEpoch:3,ControllerEpoch:7) with correlationId 4 to broker 0 for partition [SriKafkaTopic,0] (state.change.logger)
[2014-06-06 16:24:08,491] TRACE Broker 0 cached leader info (LeaderAndIsrInfo:(Leader:0,ISR:0,LeaderEpoch:6,ControllerEpoch:7),ReplicationFactor:1),AllReplicas:0) for partition [test,0] in response to UpdateMetadata request sent by controller 0 epoch 8 with correlation id 3 (state.change.logger)
[2014-06-06 16:24:08,491] TRACE Broker 0 cached leader info (LeaderAndIsrInfo:(Leader:0,ISR:0,LeaderEpoch:4,ControllerEpoch:7),ReplicationFactor:1),AllReplicas:0) for partition [test2,0] in response to UpdateMetadata request sent by controller 0 epoch 8 with correlation id 3 (state.change.logger)
[2014-06-06 16:24:08,492] TRACE Broker 0 cached leader info (LeaderAndIsrInfo:(Leader:0,ISR:0,LeaderEpoch:3,ControllerEpoch:7),ReplicationFactor:1),AllReplicas:0) for partition [SriKafkaTopic,0] in response to UpdateMetadata request sent by controller 0 epoch 8 with correlation id 3 (state.change.logger)
[2014-06-06 16:24:08,492] TRACE Broker 0 cached leader info (LeaderAndIsrInfo:(Leader:0,ISR:0,LeaderEpoch:5,ControllerEpoch:7),ReplicationFactor:1),AllReplicas:0) for partition [test1,0] in response to UpdateMetadata request sent by controller 0 epoch 8 with correlation id 3 (state.change.logger)
[2014-06-06 16:24:08,497] TRACE Controller 0 epoch 8 sending UpdateMetadata request (Leader:0,ISR:0,LeaderEpoch:5,ControllerEpoch:7) with correlationId 4 to broker 0 for partition [test1,0] (state.change.logger)
[2014-06-06 16:24:08,498] TRACE Controller 0 epoch 8 started leader election for partition [test,0] (state.change.logger)
[2014-06-06 16:24:08,568] TRACE Controller 0 epoch 8 elected leader 0 for Offline partition [test,0] (state.change.logger)
[2014-06-06 16:24:08,570] TRACE Controller 0 epoch 8 changed partition [test,0] from OfflinePartition to OnlinePartition with leader 0 (state.change.logger)
[2014-06-06 16:24:08,570] TRACE Controller 0 epoch 8 started leader election for partition [test2,0] (state.change.logger)
答案 0 :(得分:2)
您应该执行一些检查:
确保Unix计算机上没有运行防火墙:
service iptables stop
确保您的Linux计算机具有来自Windows计算机的可解析的主机名。我们遇到了类似的问题(尽管有消费者),直到我们将代理主机名(确切地说是 hostname 实用程序返回的内容)放入客户端/等等/主机。
答案 1 :(得分:1)
我遇到了完全相同的问题,我通过在代理的server.properties中设置以下两个属性来解决它:
hostname
advertised.host.name
advertised.port
P.S。请点击以下链接了解更多详情: