在执行"network.sh up"之后的几秒钟内,订购者节点退出.命令 [英] Orderer node exits within few seconds after execution of "network.sh up" command

查看:317
本文介绍了在执行"network.sh up"之后的几秒钟内,订购者节点退出.命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从授权文档中学习超级账本结构,并按照此处给出的步骤进行操作.

I am learning hyperledger fabric from the authorized documentation and following the steps given here.

我按照说明按照以下步骤安装和运行示例应用程序.

I followed following steps as per documentation to install and run sample applications.

  1. 按照文档安装了所有先决条件.
  2. https://github.com/hyperledger/fabric-samples 上的克隆github存储库
  3. 按照readme.md文件中提到的命令运行
  4. bootstrap.sh脚本(不提供任何特定版本作为命令行参数,以为它将安装正确的最新版本).此命令将所有二进制文件下载到bin文件夹中.
  5. 在test-network文件夹下执行sudo ./network.sh up命令.结果表明启动了2个对等节点和1个订购者节点.
  1. Installed all prerequisites as per the documentation.
  2. Cloned github respository from https://github.com/hyperledger/fabric-samples.
  3. Ran bootstrap.sh script as per commands mentioned in the readme.md file (without giving any specific version as command-line parameters thinking that it will install correct latest versions). This command downloaded all binaries in the bin folder.
  4. Executed sudo ./network.sh up command under test-network folder. It showed that 2 peer nodes and 1 orderer node started.

但是,当我尝试使用./network.sh createChannel创建频道时,却给我错误

However, when I tried to create channel using ./network.sh createChannel, it gave me error as

错误:无法创建传递客户端:订购客户端无法连接到本地主机:7050:无法创建新连接:连接错误:desc =传输:拨号时出错:拨打tcp 127.0.0.1:7050:连接:连接拒绝" !!!!!!!!!!!!!!!!!!频道创建失败!!!!!!!!!!!!!!!! =========错误!!!失败执行End-2-End方案============ 错误 !!!创建频道失败

Error: failed to create deliver client: orderer client failed to connect to localhost:7050: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 127.0.0.1:7050: connect: connection refused" !!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!! ========= ERROR !!! FAILED to execute End-2-End Scenario =========== Error !!! Create channel failed

所以,当我使用docker ps -a检查节点的状态时,它给出了以下输出.

So, when I checked the status of nodes using docker ps -a, it gave me following output.

容器ID图像命令创建的状态端口名称

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

978968f8e11e hyperledger/fabric-peer:最新的对等节点启动"大约一分钟前大约一分钟0.0.0.0:9051->9051/tcp peer0.org2.example.com

978968f8e11e hyperledger/fabric-peer:latest "peer node start" About a minute ago Up About a minute 0.0.0.0:9051->9051/tcp peer0.org2.example.com

89914237b249 hyperledger/fabric-orderer:latest"orderer"大约一分钟前退出(2)大约一分钟前orderer.example.com

7e79abb2aefa hyperledger/fabric-peer:latest"peer node start"大约一分钟前大约一分钟0.0.0.0:7051->7051/tcp peer0.org1.example.com

7e79abb2aefa hyperledger/fabric-peer:latest "peer node start" About a minute ago Up About a minute 0.0.0.0:7051->7051/tcp peer0.org1.example.com

0fa38487cdf4 hello-world"/hello" 4小时前退出(0)4小时前brave_galileo

0fa38487cdf4 hello-world "/hello" 4 hours ago Exited (0) 4 hours ago brave_galileo

每当我尝试执行network.sh命令-

LOCAL_VERSION = 1.4.4 基本图片0.4.18

LOCAL_VERSION=1.4.4 Base Image0.4.18

DOCKER_IMAGE_VERSION = 1.4.4

DOCKER_IMAGE_VERSION=1.4.4

===================警告=================

=================== WARNING ===================

本地结构二进制文件和docker映像不同步.这可能会引起问题.

Local fabric binaries and docker images are out of sync. This may cause problems.

================================================

===============================================

我不知道在哪里检查哪些二进制文件适用于哪些docker映像.

I do not know where to check which binaries are applicable to which docker images.

我尝试了几种方法来使订购者节点保持活动状态,从头开始做所有事情,为结构样本下的所有文件夹提供权限,network.sh的向下排序,重新启动network.sh以及我认为的其他几种方法,但仍然无法使订购者节点保持活动状态.

I tried several ways to keep orderer node alive by doing everything from scratch, giving permissions to all the folder under fabric-samples, down-up sequence of network.sh, restarting the network.sh and few more that I can think of, but still I am not able to keep orderer node alive.

我还注意到文档中提到了该声明, 将特定版本的Hyperledger Fabric平台二进制文件和配置文件安装到fabric-samples的/bin和/config目录中

Also I noticed that the statement is mentioned in the documentation that Install the Hyperledger Fabric platform-specific binaries and config files for the version specified into the /bin and /config directories of fabric-samples

但是,我在给定的github存储库下找不到任何bin和config文件夹.

However, I did not find any bin and config folder under the given github repository.

推荐答案

经过大量的尝试和错误尝试,我终于可以使它工作了.

After lots of trial and error attempts, I could finally make it work.

首先,我使用以下命令重新安装了fabric-sample项目,并确保我具有正确的二进制文件和docker映像(而不是选择最新的东西)-

First of all, I reinstalled the fabric-sample project using following command and made sure that I have correct binaries and docker images (rather than picking up everything latest) -

# Fetch bootstrap.sh from fabric repository using
curl -sS https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh -o ./scripts/bootstrap.sh
# Change file mode to executable
chmod +x ./scripts/bootstrap.sh
# Download binaries and docker images - **check out the version below**
./scripts/bootstrap.sh 1.4.4 -s

有了这个,我可以摆脱与不同步的本地结构二进制文件和docker映像相关的警告.

With this, I could get rid of warnings that I was getting related to out of sync local fabric binaries and docker images.

之后,我尝试按照以下故障排除步骤将我带到问题区域-

After that, I tried following troubleshooting steps which led me to the problem area -

  1. 我执行了所有上述./network.sh命令,但未能使订购者节点保持活动状态.

  1. I performed all the above ./network.sh commands but failed to keep orderer node alive.

我决定在命令提示符下手动执行每个network.sh命令,因为该命令顺序出现在脚本中.这样,我发现checkPrereqscreateOrgs函数没有问题. CreateOrgs功能在两种方法上都成功-使用密码原工具和使用CA.

I decided to execute each network.sh command manually on command-prompt as it comes in the script sequentially. With this, I saw that there is no issue with checkPrereqs and createOrgs functions. CreateOrgs function becomes successful both ways - using cryptogen tool and using CA.

我注释了createConsortium函数并执行了./network.sh up命令,该命令使订购者节点保持活动状态.

I commented out createConsortium function and executed ./network.sh up command which kept orderer node alive.

发现,由于某些原因,createConsortium试图在 system-genesis-block 文件夹下生成创世块,而不是生成名称为 genesis-block的文件,由于该configtxgen命令失败,因此存在一个名为 genesis-block 的只读文件夹.

Found out that createConsortium tries to generate genesis block under system-genesis-block folder and because of some reason, rather than generating file with the name genesis-block, there was the read-only folder named genesis-block due to which configtxgen command was failing.

因此,我取消了对该块的只读权限,并删除了 genesis-block 文件夹,并在取消对createConsortium函数的注释后重新运行了./network.sh down./network.sh up命令.导致生成了创世块 file 而不是 folder ,因此,最后,我可以设法使订购者节点保持活动状态.

Thus, I removed read-only permissions from this block and deleted the genesis-block folder and re-run ./network.sh down and ./network.sh up command after un-commenting createConsortium function, which resulted in the generation of a genesis block file rather than folder and thus, finally, I could manage to keep orderer node alive.

此后,我可以使用以下命令成功创建频道.

After this, I could successfully create channel using following command.

./network.sh createChannel

这篇关于在执行"network.sh up"之后的几秒钟内,订购者节点退出.命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆