Reputation: 190
I am saving files inside my ledger with fabric 1.1 and leveldb. As expected, this makes the peers' docker containers to fastly run out of space. I thought that changing to couchdb was going to fix the problem (it transfers the problem to the couchdb container, but I can handle that), but to my surprise, I've checked that using couchdb in fact saves data to the couchdb containers, but it also saves data inside the peers!. For example, uploading a 1,3MB file to my app, configured to use couchdb, also creates a "blockfile" in /var/hyperledger/production/ledgersData/chains/chains/mychannel
of 1.3MB inside the involved peers. How can this be? Is it possible to disable this behaviour and save data only in couch containers? (or mounted volumes for this containers), is this a bug fixed in newer fabric versions?. If not possible, how can I configure bigger peers?.
I know I can change the solution to hash attachments, save only references to this hashes inside my ledger and store data in an external data store, but I'm working on a project with this requirement and changing the approach is not a possibility.
Thanks.
Upvotes: 0
Views: 105
Reputation: 12013
The peer has both a file-based ledger (the "blockchain") as well as a state database which holds / caches the last know value for any given key.
State can be stored in either goleveldb or in CouchDB. The ledger is always stored on the peer filesystem. (Note that goleveldb data files are also stored on the peer filesystem).
The location is set via peer.fileSystemPath
in core.yaml
and the default value is /var/hyperledger/production
. You can mount an external volume for this as well if you want to store the files on the host and not inside the container filesystem.
Upvotes: 2