Docker-compose

本文探讨了DockerCompose如何通过YAML文件定义容器间的依赖关系,特别关注于Fabric网络环境中排序服务与Peer节点的配置。同时,文章列举了DockerCompose的常用命令,并分析了在Fabric操作中常见的权限不足错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Compose采用 YAML文件定义 Docker容器之间的依赖,设置环境变量和文件的持久 化。 我们看一个配置文件examples/e2e_cli/base/docker-compose-base.yaml的节选:

  • 在这个节选的配置文件中,一共定义了 l 个排 序服务节点 orderer.example.com 和 l 个 Peer节点 peerO.orgI.example.com。 Docker Compose 目前有 3个版本,这个配置文件采用 的 version 2 的语法,配置文件的解释如表 2-2 所示

  • Docker Compose 的常用命令

Docker Compose 的常用命令如表 2-3 所示 。

  • 常见错误

1. 请求调用者权限不足

调用的时候设置了错误的 MSP,比如需要管理员才能执行创建通道的操作,但是设置了普通的成员 MSP,会出现 Error: Got unexpected status: BAD_REQUEST 的错误 :

2017-08-09 14:49:04.652 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2017-08-09 14:49:04.652 UTC [msp) GetDefaultSigningidentity -> DEBU 002 Obtaining default signing identity
2017-08-09 14:49:04.654 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2017-08-09 14:49:04.656 UTC [msp) GetLocalMSP -> DEBU 004 Returning existing local MSP
2017-08-09 14:49:04.656 UTC [msp) GetDefaultSigningidentity -> DEBU 005 Obtaining default signing identity
2017-08-09 14:49:04.657 UTC [msp] GetLocalMSP -> DEBU 006 Returning existing local MSP
2017-08-09 14:49:04.657 UTC [msp] GetDefaultSigning工dentity -> DEBU 007 Obtaining default signing identity
2017-08-09 14:49:04.657 UTC (msp/identity] Sign -> DEBU 008 Sign: plaintext: OA8 8060A074F7267314D535012FC052D ••• 53616D706C65436F6E736F727469756D
2017-08-09 14:49:04.657 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: F77320 AE89Bl31CE75A858A4A450CFOF35301DA62FE1DE465CAEF4439F6FC520
2017-08-09 14:49:04.657 UTC (msp) GetLocalMSP -> DEBU OOa Returning existing local MSP
2017-08-09 14:49:04.657 UTC (msp) GetDefaultSigningidentity -> DEBU OOb Obtaining default signing identity
2017-08-09 14:49:04.657 UTC (msp) GetLocalMSP -> DEBU OOc Returning existing local MSP
2017-08-09 14:49:04.657 UTC [msp) GetDefaultSigningidentity -> DEBU OOd Obtaining default signing identity
2017-08-09 14:49:04.657 UTC [msp/identity] Sign -> DEBU OOe Sign: plaintext: OAB F060Al508021A0608EOD591D00522 ••• A38A58EED7B94AC4CB800B86FOA5EF03
2017-08-09 14:49:04.658 UTC (msp/identity] Sign -> DEBU OOf Sign: digest: 475A33 426F A36D50F090A AF7C3A A AB2BF34339191BA74D4A60BF13460B241329
Error: Got unexpected status: BAD_REQUEST
Usage:
peer channel create [flags]
Flags:
-c, --channelID string In case of a newChain command, the channel ID to create.
-f, --file string Configuration transaction file generated by a tool such as configtxgen for submitting to orderer
-t, --timeout int Channel creation timeout (default 5)
Global Flags:
--cafile string Path to file containing FEM-encoded trusted certificate(s) for the ordering endpoint
--logging-level string
core.yaml for full syntax
-o, --orderer string --test.coverprofile --tls
Ordering service endpoint
-v, --version
peer chaincode query -C myc -n mycc -v vO -c '{”Args":[”query”,”a”]}· 会出现如下错误:
Default logging level and overrides, see
string
Use TLS when communicating with the orderer endpoint Display current version of fabric peer server

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值