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
You could use the Volumes properties in docker yaml file.
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
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.Try with
sudo
For example
sudo ./network.sh up
Instead of
./network.sh up