首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在多台主机上虚拟化hyperledger网络问题

在多台主机上虚拟化hyperledger网络问题
EN

Stack Overflow用户
提问于 2019-07-25 15:31:59
回答 1查看 193关注 0票数 0

我已经跟随并完成了本教程

https://medium.com/@malliksarvepalli/hyperledger-fabric-1-2-on-multiple-hosts-using-docker-swarm-and-compose-11c13635e69e

我已经连接了3台主机,所有的服务都在运行。在PC2主机中运行./script.sh时,我得到了正确的结果。现在我正在学习下一个教程,它是:

https://medium.com/@malliksarvepalli/hyperledger-explorer-with-fabric-1-2-running-on-multiple-hosts-89c5af691b7e

有没有人可以在这篇教程中给我一些启发?我已经知道我应该用ubuntu 16.04创建一个新的主机,并安装以下必备软件:

nodejs 8.11.x

PostgreSQL 9.5或更高版本

Jq

我说的对吗?

在exploreconfig.json中,我更新了postgres变量:

主机:192.168.1.136(第四个虚拟机ip),端口:5432,用户名:postgres,密码:psql,数据库:fabric

他们是正确的吗?

我还修改了config.json文件中的Orderer、Org1 [peer0 & peer1)、Org2(peer0 & peer1) IP地址和网络已启动并运行的前三个Vms的IP地址。

并遵循rest说明和测试,但是当我运行命令./start.sh时,我在控制台中有日志,这些日志是:

代码语言:javascript
复制
false 'ssl-certs' '/home/database/blockchain-explorer/ssl-certs'

postgres://christy:christy@192.168.1.136:5432/fabric

error when connecting to db: { Error: connect ECONNREFUSED 192.168.1.136:5432

at Object._errnoException (util.js:992:11)

at _exceptionWithHostPort (util.js:1014:20)

at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)

code: 'ECONNREFUSED',

errno: 'ECONNREFUSED',

syscall: 'connect',

address: '192.168.1.136',

port: 5432 }

******* Initialization started for hyperledger fabric platform ******, { 

'network-1': 

 { version: '1.0',

 clients: { 'client-1': [Object] },

 channels: { mychannel: [Object] },

 organizations: { Org1MSP: [Object], Org2MSP: [Object], OrdererMSP: 
 [Object] },

  peers: 

   { 'peer0.org1.ntua.com': [Object],

    'peer1.org1.ntua.com': [Object],

    'peer0.org2.ntua.com': [Object],

    'peer1.org2.ntua.com': [Object] },

    orderers: { 'orderer.ntua.com': [Object] } },

    'network-2': {} }

   client_configs.name  undefined  client_configs.profile  undefined

   FabricUtils.createFabricClient 

   <<<<<<<<<<<<<<<<<<<<<<<<<< Explorer Error >>>>>>>>>>>>>>>>>>>>>

   Error :  [ 'Invalid platform configuration, Please check the log' ]

   error when connecting to db: TypeError: Cannot read property 'on' of 
   undefined

  at Timeout.handleDisconnect [as _onTimeout] (/home/database/blockchain-

  explorer/app/persistence/postgreSQL/PgService.js:68:16)

  at ontimeout (timers.js:498:11)

  at tryOnTimeout (timers.js:323:5)

  at Timer.listOnTimeout (timers.js:290:5)


  <<<<<<<<<<<<<<<<<<<<<<<<<< Explorer Error >>>>>>>>>>>>>>>>>>>>>

  TypeError: "callback" argument must be a function

  at setTimeout (timers.js:450:11)

  at Timeout.handleDisconnect [as _onTimeout] (/home/database/blockchain-

  explorer/app/persistence/postgreSQL/PgService.js:85:5)

  at ontimeout (timers.js:498:11)

  at tryOnTimeout (timers.js:323:5)

  at Timer.listOnTimeout (timers.js:290:5)

  Received kill signal, shutting down gracefully

  Closed out connections

  false 'ssl-certs' '/home/database/blockchain-explorer/ssl-certs'

   postgres://christy:christy@192.168.1.136:5432/fabric

   error when connecting to db: { Error: connect ECONNREFUSED 192.168.1.136:5432

   at Object._errnoException (util.js:992:11)

   at _exceptionWithHostPort (util.js:1014:20)

   at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)

   code: 'ECONNREFUSED',

   errno: 'ECONNREFUSED',

   syscall: 'connect',

   address: '192.168.1.136',

   port: 5432 }


   ******* Initialization started for hyperledger fabric platform ******, 
  { 

  'network-1': 

  { version: '1.0',

   clients: { 'client-1': [Object] },

   channels: { mychannel: [Object] },

   organizations: { Org1MSP: [Object], Org2MSP: [Object], OrdererMSP: 

   [Object] },

   peers: 

   { 'peer0.org1.ntua.com': [Object],

     'peer1.org1.ntua.com': [Object],

     'peer0.org2.ntua.com': [Object],

     'peer1.org2.ntua.com': [Object] },

    orderers: { 'orderer.ntua.com': [Object] } },

    'network-2': {} }

    client_configs.name  undefined  client_configs.profile  undefined

    FabricUtils.createFabricClient 

    <<<<<<<<<<<<<<<<<<<<<<<<<< Explorer Error >>>>>>>>>>>>>>>>>>>>>

    Error :  [ 'Invalid platform configuration, Please check the log' ]

    error when connecting to db: TypeError: Cannot read property 'on' of 
    undefined

   at Timeout.handleDisconnect [as _onTimeout] (/home/database/blockchain-

   explorer/app/persistence/postgreSQL/PgService.js:68:16)

   at ontimeout (timers.js:498:11)

   at tryOnTimeout (timers.js:323:5)

   at Timer.listOnTimeout (timers.js:290:5)

   <<<<<<<<<<<<<<<<<<<<<<<<<< Explorer Error >>>>>>>>>>>>>>>>>>>>>

   TypeError: "callback" argument must be a function

   at setTimeout (timers.js:450:11)

   at Timeout.handleDisconnect [as _onTimeout] (/home/database/blockchain-

   explorer/app/persistence/postgreSQL/PgService.js:85:5)

   at ontimeout (timers.js:498:11)

   at tryOnTimeout (timers.js:323:5)

   at Timer.listOnTimeout (timers.js:290:5)

   Received kill signal, shutting down gracefully

   Received kill signal, shutting down gracefully

   Closed out connections

如果还需要其他日志,请让我知道。任何帮助都是有帮助的。非常感谢。

EN

回答 1

Stack Overflow用户

发布于 2019-07-31 15:46:48

我可以给你提供一些在你的环境中需要检查的方面。

  • 首先,你需要检查你是否能够从你试图启动Hyperledger Explorer的虚拟机访问postgresql (第四个虚拟机)。如果没有,您需要更改postgres配置(postgresql.conf/pg_hba.conf)以启用外部访问。

$ sudo -u postgres psql -h 192.168.1.136 -d fabric -c 'table peer‘

  • 第二,请确认您确实在第4个虚拟机上运行了./createdb.sh。如果更改了数据库名称,还需要对齐脚本

$ cd app/persistence/fabric/postgreSQL/db/

$ ./createdb.sh

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57196569

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档