I volume a directory in CouchDB, have error when I

2019-08-30 04:06发布

问题:

I add the following two lines in the CouchDB container of docker-compose file.

volumes:
   - ./couchdb:/opt/couchdb/data

My steps as follows:

  1. ./startFabric.sh
  2. composer network install -c PeerAdmin@hlfv1 -a tutorial-network.bna
  3. composer network start -n tutorial-network -A admin -S adminpw -c PeerAdmin@hlfv1 -V 0.0.2-deploy.10 -f admin@tutorial-network.card

It's ok ,and some data will store my couchdb directory. Then I stop&remove all container:

  • ./stopFabrics.sh
  • ./startFabrics.sh
  • composer network install -c PeerAdmin@hlfv1 -a tutorial-network.bna
  • composer network start -n tutorial-network -A admin -S adminpw -c PeerAdmin@hlfv1 -V 0.0.2-deploy.10 -f admin@tutorial-network.card Got error as follows:

✖ Starting business network definition. This may take a minute... Error: Error trying to start business network. Error: No valid responses from any peers. Response from attempted peer comms was an error: Error: 2 UNKNOWN: chaincode error (status: 500, message: chaincode exists tutorial-network) Command failed

Only when I delete the couchdb directory can it works.