Jason, In 0.8, we changed the zookeeper data structures as well. You might want to either use a new zk namespace or delete all of your zk data and restart 0.8.
Thanks, Neha On Mon, Jan 7, 2013 at 12:28 PM, Jason Huang <jason.hu...@icare.com> wrote: > Never mind - I was able to start the server after removing the > previous installed 0.7.2 instance of Kafka. > > Jason > > On Mon, Jan 7, 2013 at 2:56 PM, Jason Huang <jason.hu...@icare.com> wrote: > > Hello, > > > > I am trying out Kafka 0.8 using only one broker and I am unable to > > start the server. > > > > With the instruction from this link - > > https://cwiki.apache.org/confluence/display/KAFKA/Kafka+0.8+Quick+Start, > > I was able to download and install 0.8. Since I only have one > > machine, I did the following configuration change: > > > > (1) Comment out the JMX_PORT setting in the script > bin/kafka-server-start.sh > > (2) Keep config/server.properties as: > > brokerid=0 > > port=9092 > > log.dir=/tmp/kafka-logs > > > > Then I was able to start zookeeper as: bin/zookeeper-server-start.sh > > config/zookeeper.properties > > > > However, when I started broker as: bin/kafka-server-start.sh > > config/server.properties, I got the following error (sorry for the > > long paste): > > > > 2013-01-07 14:47:24,251] INFO [Kafka Server 0], starting > > (kafka.server.KafkaServer) > > [2013-01-07 14:47:24,276] INFO [Log Manager on Broker 0] Starting log > > cleaner every 60000 ms (kafka.log.LogManager) > > [2013-01-07 14:47:24,283] INFO [Log Manager on Broker 0] Starting log > > flusher every 1000 ms with the following overrides Map() > > (kafka.log.LogManager) > > [2013-01-07 14:47:24,306] INFO Awaiting socket connections on > > 0.0.0.0:9092. (kafka.network.Acceptor) > > [2013-01-07 14:47:24,307] INFO [Socket Server on Broker 0], started > > (kafka.network.SocketServer) > > [2013-01-07 14:47:24,313] INFO connecting to ZK: localhost:2181 > > (kafka.server.KafkaZooKeeper) > > [2013-01-07 14:47:24,321] INFO Starting ZkClient event thread. > > (org.I0Itec.zkclient.ZkEventThread) > > [2013-01-07 14:47:24,327] INFO Client > > environment:zookeeper.version=3.3.3-1203054, built on 11/17/2011 05:47 > > GMT (org.apache.zookeeper.ZooKeeper) > > [2013-01-07 14:47:24,327] INFO Client > > environment:host.name=kafka.icare.com (org.apache.zookeeper.ZooKeeper) > > [2013-01-07 14:47:24,327] INFO Client > > environment:java.version=1.6.0_24 (org.apache.zookeeper.ZooKeeper) > > [2013-01-07 14:47:24,327] INFO Client environment:java.vendor=Sun > > Microsystems Inc. (org.apache.zookeeper.ZooKeeper) > > [2013-01-07 14:47:24,327] INFO Client > > environment:java.home=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre > > (org.apache.zookeeper.ZooKeeper) > > [2013-01-07 14:47:24,327] INFO Client > > > environment:java.class.path=:./bin/../project/boot/scala-2.8.0/lib/scala-compiler.jar:./bin/../project/boot/scala-2.8.0/lib/scala-library.jar:./bin/../core/target/scala_2.8.0/kafka-0.8.0.jar:./bin/../core/target/scala_2.8.0/kafka-0.8.0-test.jar:./bin/../core/lib/metrics-annotation-3.0.0-c0c8be71.jar:./bin/../core/lib/metrics-core-3.0.0-c0c8be71.jar:./bin/../core/lib/zkclient-20120522.jar:./bin/../perf/target/scala_2.8.0/kafka-perf-0.8.0.jar:./bin/../core/lib_managed/scala_2.8.0/compile/jopt-simple-3.2.jar:./bin/../core/lib_managed/scala_2.8.0/compile/log4j-1.2.15.jar:./bin/../core/lib_managed/scala_2.8.0/compile/slf4j-api-1.7.2.jar:./bin/../core/lib_managed/scala_2.8.0/compile/slf4j-simple-1.7.2.jar:./bin/../core/lib_managed/scala_2.8.0/compile/snappy-java-1.0.4.1.jar:./bin/../core/lib_managed/scala_2.8.0/compile/zookeeper-3.3.4.jar > > (org.apache.zookeeper.ZooKeeper) > > [2013-01-07 14:47:24,327] INFO Client > > > environment:java.library.path=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib > > (org.apache.zookeeper.ZooKeeper) > > [2013-01-07 14:47:24,327] INFO Client environment:java.io.tmpdir=/tmp > > (org.apache.zookeeper.ZooKeeper) > > [2013-01-07 14:47:24,327] INFO Client environment:java.compiler=<NA> > > (org.apache.zookeeper.ZooKeeper) > > [2013-01-07 14:47:24,327] INFO Client environment:os.name=Linux > > (org.apache.zookeeper.ZooKeeper) > > [2013-01-07 14:47:24,327] INFO Client environment:os.arch=amd64 > > (org.apache.zookeeper.ZooKeeper) > > [2013-01-07 14:47:24,327] INFO Client > > environment:os.version=2.6.32-279.14.1.el6.x86_64 > > (org.apache.zookeeper.ZooKeeper) > > [2013-01-07 14:47:24,327] INFO Client environment:user.name=root > > (org.apache.zookeeper.ZooKeeper) > > [2013-01-07 14:47:24,327] INFO Client environment:user.home=/root > > (org.apache.zookeeper.ZooKeeper) > > [2013-01-07 14:47:24,328] INFO Client > > environment:user.dir=/opt/kafka-0.8.0 (org.apache.zookeeper.ZooKeeper) > > [2013-01-07 14:47:24,328] INFO Initiating client connection, > > connectString=localhost:2181 sessionTimeout=6000 > > watcher=org.I0Itec.zkclient.ZkClient@bdee400 > > (org.apache.zookeeper.ZooKeeper) > > [2013-01-07 14:47:24,338] INFO Opening socket connection to server > > localhost/127.0.0.1:2181 (org.apache.zookeeper.ClientCnxn) > > [2013-01-07 14:47:24,341] INFO Socket connection established to > > localhost/127.0.0.1:2181, initiating session > > (org.apache.zookeeper.ClientCnxn) > > [2013-01-07 14:47:24,410] INFO Session establishment complete on > > server localhost/127.0.0.1:2181, sessionid = 0x13c168d69920000, > > negotiated timeout = 6000 (org.apache.zookeeper.ClientCnxn) > > [2013-01-07 14:47:24,412] INFO zookeeper state changed (SyncConnected) > > (org.I0Itec.zkclient.ZkClient) > > [2013-01-07 14:47:24,430] INFO Registered broker 0 at path > > /brokers/ids/0 with address kafka.icare.com:9092. > > (kafka.utils.ZkUtils$) > > [2013-01-07 14:47:24,431] INFO [Kafka Server 0], Connecting to ZK: > > localhost:2181 (kafka.server.KafkaServer) > > [2013-01-07 14:47:24,473] INFO [ControllerEpochListener on 0]: > > Initialized controller epoch to 1579 and zk version 1578 > > (kafka.controller.ControllerEpochListener) > > [2013-01-07 14:47:24,516] INFO Will not load MX4J, mx4j-tools.jar is > > not in the classpath (kafka.utils.Mx4jLoader$) > > [2013-01-07 14:47:24,517] INFO [Controller 0]: Controller starting up > > (kafka.controller.KafkaController) > > [2013-01-07 14:47:24,524] INFO 0 successfully elected as leader > > (kafka.server.ZookeeperLeaderElector) > > [2013-01-07 14:47:24,525] INFO [Controller 0]: Broker 0 starting > > become controller state transition (kafka.controller.KafkaController) > > [2013-01-07 14:47:24,530] INFO Conditional update of zkPath > > /controllerEpoch with value 1580 and expected version 1578 succeeded, > > returning the new version: 1579 (kafka.utils.ZkUtils$) > > [2013-01-07 14:47:24,531] INFO [Controller 0]: Controller 0 > > incremented epoch to 1580 (kafka.controller.KafkaController) > > [2013-01-07 14:47:24,597] ERROR Error while electing or becoming > > leader on broker 0 (kafka.server.ZookeeperLeaderElector) > > kafka.common.KafkaException: Can't parse json string: null > > at kafka.utils.Json$.liftedTree1$1(Json.scala:20) > > at kafka.utils.Json$.parseFull(Json.scala:16) > > at > kafka.utils.ZkUtils$$anonfun$getReplicaAssignmentForTopics$2.apply(ZkUtils.scala:498) > > at > kafka.utils.ZkUtils$$anonfun$getReplicaAssignmentForTopics$2.apply(ZkUtils.scala:494) > > at > scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61) > > at scala.collection.immutable.List.foreach(List.scala:45) > > at > kafka.utils.ZkUtils$.getReplicaAssignmentForTopics(ZkUtils.scala:494) > > at > kafka.controller.KafkaController.initializeControllerContext(KafkaController.scala:446) > > at > kafka.controller.KafkaController.onControllerFailover(KafkaController.scala:220) > > at > kafka.controller.KafkaController$$anonfun$1.apply$mcV$sp(KafkaController.scala:85) > > at > kafka.server.ZookeeperLeaderElector.elect(ZookeeperLeaderElector.scala:53) > > at > kafka.server.ZookeeperLeaderElector.startup(ZookeeperLeaderElector.scala:43) > > at > kafka.controller.KafkaController.startup(KafkaController.scala:381) > > at kafka.server.KafkaServer.startup(KafkaServer.scala:90) > > at > kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:34) > > at kafka.Kafka$.main(Kafka.scala:46) > > at kafka.Kafka.main(Kafka.scala) > > Caused by: java.lang.NullPointerException > > at > scala.util.parsing.combinator.lexical.Scanners$Scanner.<init>(Scanners.scala:52) > > at scala.util.parsing.json.JSON$.parseRaw(JSON.scala:71) > > at scala.util.parsing.json.JSON$.parseFull(JSON.scala:85) > > at kafka.utils.Json$.liftedTree1$1(Json.scala:17) > > ... 16 more > > > > > > I couldn't figure out why broker 0 couldn't become leader (since there > > is only one broker). Anyone has any ideas? > > > > thanks! > > > > Jason >