我正在尝试为Hyperledger Fabric节点设置多主机,一个组织设置。我想在没有Swarm编排器的不同基于AWS的计算机上启动两个节点。由于在多个组织设置中群集集中化的潜在问题,我想避免Swarm。我正在从官方文档调整BYFN设置。目前,我最大的问题是频道创建过程中的问题。用
启动频道后 peer channel create -o orderer.mydomain.io:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/mydomain.io/orderers/orderer.mydomain.io/msp/tlscacerts/tlsca.mydomain.io-cert.pem
我收到以下消息:Error: got unexpected status: FORBIDDEN -- implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Writers' sub-policies to be satisfied: permission denied
。同时docker logs <orderer container id>
命令显示Principal deserialization failure (the supplied identity is not valid: x509: certificate signed by unknown authority) for identity 0
。 如何在Hyperledger中为至少两个独立的节点实现无群的多主机配置?在主机网络模式下运行是否需要其他变量或专用设置?
要实现无群配置,我准备了以下配置:
network_mode:
host
中运行。network_mode: host
中的peer1。host
网络,并在docker network inspect host
中可见。docker-compose.yaml中的CA定义
ca0:
image: hyperledger/fabric-ca:$IMAGE_TAG
network_mode: host
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca-org1
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.mydomain.io-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/${MYNETWORK_CA1_PRIVATE_KEY}
- FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.mydomain.io-cert.pem
- FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/${MYNETWORK_CA1_PRIVATE_KEY}
- FABRIC_CA_SERVER_PORT=7054
ports:
- "7054:7054"
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server/ca.org1.mydomain.io-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server/${MYNETWORK_CA1_PRIVATE_KEY} -b admin:adminpw -d'
volumes:
- ./crypto-config/peerOrganizations/org1.mydomain.io/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca.org1.mydomain.io