由于磁盘空间不足,无法恢复Hyperledger Fabric Orderer

时间:2018-03-31 04:15:25

标签: hyperledger-fabric

在我的Hyperledger Fabric上执行Load Test后,我的两个Orderers都没有磁盘空间,导致Orderers没有响应任何呼叫。我试图通过清除日志释放磁盘空间并重新启动Orderer但是失败了。以下是捕获的错误。

有没有人遇到过同样的问题以及如何解决?

fabric-order    | 2018-03-31 03:15:38.370 UTC [orderer/common/blockcutter] Ordered -> DEBU 5929 Enqueuing message into batch
fabric-order    | 2018-03-31 03:15:38.370 UTC [orderer/kafka] processRegular -> DEBU 592a [channel: test] Ordering results: items in batch = 0, ok = true
fabric-order    | 2018-03-31 03:15:38.370 UTC [orderer/kafka] processMessagesToBlocks -> DEBU 592b [channel: test] Successfully unmarshalled consumed message, offset is 14829. Inspecting type...
fabric-order    | 2018-03-31 03:15:38.370 UTC [orderer/kafka] processTimeToCut -> DEBU 592c [channel: test] It's a time-to-cut message for block 2345
fabric-order    | 2018-03-31 03:15:38.370 UTC [orderer/kafka] processTimeToCut -> DEBU 592d [channel: test] Nil'd the timer
fabric-order    | 2018-03-31 03:15:38.370 UTC [fsblkstorage] retrieveBlockByNumber -> DEBU 592e retrieveBlockByNumber() - blockNum = [2344]
fabric-order    | 2018-03-31 03:15:38.370 UTC [fsblkstorage] newBlockfileStream -> DEBU 592f newBlockfileStream(): filePath=[/var/hyperledger/production/orderer/chains/test/blockfile_000001], startOffset=[13754]
fabric-order    | 2018-03-31 03:15:38.370 UTC [fsblkstorage] nextBlockBytesAndPlacementInfo -> DEBU 5930 Remaining bytes=[67089544], Going to peek [8] bytes
fabric-order    | 2018-03-31 03:15:38.370 UTC [fsblkstorage] nextBlockBytesAndPlacementInfo -> DEBU 5931 Returning blockbytes - length=[115], placementInfo={fileNum=[1], startOffset=[13754], bytesOffset=[13755]}
fabric-order    | panic: Error seeking to newest block for chain with non-zero height
fabric-order    |
fabric-order    | goroutine 22 [running]:
fabric-order    | panic(0xb31bc0, 0xc4202031b0)
fabric-order    |       /opt/go/src/runtime/panic.go:500 +0x1a1
fabric-order    | github.com/hyperledger/fabric/orderer/ledger.CreateNextBlock(0x7fc67f4b0fc0, 0xc4200bad80, 0xc4202841e0, 0x4, 0x4, 0xc420202a40)
fabric-order    |       /opt/gopath/src/github.com/hyperledger/fabric/orderer/ledger/util.go:63 +0x4c3
fabric-order    | github.com/hyperledger/fabric/orderer/multichain.(*chainSupport).CreateNextBlock(0xc4202f4c80, 0xc4202841e0, 0x4, 0x4, 0xc4207e0440)
fabric-order    |       /opt/gopath/src/github.com/hyperledger/fabric/orderer/multichain/chainsupport.go:224 +0x81
fabric-order    | github.com/hyperledger/fabric/orderer/kafka.processTimeToCut(0xc420202730, 0x1231f60, 0xc4202f4c80, 0xc4203526f8, 0xc420bbf9a0, 0x39ed, 0x0, 0x0)
fabric-order    |       /opt/gopath/src/github.com/hyperledger/fabric/orderer/kafka/chain.go:410 +0x3e0
fabric-order    | github.com/hyperledger/fabric/orderer/kafka.(*chainImpl).processMessagesToBlocks(0xc4203526c0, 0x0, 0x0, 0x0, 0x0, 0x0)
fabric-order    |       /opt/gopath/src/github.com/hyperledger/fabric/orderer/kafka/chain.go:249 +0xa45
fabric-order    | github.com/hyperledger/fabric/orderer/kafka.startThread(0xc4203526c0)
fabric-order    |       /opt/gopath/src/github.com/hyperledger/fabric/orderer/kafka/chain.go:182 +0x981
fabric-order    | created by github.com/hyperledger/fabric/orderer/kafka.(*chainImpl).Start
fabric-order    |       /opt/gopath/src/github.com/hyperledger/fabric/orderer/kafka/chain.go:94 +0x3f
fabric-order exited with code 2

1 个答案:

答案 0 :(得分:1)

虽然我很想知道问题的根本原因(分类帐应该能够容忍磁盘空间不足),但您应该能够通过以下过程恢复您的订货人:

  1. 备份现有的订购者(尤其是他们的分类帐)
  2. 删除分类帐目录(例如/var/hyperledger/production/orderer)。
  3. 指定文件的起源方法(即ORDERER_GENERAL_GENESISMETHOD=file)并传入您通过ORDERER_GENERAL_GENESISFILE=<genesis.block or other name>
  4. 引导您的订货人的原始创世块
  5. 启动订货人,它应连接到Kafka并重播所有交易以重建分类帐。如果您查看日志或分类帐大小,您应该看到它增长,并且容器将非常活跃,直到它赶上当前状态。
  6. 请注意,如果您的Kafka日志自启动网络后已过期,则此过程将无效。这实际上是您向网络添加新订货人时要遵循的程序。