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.9k stars 901 forks source link

Creating namespace throws error #2194

Closed NavidMitchell closed 4 years ago

NavidMitchell commented 4 years ago

BUG REPORT

When trying to create a Distributed Log Namespace an error "java.io.IOException: No bkdl config bound under dl path" is thrown.

To Reproduce Run local bookkeeper

`DistributedLogConfiguration distributedLogConfiguration = new DistributedLogConfiguration() .setCreateStreamIfNotExists(true) .setExplicitTruncationByApplication(true) .setLogSegmentRollingIntervalMinutes(-1);

    URI uri = new URI("distributedlog://127.0.0.1:2181/test/path");
    Namespace namespace = NamespaceBuilder.newBuilder()
                                          .uri(uri)
                                          .conf(distributedLogConfiguration)
                                          .build();`

Expected behavior

Code completes without error.

Additional context

Stack trace.. `java.io.IOException: No bkdl config bound under dl path : /test/path

at org.apache.distributedlog.impl.metadata.ZkMetadataResolver.resolve(ZkMetadataResolver.java:74)
at org.apache.distributedlog.impl.metadata.BKDLConfig.resolveDLConfig(BKDLConfig.java:71)
at org.apache.distributedlog.impl.BKNamespaceDriver.initializeZooKeeperClients(BKNamespaceDriver.java:234)
at org.apache.distributedlog.impl.BKNamespaceDriver.initialize(BKNamespaceDriver.java:203)
at org.apache.distributedlog.api.namespace.NamespaceBuilder.build(NamespaceBuilder.java:239)
at com.kinotic.continuum.internal.core.api.event.BkDistributedLogTest.testCreateBkLog(BkDistributedLogTest.java:34)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)`
NickPadilla commented 4 years ago

bump, I am having the same issue here. Any ideas?

NavidMitchell commented 4 years ago

It turns out this was noob mistake. Missed this in the docs. I missed this since these docs are terribly outdated and I had been not using them as a reference..

Step 3: Create a DistributedLog namespace

Before using distributedlog, you need to create a distributedlog namespace to store your own list of streams. The zkServer for the local sandbox is 127.0.0.1:7000 and the bookkeeper's ledgers path is /ledgers. You could create a namespace pointing to the corresponding bookkeeper cluster.

./distributedlog-proxy-server/bin/dlog admin bind -l /ledgers -s 127.0.0.1:7000 -c distributedlog://127.0.0.1:7000/messaging/my_namespace No bookkeeper is bound to distributedlog://127.0.0.1:7000/messaging/my_namespace Created binding on distributedlog://127.0.0.1:7000/messaging/my_namespace.

If you don't want to create a separated namespace, you could use the default namespace distributedlog://127.0.0.1:7000/messaging/distributedlog.

Ghatage commented 4 years ago

@eolivelli should we close this?

NickPadilla commented 4 years ago

yes, you can close this issue. :)