问题
Once Corda node failed, what is the appropriate process of recovery? Corda transactions are shared only with qualified nodes for specific business network, not with every nodes. Therefore, when recovering failure node, copying data from other node would not work well, recovering from backup is required. However, backup image is not completely same for other correct nodes, I would like to know how recover consistency of corda node.
回答1:
Node data storage
A Corda node stores its vital information as follows:
- The node's data is stored in a standard SQL database
- By default, in an H2 database file called
persistence.mv
- By default, in an H2 database file called
- The node's keys and certificates are stored in Java keystores in the
certificates
folder
Recovery from node crashes
If the node crashes:
- The database and the contents of the
certificates
folder will not be affected - In-flight flows can be restarted from their most recent checkpoint
- Artemis messages can be replayed
In other words, you can generate a new node, re-add the persistence.mv
file, certificates
folder and CorDapps, and the node will behave as if nothing happened when you start it up again.
Recovery from corruption/deletion of the node's files
Loss/corruption of data is non-fatal as long as you are able to recover:
- The node's database
- The contents of the node's
certificates
folder
It is the responsibility of the node's owner to ensure they protect and back-up these files using standard business procedures. If both of these can be recovered and re-added to a new node, the node should spin up as usual.
If the contents of the node's certificates
folder cannot be recovered, you will no longer have your private key, and will not be able to spend your assets on the ledger.
If certain pieces of data cannot be recovered from the node's database, the node could attempt to re-request this data from other nodes where applicable (e.g. the transaction history). However, there is no way to force the counterparties to share this information.
来源:https://stackoverflow.com/questions/50034385/how-backup-restore-corda-node