fabric 多機部署1.0

參照深藍大神的步驟來的:https://www.cnblogs.com/studyzy/p/7237287.html

出現的問題:

1.各個機器之間連接不到,原因是centos防火牆開啓,各個虛擬機之間不能訪問,關閉防火牆命令爲:

 $ systemctl stop firewalld.service
 $systemctl disable firewalld.service 
關閉之後docker需要重新啓動一下


2.有一臺機器安裝鏈碼後容器會報錯,原因是docker-image版本使用的1.1.0,其他的都是1.0,

    修改後這臺機器要重新連接到fabric網絡,連接方法爲:

    1)從其他機器(peer0.org1機器)拷貝mychannel.block到這臺機器的cli 容器中

  2)執行加入通道的命令,然後就OK了,正常加入網絡

過程中還有其他的問題,都好像不是很難處理,忘掉了

備註一些用到的命令

cp -rf /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/ordererOrganizations/example.com/msp/tlscacerts  fabric-ca-files/example.com/msp/
cp -rf /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/peerOrganizations/org1.example.com/msp/tlscacerts/ fabric-ca-files/org1.example.com/msp/
cp -rf /opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/crypto-config/peerOrganizations/org2.example.com/msp/tlscacerts/ fabric-ca-files/org2.example.com/msp/



fabric-ca-client register --id.name [email protected] --id.type client --id.affiliation "com.example.org1" --id.attrs '"hf.Registrar.Roles=client,orderer,peer,user","hf.Registrar.DelegateRoles=client,orderer,peer,user", hf.Registrar.Attributes=*,hf.GenCRL=true,hf.Revoker=true,hf.AffiliationMgr=true,hf.IntermediateCA=true,role=admin:ecert'


/root/fabric-deploy/fabric-ca-files/org1.example.com/msp
cp -rf /root/fabric-deploy/fabric-ca-files/example.com/orderer/msp orderer.example.com/
cp -rf /root/fabric-deploy/fabric-ca-files/org1.example.com/peer0/msp  peer0.org1.example.com/


example.com/msp/tlscacerts
ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/msp/tlscacerts/tlsca.example.com-cert.pem



systemctl start docker
export GOPATH=/data/gopath
cd /data/gopath/src/github.com/hyperledger/fabric/
git checkout v1.0.0
git branch

docker tag hyperledger/fabric-tools:x86_64-1.0.0 hyperledger/fabric-tools:latest
docker tag hyperledger/fabric-orderer:x86_64-1.0.0 hyperledger/fabric-orderer:latest
docker tag hyperledger/fabric-peer:x86_64-1.0.0 hyperledger/fabric-peer:latest
docker tag hyperledger/fabric-javaenv:x86_64-1.0.0 hyperledger/fabric-javaenv:latest
docker tag hyperledger/fabric-ccenv:x86_64-1.0.0 hyperledger/fabric-ccenv:latest
docker tag hyperledger/fabric-ca:x86_64-1.0.0 hyperledger/fabric-ca:latest


yum install -y libtool-ltdl* 

make configtxgen
cd examples/e2e_cli/
./network_setup.sh up
./network_setup.sh down

cd ../
rm -rf e2e_cli
cp -rf e2e_cli/* e2e_cli2
scp -r e2e_cli [email protected]:/opt/gopath/src/github.com/hyperledger/fabric/examples
scp -r e2e_cli [email protected]:/data/gopath/src/github.com/hyperledger/fabric/examples
scp -r e2e_cli [email protected]:/data/gopath/src/github.com/hyperledger/fabric/examples
scp -r e2e_cli [email protected]:/data/gopath/src/github.com/hyperledger/fabric/examples

   - "orderer.example.com:192.168.12.82"
   - "peer0.org1.example.com:192.168.12.54"
   - "peer1.org1.example.com:192.168.12.64"
   - "peer0.org2.example.com:192.168.12.63"
   - "peer1.org2.example.com:192.168.12.231"

   scp -r /data/mychannel.block [email protected]:/opt/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章