无法订购交易。错误代码:SERVICE_UNAVAILABLE(使用筏式共识协议)

时间:2019-08-12 13:13:43

标签: hyperledger-fabric hyperledger raft

我在使用Raft共识协议时遇到此错误,在该协议中,我设置了5个订购者(第1个服务器中有1个,其他2个服务器中有2个),即orderer1到orderer5。 一切都可以通过设置正常进行,所有订购者都参与了订购者选举过程,但是当我尝试调用事务时,却遇到了这样的错误:

[ERROR] invoke-chaincode - Failed to order the transaction. Error code: SERVICE_UNAVAILABLE

仅当我尝试使用orderer2调用但与其他任何orderer一起使用时,才会出现此错误。请帮助解决问题。

这是orderer2及其运行的日志:

2019-08-13 07:05:59.374 UTC [orderer.consensus.etcdraft] run -> INFO 318 raft.node: 2 elected leader 4 at term 2 channel=invoice node=2
2019-08-13 07:05:59.375 UTC [orderer.consensus.etcdraft] serveRequest -> INFO 319 Raft leader changed: 0 -> 4 channel=invoice node=2
2019-08-13 07:05:59.580 UTC [common.deliver] Handle -> WARN 31a Error reading from xx.xx.xx.xx:56890: rpc error: code = Canceled desc = context canceled
2019-08-13 07:05:59.580 UTC [comm.grpc.server] 1 -> INFO 31b streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=xx.xx.xx.xx:56890 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=207.535623ms
2019-08-13 07:13:20.952 UTC [orderer.common.broadcast] ProcessMessage -> WARN 320 [channel: invoice] Rejecting broadcast of normal message from xx.xx.xx.xx:56916 with SERVICE_UNAVAILABLE: rejected by Order: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp 192.168.224.4:8050: connect: connection refused"
2019-08-13 07:13:20.952 UTC [comm.grpc.server] 1 -> INFO 321 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=xx.xx.xx.xx:56916 grpc.code=OK grpc.call_duration=35.477429971s

1 个答案:

答案 0 :(得分:0)

我也遇到了这个问题,orderer2也是如此。事实证明,我在订购者配置中输入了错字。在General.Cluster部分中,我不小心将ClientCertificate和ClientPrivateKey字段重命名为ServerCertificate和ServerPrivateKey。我切换了它们,将Server *值留为空白,并与其他证书指向我的客户端证书,一切正常。