Return-Path: X-Original-To: apmail-incubator-kafka-users-archive@minotaur.apache.org Delivered-To: apmail-incubator-kafka-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9937D9FE3 for ; Tue, 27 Nov 2012 18:13:04 +0000 (UTC) Received: (qmail 43026 invoked by uid 500); 27 Nov 2012 18:13:04 -0000 Delivered-To: apmail-incubator-kafka-users-archive@incubator.apache.org Received: (qmail 42998 invoked by uid 500); 27 Nov 2012 18:13:04 -0000 Mailing-List: contact kafka-users-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: kafka-users@incubator.apache.org Delivered-To: mailing list kafka-users@incubator.apache.org Received: (qmail 42990 invoked by uid 99); 27 Nov 2012 18:13:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Nov 2012 18:13:04 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of curtin.chris@gmail.com designates 209.85.214.175 as permitted sender) Received: from [209.85.214.175] (HELO mail-ob0-f175.google.com) (209.85.214.175) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Nov 2012 18:12:55 +0000 Received: by mail-ob0-f175.google.com with SMTP id vb8so10852454obc.6 for ; Tue, 27 Nov 2012 10:12:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=mpK4zfJb4PFHwvYol6LwkSce2Vys+Mw+6PTusTkNiv8=; b=qLNh2ncZPHw7IQleByetkrV9adBvZkOV24qPzI0ood76CN5KykgWRs9YWLaY+/1FFS 9NCI6EHMKqfXQGyCtsQ/ufyJQ5WcESVEEPDV05YfFIOmeCESiYOpXvgePqvud8gVd41H PRZRVveJfuJ6imRTmuU9VwC4pGRzZI9uxRMkvIdS/JzactON2waPPcCBSnm2Nrr96bX1 AuHhLj/K3cohmp5wBA9nHxaemDdFxV2U440v3C4HYnPRxsYEvasEIaFHyS74jvf+s808 vc5BJhZWjALnxCZiEQL6MQb6oy/A/wIHnO9frfhv9h6UFZJqGRXxKBRwgOIVtqCMtUGO tZfw== MIME-Version: 1.0 Received: by 10.60.172.229 with SMTP id bf5mr13425332oec.81.1354039954754; Tue, 27 Nov 2012 10:12:34 -0800 (PST) Received: by 10.60.132.133 with HTTP; Tue, 27 Nov 2012 10:12:34 -0800 (PST) In-Reply-To: References: Date: Tue, 27 Nov 2012 13:12:34 -0500 Message-ID: Subject: Re: 0.8.0 producer can't connect to cluster? From: Chris Curtin To: kafka-users@incubator.apache.org Content-Type: multipart/alternative; boundary=bcaec54ee86c83cd2f04cf7dfee8 X-Virus-Checked: Checked by ClamAV on apache.org --bcaec54ee86c83cd2f04cf7dfee8 Content-Type: text/plain; charset=ISO-8859-1 Okay, figured out that you need to turn on Log4j logger to DEBUG then you get a NoSuchMethodError around yammer. (see below) I'm running yammer 2.2.0 since that seems to be all I can find via maven. Is there a different version needed? Thanks, Chris 257 [main] INFO kafka.producer.SyncProducer - Connected to 10.121.31.55:9094 for producing 286 [main] WARN kafka.producer.async.DefaultEventHandler - failed to send to broker 3 with data Map([test1,0] -> ByteBufferMessageSet(MessageAndOffset(Message(magic = 2, attributes = 0, crc = 1906312613, key = null, payload = java.nio.HeapByteBuffer[pos=0 lim=22 cap=22]),0), )) java.lang.NoSuchMethodError: com.yammer.metrics.core.TimerContext.stop()J at kafka.metrics.KafkaTimer.time(KafkaTimer.scala:36) at kafka.producer.SyncProducer.send(SyncProducer.scala:94) at kafka.producer.async.DefaultEventHandler.kafka$producer$async$DefaultEventHandler$$send(DefaultEventHandler.scala:221) at kafka.producer.async.DefaultEventHandler$$anonfun$dispatchSerializedData$1.apply(DefaultEventHandler.scala:87) at kafka.producer.async.DefaultEventHandler$$anonfun$dispatchSerializedData$1.apply(DefaultEventHandler.scala:81) at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:80) at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:80) at scala.collection.Iterator$class.foreach(Iterator.scala:631) at scala.collection.mutable.HashTable$$anon$1.foreach(HashTable.scala:161) at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:194) at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:39) at scala.collection.mutable.HashMap.foreach(HashMap.scala:80) at kafka.producer.async.DefaultEventHandler.dispatchSerializedData(DefaultEventHandler.scala:81) at kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:57) at kafka.producer.Producer.send(Producer.scala:75) at kafka.javaapi.producer.Producer.send(Producer.scala:32) at com.silverpop.kafka.playproducer.TestProducer.main(TestProducer.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) On Tue, Nov 27, 2012 at 12:30 PM, Jun Rao wrote: > When the producer fails to send in 3 retries, it will log an error. Before > that, in the producer, we log the failure of each of the retries in warn > and it tells you the cause. > > Also, did you create the topic first? > > Thanks, > > Jun > > On Tue, Nov 27, 2012 at 8:56 AM, Chris Curtin >wrote: > > > The error from when it fails is all I get. Nothing on the broker side and > > no other errors or exceptions on the client. > > > > Where should I be looking for the reasons? Is there a callback I should > be > > implementing? > > > > Thanks, > > > > Chris > > > > > > On Tue, Nov 27, 2012 at 11:49 AM, Jun Rao wrote: > > > > > Do you have the exception that caused each retry to fail? > > > > > > Thanks, > > > > > > Jun > > > > > > On Tue, Nov 27, 2012 at 7:17 AM, Chris Curtin > > >wrote: > > > > > > > Hi, > > > > > > > > Installed 0.8.0 yesterday, 3 physical machines, 9 brokers running (3 > > per > > > > machine). 2 topics, with 3 replicas each > > > > > > > > the console producer/consumer examples work fine. > > > > > > > > When I run my producer logic I get the following error whether on the > > > > cluster or in my dev environment: > > > > > > > > Exception in thread "main" kafka.common.FailedToSendMessageException: > > > > Failed to send messages after 3 tries. > > > > at > > > > > > > > > > > > > > kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:70) > > > > at kafka.producer.Producer.send(Producer.scala:75) > > > > at kafka.javaapi.producer.Producer.send(Producer.scala:32) > > > > at > > > > com.silverpop.kafka.playproducer.TestProducer.main(TestProducer.java:40) > > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > > at > > > > > > > > > > > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > > > at > > > > > > > > > > > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > > > at java.lang.reflect.Method.invoke(Method.java:597) > > > > at > com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) > > > > > > > > Code is pretty basic: > > > > > > > > public class TestProducer { > > > > public static void main(String[] args) { > > > > > > > > String zookeeper = args[0]; > > > > long events = Long.parseLong(args[1]); > > > > long blocks = Long.parseLong(args[2]); > > > > > > > > Random rnd = new Random(); > > > > > > > > Properties props = new Properties(); > > > > props.put("broker.list", "mongodb03.atlnp1:9092"); > > > > > > > > > > > > props.put("serializer.class", > > "kafka.serializer.StringEncoder"); > > > > ProducerConfig config = new ProducerConfig(props); > > > > Producer producer = new Producer > > > String>(config); > > > > > > > > > > > > for (long nBlocks = 0; nBlocks < blocks; nBlocks++) { > > > > for (long nEvents = 0; nEvents < events; nEvents++) { > > > > long runtime = new Date().getTime(); > > > > String msg = runtime + "," + (50 + nBlocks) + "," + > > > > nEvents+ "," + rnd.nextInt(1000); > > > > KeyedMessage data = new > > > > KeyedMessage("test1", msg); > > > > producer.send(data); > > > > } > > > > } > > > > > > > > > > > > } > > > > > > > > using Zookeeper doesn't matter. Changing broker.list to include all 9 > > > > brokers doesn't matter. Changing Producer and KeyedMessage to be > > > > > String> doesn't matter. > > > > > > > > Thoughts on what I'm doing wrong? > > > > > > > > Thanks, > > > > > > > > Chris > > > > > > > > > > --bcaec54ee86c83cd2f04cf7dfee8--