Hyperledger fabric Hyperledger结构:在运行raft网络中添加订购者
我想在正在运行的hyperledger fabric网络中添加一个新的订购者节点。我使用了etcdraft作为订购方之间的共识 我遵循了一步一步的过程。在步骤#15中提到,我必须从系统频道获取最新的配置块,并将此块用作新订购服务的创世纪块 因此,我将config块复制到通道工件文件夹[文件名:config_block.pb],然后使用docker-compose.yaml文件启动一个新容器。作为参考,我将docker-compose.yaml文件发布在此处:Hyperledger fabric Hyperledger结构:在运行raft网络中添加订购者,hyperledger-fabric,blockchain,hyperledger,consensus,raft,Hyperledger Fabric,Blockchain,Hyperledger,Consensus,Raft,我想在正在运行的hyperledger fabric网络中添加一个新的订购者节点。我使用了etcdraft作为订购方之间的共识 我遵循了一步一步的过程。在步骤#15中提到,我必须从系统频道获取最新的配置块,并将此块用作新订购服务的创世纪块 因此,我将config块复制到通道工件文件夹[文件名:config_block.pb],然后使用docker-compose.yaml文件启动一个新容器。作为参考,我将docker-compose.yaml文件发布在此处: version: '2' volu
version: '2'
volumes:
orderer6.example.com:
networks:
byfn:
services:
orderer6.example.com:
image: hyperledger/fabric-orderer:latest
environment:
- FABRIC_LOGGING_SPEC=INFO
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
# enabled TLS
- ORDERER_GENERAL_TLS_ENABLED=true
- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
- ORDERER_KAFKA_TOPIC_REPLICATIONFACTOR=1
- ORDERER_KAFKA_VERBOSE=true
- ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/var/hyperledger/orderer/tls/server.crt
- ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/var/hyperledger/orderer/tls/server.key
- ORDERER_GENERAL_CLUSTER_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: orderer
container_name: orderer6.example.com
networks:
- byfn
volumes:
- ./channel-artifacts/config_block.pb:/var/hyperledger/orderer/orderer.genesis.block
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer6.example.com/msp:/var/hyperledger/orderer/msp
- ./crypto-config/ordererOrganizations/example.com/orderers/orderer6.example.com/tls/:/var/hyperledger/orderer/tls
- orderer6.example.com:/var/hyperledger/production/orderer
ports:
- 13050:7050
最后,我使用以下命令运行orderer服务:
docker-compose -f orderer6.yaml up
容器启动,几秒钟后崩溃。容器的日志文件显示:
orderer6.example.com | 2020-01-07 09:03:12.363 UTC [orderer.common.cluster.replication] obtainStream -> INFO 03f Sending request for block [2] to orderer.example.com:7050
orderer6.example.com | 2020-01-07 09:03:12.365 UTC [orderer.common.cluster.replication] pullBlocks -> INFO 040 Got block [2] of size 47 KB from orderer.example.com:7050
orderer6.example.com | 2020-01-07 09:03:12.377 UTC [orderer.common.cluster] appendBlock -> PANI 041 Failed to write block [2]: unexpected Previous block hash. Expected PreviousHash = [1c99accab83de7a415061120831519badf4807c97a0195ab5f42bab979a7dc09], PreviousHash referred in the latest block= [37f11444fb0b1ca51419b5f1a95fab616d5179ed44a87716677f1b706c0b1854]
orderer6.example.com | panic: Failed to write block [2]: unexpected Previous block hash. Expected PreviousHash = [1c99accab83de7a415061120831519badf4807c97a0195ab5f42bab979a7dc09], PreviousHash referred in the latest block= [37f11444fb0b1ca51419b5f1a95fab616d5179ed44a87716677f1b706c0b1854]
orderer6.example.com |
orderer6.example.com | goroutine 1 [running]:
orderer6.example.com | github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc00014db80, 0x0, 0x0, 0x0)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/zapcore/entry.go:229 +0x546
orderer6.example.com | github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).log(0xc000010a58, 0xc00004ae04, 0x1548ed8, 0x1e, 0xc00030b458, 0x2, 0x2, 0x0, 0x0, 0x0)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:234 +0x101
orderer6.example.com | github.com/hyperledger/fabric/vendor/go.uber.org/zap.(*SugaredLogger).Panicf(...)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/vendor/go.uber.org/zap/sugar.go:159
orderer6.example.com | github.com/hyperledger/fabric/common/flogging.(*FabricLogger).Panicf(...)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/common/flogging/zap.go:74
orderer6.example.com | github.com/hyperledger/fabric/orderer/common/cluster.(*Replicator).appendBlock(0xc000089bc0, 0xc0002e4a80, 0x16b8760, 0xc00068d0e0, 0xc000571f60, 0x10)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/cluster/replication.go:253 +0x283
orderer6.example.com | github.com/hyperledger/fabric/orderer/common/cluster.(*Replicator).pullChannelBlocks(0xc000089bc0, 0xc000571f60, 0x10, 0xc00053e2a0, 0x3, 0x16b8760, 0xc00068d0e0, 0x0, 0x0)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/cluster/replication.go:221 +0xd8
orderer6.example.com | github.com/hyperledger/fabric/orderer/common/cluster.(*Replicator).PullChannel(0xc000089bc0, 0xc000571f60, 0x10, 0x0, 0x0)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/cluster/replication.go:207 +0x411
orderer6.example.com | github.com/hyperledger/fabric/orderer/common/cluster.(*Replicator).ReplicateChains(0xc000089bc0, 0xc00030ba88, 0x1, 0x1)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/cluster/replication.go:163 +0x3ed
orderer6.example.com | github.com/hyperledger/fabric/orderer/common/server.(*replicationInitiator).replicateNeededChannels(0xc000214180, 0xc00011ce00)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/onboarding.go:102 +0x19a
orderer6.example.com | github.com/hyperledger/fabric/orderer/common/server.(*replicationInitiator).replicateIfNeeded(0xc000214180, 0xc00011ce00)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/onboarding.go:48 +0x9a
orderer6.example.com | github.com/hyperledger/fabric/orderer/common/server.Start(0x15309fe, 0x5, 0xc000394900)
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/main.go:124 +0x11c8
orderer6.example.com | github.com/hyperledger/fabric/orderer/common/server.Main()
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/main.go:91 +0x208
orderer6.example.com | main.main()
orderer6.example.com | /opt/gopath/src/github.com/hyperledger/fabric/orderer/main.go:15 +0x20
orderer6.example.com exited with code 2
订购方的详细信息日志位于中
我的方法有什么问题?我使用了byfn网络作为我的测试平台,运行:
/byfn up-o etcdraft
装载到新Order容器的卷存在问题。它正在为新的订购者使用现有的卷,因为您可能一直在拉下“byfn.sh”脚本,然后再次使用它来启动网络 转到
docker compose
文件,该文件用于启动新的订购者节点。检查文件顶部的volumes
部分以及实际装入的容器定义中的内容:
卷:
order6.example.com:
及
-order6.example.com:/var/hyperledger/production/order
将正在创建和装入的卷的名称更改为全新名称。官方文件中提到的每一个步骤在此后都很有效