You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by 刘明敏 <di...@gmail.com> on 2012/05/30 05:13:10 UTC

specify chroot of zk.connect string for broker server makes error

The configuration doc
<http://incubator.apache.org/kafka/configuration.html>said for
broker's zk.connect string we can

Specifies the zookeeper connection string in the form hostname:port/chroot


while after i set chroot,error occurred:

[2012-05-29 18:13:44,737] INFO Registering broker /brokers/ids/0
> (kafka.server.KafkaZooKeeper)
> [2012-05-29 18:13:44,806] FATAL Fatal error during KafkaServerStable
> startup. Prepare to shutdown (kafka.server.KafkaServerStartable)
> java.lang.IllegalArgumentException: Path length must be > 0
>         at
> org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:48)
>         at
> org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:35)
>         at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:626)
>         at org.I0Itec.zkclient.ZkConnection.create(ZkConnection.java:87)
>         at org.I0Itec.zkclient.ZkClient$1.call(ZkClient.java:308)
>         at org.I0Itec.zkclient.ZkClient$1.call(ZkClient.java:304)
>         at
> org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:675)
>         at org.I0Itec.zkclient.ZkClient.create(ZkClient.java:304)
>         at org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:213)
>         at org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:223)
>         at org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:223)
>         at kafka.utils.ZkUtils$.createParentPath(ZkUtils.scala:47)
>         at kafka.utils.ZkUtils$.createEphemeralPath(ZkUtils.scala:59)
>         at
> kafka.utils.ZkUtils$.createEphemeralPathExpectConflict(ZkUtils.scala:71)
>         at
> kafka.server.KafkaZooKeeper.registerBrokerInZk(KafkaZooKeeper.scala:54)
>         at kafka.log.LogManager.startup(LogManager.scala:123)
>         at kafka.server.KafkaServer.startup(KafkaServer.scala:80)
>         at
> kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:34)
>         at kafka.Kafka$.main(Kafka.scala:50)
>         at kafka.Kafka.main(Kafka.scala)


without chroot,it works fine

any idea?

PS.I'm using the latest version from trunk


-- 
Best Regards

----------------------
刘明敏 | mmLiu

Re: specify chroot of zk.connect string for broker server makes error

Posted by Roman Garcia <ro...@gmail.com>.
You need to create the chroot dirs on zookeeper first, using zkCli.sh:

zkCli.sh -server <zk-url>
create <your-chroot> <user:group>

Regards,
Roman


2012/5/30 刘明敏 <di...@gmail.com>

> The configuration doc
> <http://incubator.apache.org/kafka/configuration.html>said for
> broker's zk.connect string we can
>
> Specifies the zookeeper connection string in the form hostname:port/chroot
>
>
> while after i set chroot,error occurred:
>
> [2012-05-29 18:13:44,737] INFO Registering broker /brokers/ids/0
> > (kafka.server.KafkaZooKeeper)
> > [2012-05-29 18:13:44,806] FATAL Fatal error during KafkaServerStable
> > startup. Prepare to shutdown (kafka.server.KafkaServerStartable)
> > java.lang.IllegalArgumentException: Path length must be > 0
> >         at
> > org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:48)
> >         at
> > org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:35)
> >         at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:626)
> >         at org.I0Itec.zkclient.ZkConnection.create(ZkConnection.java:87)
> >         at org.I0Itec.zkclient.ZkClient$1.call(ZkClient.java:308)
> >         at org.I0Itec.zkclient.ZkClient$1.call(ZkClient.java:304)
> >         at
> > org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:675)
> >         at org.I0Itec.zkclient.ZkClient.create(ZkClient.java:304)
> >         at
> org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:213)
> >         at
> org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:223)
> >         at
> org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:223)
> >         at kafka.utils.ZkUtils$.createParentPath(ZkUtils.scala:47)
> >         at kafka.utils.ZkUtils$.createEphemeralPath(ZkUtils.scala:59)
> >         at
> > kafka.utils.ZkUtils$.createEphemeralPathExpectConflict(ZkUtils.scala:71)
> >         at
> > kafka.server.KafkaZooKeeper.registerBrokerInZk(KafkaZooKeeper.scala:54)
> >         at kafka.log.LogManager.startup(LogManager.scala:123)
> >         at kafka.server.KafkaServer.startup(KafkaServer.scala:80)
> >         at
> > kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:34)
> >         at kafka.Kafka$.main(Kafka.scala:50)
> >         at kafka.Kafka.main(Kafka.scala)
>
>
> without chroot,it works fine
>
> any idea?
>
> PS.I'm using the latest version from trunk
>
>
> --
> Best Regards
>
> ----------------------
> 刘明敏 | mmLiu
>