apache / bookkeeper

Apache BookKeeper - a scalable, fault tolerant and low latency storage service optimized for append-only workloads
https://bookkeeper.apache.org/
Apache License 2.0
1.91k stars 904 forks source link

bin/bkctl cluster init fails with "java.lang.IllegalArgumentException: No service URI is provided" #2504

Open eolivelli opened 3 years ago

eolivelli commented 3 years ago

BUG REPORT I am trying to setup a StreamStorage Cluster, but the command to init the cluster is not working.

Describe the bug

If you run this command, there is no error and no way to understand what to do (without checking into BK code)

bin/bkctl cluster init

java.lang.IllegalArgumentException: No service URI is provided
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:142)
    at org.apache.bookkeeper.stream.cli.commands.cluster.InitClusterCommand.apply(InitClusterCommand.java:114)
    at org.apache.bookkeeper.stream.cli.commands.cluster.InitClusterCommand.apply(InitClusterCommand.java:53)
    at org.apache.bookkeeper.tools.common.BKCommand.apply(BKCommand.java:94)
    at org.apache.bookkeeper.tools.common.BKCommand.lambda$apply$0(BKCommand.java:49)
    at org.apache.bookkeeper.tools.framework.Cli.run(Cli.java:224)
    at org.apache.bookkeeper.tools.framework.Cli.runCli(Cli.java:244)
    at org.apache.bookkeeper.tools.common.BKCommand.apply(BKCommand.java:51)
    at org.apache.bookkeeper.tools.common.BKCommand.apply(BKCommand.java:39)
    at org.apache.bookkeeper.tools.framework.Cli.run(Cli.java:232)
    at org.apache.bookkeeper.tools.framework.Cli.runCli(Cli.java:244)
    at org.apache.bookkeeper.tools.framework.CliCommandGroup.apply(CliCommandGroup.java:68)
    at org.apache.bookkeeper.tools.framework.Cli.run(Cli.java:232)
    at org.apache.bookkeeper.tools.framework.Cli.runCli(Cli.java:244)
    at org.apache.bookkeeper.tools.cli.BKCtl.main(BKCtl.java:58)
Error : No service URI is provided

Expected behavior

The command succeedes

Suggestions We should document how to start with the BK Stream Storage Service

eolivelli commented 3 years ago

@Jennifer88huang the stream storage service is the state storage for Pulsar Functions probably it is better to document how it works in the BookKeeper website http://bookkeeper.apache.org/docs/4.12.0/overview/overview/

eolivelli commented 3 years ago

The right command is: bin/bkctl cluster init zk://localhost:2181/ledgers

and you must not have run: bin/bkctl bookies init otherwise the command will fail with a meaningless error message

Jennifer88huang-zz commented 3 years ago

@eolivelli Thanks for your info. I'll take a look and deal with it this week.

eolivelli commented 3 years ago

With the BK package in Pulsar there is no problem, but in that case users are not using bkctl but pulsar initialize-cluster-metadata

btw StreamStorage is part of BK, so we should have here the docs and it should work without Pulsar