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

Failed to fetch cluster metadata from zookeeper @/stream/metadata #2084

Open rolish opened 5 years ago

rolish commented 5 years ago

QUESTION I'm trying to use streams with bookkeeper gprc. Configmap:

apiVersion: v1
kind: ConfigMap
metadata:
    name: bookie-config
data:
    BK_BOOKIE_EXTRA_OPTS: "\"-Xms1g -Xmx1g -XX:MaxDirectMemorySize=1g -XX:+UseG1GC  -XX:MaxGCPauseMillis=10 -XX:+ParallelRefProcEnabled -XX:+UnlockExperimentalVMOptions -XX:+AggressiveOpts -XX:+DoEscapeAnalysis -XX:ParallelGCThreads=32 -XX:ConcGCThreads=32 -XX:G1NewSizePercent=50 -XX:+DisableExplicitGC -XX:-ResizePLAB\""
    BK_bookiePort: "3181"
    BK_journalDirectory: "/bookkeeper/data/journal"
    BK_ledgerDirectories: "/bookkeeper/data/ledgers"
    BK_indexDirectories: "/bookkeeper/data/ledgers"
    BK_metadataServiceUri: "zk://zookeeper-1.x.com;zookeeper-2.x.com;zookeeper-3.x.com;zookeeper-4.x.com;zookeeper-5.x.com;zookeeper-6.x.com/ledgers"
    BK_httpServerEnabled: "true"
    BK_httpServerPort: "8080"
    # TODO: Issue 458: https://github.com/apache/bookkeeper/issues/458
    #BK_statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
    # use hostname as bookie id as bookie statefulset runs with hostnetwork: true
    BK_useHostNameAsBookieID: "false"
    BOOKIE_GRPC_PORT: "4181"
    BK_extraServerComponents: org.apache.bookkeeper.stream.server.StreamStorageLifecycleComponent

version:

image: apache/bookkeeper:4.9.1

Getting startup exception:

Exception in thread "main" org.apache.bookkeeper.stream.storage.exceptions.StorageRuntimeException: Failed to fetch cluster metadata from zookeeper @/stream/metadata

Attaching full log of bookie-0:

logs-from-bookie-in-bookie-0 (18).txt

rolish commented 5 years ago

zkCli.sh shows following objects (created by stream/distributedlog/core/src/main/java/org/apache/distributedlog/impl/BKNamespaceDriver.java) in zookeeper:

[zk: localhost:2181(CONNECTED) 5] ls /
[zookeeper, stream, ledgers]
[zk: localhost:2181(CONNECTED) 3] ls /stream
[storage]
[zk: localhost:2181(CONNECTED) 4] ls /stream/storage
[]

There is no /stream/metadata.

ArvinDevel commented 5 years ago

Before you start up the cluster, you should init the cluster meta by using "bin/bkctl cluster init -n container number zkServers

sijie commented 5 years ago

@rolish does Arvin's comment answer you question?