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 Admin@example.com --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 root@192.168.12.231:/opt/gopath/src/github.com/hyperledger/fabric/examples
scp -r e2e_cli root@192.168.12.54:/data/gopath/src/github.com/hyperledger/fabric/examples
scp -r e2e_cli root@192.168.12.64:/data/gopath/src/github.com/hyperledger/fabric/examples
scp -r e2e_cli root@192.168.12.63:/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 root@192.168.12.231:/opt/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值