Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Kafka >> mail # user >> How to create the initial zookeeper chroot path for zk.connect?


Copy link to this message
-
Re: How to create the initial zookeeper chroot path for zk.connect?
I'm pretty sure the issue is that those 3 zookeepers are not part of
the same quorum. Try following the quickstart for starting up a local
zookeeper instance or follow
http://zookeeper.apache.org/doc/r3.3.3/zookeeperAdmin.html#sc_zkMulitServerSetup
for a zookeeper cluster setup.

Thanks,
Neha

On Thu, Apr 18, 2013 at 10:50 PM, Jonathan Creasy <[EMAIL PROTECTED]> wrote:
> I made the patch to create the chroot and it doesn't handle multiple zk
> addresses.
>
> We fixed it but I guess that patch didn't get submitted. I will make a
> ticket here to get that done.
> On Apr 18, 2013 10:47 PM, "Ryan Chan" <[EMAIL PROTECTED]> wrote:
>
>> Yes, using the latest Kafka 0.7.2, just tried to reproduce again
>>
>> 1. Install a single node Kafka, three nodes zookeeper instances
>>
>>     kafka1
>>     zookeeper1
>>     zookeeper2
>>     zookeeper3
>>
>> 2. Using a simple Kafka config, able to start without error in the log
>>
>>     brokerid=1
>>     log.dir=/data/kafka
>>     zk.connect=zookeeper1:2181,zookeeper2:2181,zookeeper3:2181
>>
>> 3. Now, create a path in zookeeper1
>>
>>     zkCli.sh -server zookeeper1:2181
>>
>>         ls /
>>         [consumers, brokers, zookeeper]
>>         create /testkafka ''
>>         ls /
>>         [testkafka, consumers, brokers, zookeeper]
>>
>> Quit & Done.
>>
>> 4. Verify from zookeeper2
>>
>>     zkCli.sh -server zookeeper2:2181
>>         ls /
>>         [testkafka, consumers, brokers, zookeeper]
>>
>> Seems ok
>>
>> 4. Update kafka config and restart
>>
>>
>>
>> zk.connect=zookeeper1:2181/testkafka,zookeeper2:2181/testkafka,zookeeper3:2181/testkafka
>>
>> Restart and have the error
>>
>> [2013-04-19 05:35:14,846] 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)
>> ..
>>
>>
>> Any idea?
>>
>>
>>
>>
>> On Fri, Apr 19, 2013 at 5:32 AM, Neha Narkhede <[EMAIL PROTECTED]
>> >wrote:
>>
>> > That is odd. Is it reproducible ?
>> >
>> > On Wed, Apr 17, 2013 at 8:03 PM, Ryan Chan <[EMAIL PROTECTED]>
>> wrote:
>> > > Hi,
>> > >
>> > > Yes, I can see the new path exists by using the command "ls /"
>> > >
>> > >
>> > >
>> > > On Thu, Apr 18, 2013 at 1:29 AM, Neha Narkhede <
>> [EMAIL PROTECTED]
>> > >wrote:
>> > >
>> > >> After creating the path, did you get a chance to confirm that it got
>> > >> created correctly ?
>> > >>
>> > >> Thanks,
>> > >> Neha
>> > >>
>> > >> On Wed, Apr 17, 2013 at 9:30 AM, Ryan Chan <[EMAIL PROTECTED]>
>> > wrote:
>> > >> > Sorry as I am new to Kafka/ZK, but the instruction seems not clear..
>> > >> >
>> > >> > In the config, it was said that we can use a chroot-ed ZK (
>> > >> > http://kafka.apache.org/configuration.html), e.g.
>> > localhost:2181/kafka
>> > >> >
>> > >> > But when I start the Kafka using the setting, it was showing..
>> > >> >
>> > >> > 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)