skip to Main Content

We are creating a network with Hyperledger Fabric. All our ledger data are stored inside /var/lib/docker/volume directory, which in fact getting removed once the network is down. To me it looks like Docker mounting of volume is not working. How to use local system volume as suggested by Hyperledger Fabric ../var/hyperledger to store the same.

3

Answers


  1. You could use the Volumes properties in docker yaml file.

     volumes:
         - LOCAL SYSTEM PATH RELATIVE TO THIS FILE: VOLUME INSIDE DOCKER CONTAINER
        
      e.g- 
        
        volumes:
           - ../system-genesis-block:/var/lib/docker/volume
    
    Login or Signup to reply.
  2. If you are using the network.sh script to bring down the network, it removes everything – which I think is good for development. Using docker-compose to stop the network leaves everything as is. There is a school of thought that says your data should exist outside of the container to be safe. You can always recreate the container but it will not bring back lost data.

    I like to store my volumes close to the hyperledger code, so I use the following in my YAML

        volumes:
        - ../system-genesis-block/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
        - ../organizations/ordererOrganizations/vfact.ie/orderers/orderer.vfact.ie/msp:/var/hyperledger/orderer/msp
        - ../organizations/ordererOrganizations/vfact.ie/orderers/orderer.vfact.ie/tls/:/var/hyperledger/orderer/tls
        - $PWD/data/orderer.vfact.ie:/var/hyperledger/production/orderer
    

    where the current working directory (pwd) is the root area for the Hyperledger files and directories. Without knowing too much about how you work your system, I am offering this as a suggestion from one who has had good experiences of this type of usage. If you are using network.sh to bring down the network, perhaps you could remove the down --volumes --remove-orphans from the networkDown() function call to docker-compose.

    Login or Signup to reply.
  3. Try with sudo

    For example sudo ./network.sh up
    Instead of ./network.sh up

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search