You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Hyperledger Fabric节点文件系统中账本及状态数据库存储位置咨询

Hyperledger Fabric: LevelDB & CouchDB Storage Locations

Great question! When working through Hyperledger Fabric samples, it’s super common to wonder where all that underlying data lives—especially since LevelDB and CouchDB handle state storage in such different ways. Let’s break down their storage locations based on how you’re running your Fabric nodes:

LevelDB Storage Location

LevelDB is the embedded default state database, so its data is tightly tied to the peer node’s file system:

  • Docker container deployment (most Fabric samples use this):
    Each peer container mounts a Docker volume to store persistent data at /var/hyperledger/production inside the container. LevelDB’s state data lives specifically in the ledgersData/stateLeveldb subdirectory of this path.
    To find the corresponding host machine path, list your Docker volumes with docker volume ls, then inspect the specific peer’s volume (e.g., peer0.org1.example.com) using:
    docker volume inspect peer0.org1.example.com
    
    The Mountpoint field in the output will show you exactly where the data lives on your host.
  • Bare-metal deployment (running peer binaries directly):
    By default, LevelDB data is stored in $FABRIC_CFG_PATH/production/ledgersData/stateLeveldb. The $FABRIC_CFG_PATH environment variable defaults to /etc/hyperledger/fabric unless you’ve modified it. You can also check the core.yaml configuration file for the ledger.dataDir and ledger.state.leveldb.path settings to confirm the exact path.

CouchDB Storage Location

CouchDB runs as an external service (even when containerized), so its storage is separate from the peer node:

  • Docker container deployment (sample setup):
    Fabric samples typically spin up CouchDB containers with a dedicated volume mounted to /opt/couchdb/data inside the container—this is where CouchDB stores all its database files.
    Similar to LevelDB, you can inspect the CouchDB volume (e.g., couchdb0) with docker volume inspect couchdb0 to get the host machine’s mount path.
    Note: The peer node itself doesn’t store CouchDB data; it just connects to the CouchDB instance via the settings in core.yaml under ledger.state.couchDBConfig.
  • Bare-metal CouchDB deployment:
    If you’ve installed CouchDB directly on your host, the default storage path is /opt/couchdb/data. You can customize this by editing CouchDB’s local.ini configuration file, modifying the database_dir parameter under the [couchdb] section.

内容的提问来源于stack exchange,提问作者Skadoosh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 10:42:36