gpt4 book ai didi

hyperledger - 启动 super 账本 fabcar 示例应用程序时出错

转载 作者:行者123 更新时间:2023-12-04 02:47:31 25 4
gpt4 key购买 nike

我正在尝试从 http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html 安装 hyperledger-fabric 示例应用程序

我收到类似于此处提到的帖子的错误:hyperledger fabric fabcar error

2017-08-24 07:47:16.826 UTC [grpc] Printf -> DEBU 005 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 172.18.0.5:7051: getsockopt: connection refused"; Reconnecting to {peer0.org1.example.com:7051 <nil>}
Error: Error getting endorser client channel: PER:404 - Error trying to connect to local peer

以下是 docker logs peer0.org1.example.com 的日志, 显然 peer 无法连接到 couchdb
2017-08-24 07:47:03.728 UTC [couchdb] handleRequest -> DEBU 011 HTTP Request: GET / HTTP/1.1 | Host: couchdb:5984 | User-Agent: Go-http-client/1.1 | Accept: multipart/related | Accept-Encoding: gzip |  |
2017-08-24 07:47:04.073 UTC [couchdb] handleRequest -> WARN 012 Retrying couchdb request in 125ms. Attempt:1 Error:Get http://couchdb:5984/: dial tcp 109.234.109.83:5984: getsockopt: connection refused
2017-08-24 07:47:04.199 UTC [couchdb] handleRequest -> DEBU 013 HTTP Request: GET / HTTP/1.1 | Host: couchdb:5984 | User-Agent: Go-http-client/1.1 | Accept: multipart/related | Accept-Encoding: gzip | |
2017-08-24 07:47:04.385 UTC [couchdb] handleRequest -> WARN 014 Retrying couchdb request in 250ms. Attempt:2 Error:Get http://couchdb:5984/: dial tcp 109.234.109.77:5984: getsockopt: connection refused

我可以看到端口 5984 上的监听套接字

来自 docker exec -it couchdb bash
docker exec -it couchdb bash
couchdb@57c8996a4ba6:~$ netstat -ntulpa
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:5984 0.0.0.0:* LISTEN 6/beam.smp
tcp 0 0 127.0.0.1:5986 0.0.0.0:* LISTEN 6/beam.smp
tcp 0 0 127.0.0.11:43471 0.0.0.0:* LISTEN -
udp 0 0 127.0.0.11:52081 0.0.0.0:* -

从没有 docker 的命令 shell
# netstat -ntulpa | grep 5984
tcp6 0 0 :::5984 :::* LISTEN 12877/docker-proxy

为什么 peer 无法连接到 couchdb?

最佳答案

根据评论,我认为您的主机系统配置为使用自动解析未知主机名的 DNS 搜索域。您可能需要修改 基本网络/docker-compose.yml 并添加 dns_search: .作为对等方的配置值:

peer0.org1.example.com:
container_name: peer0.org1.example.com
image: hyperledger/fabric-peer:x86_64-1.0.0
dns_search: .
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_PEER_ID=peer0.org1.example.com
- CORE_LOGGING_PEER=debug
- CORE_CHAINCODE_LOGGING_LEVEL=DEBUG
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
# # the following setting starts chaincode containers on the same
# # bridge network as the peers
# # https://docs.docker.com/compose/networking/
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${COMPOSE_PROJECT_NAME}_basic
- CORE_LEDGER_STATE_STATEDATABASE=CouchDB
- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb:5984
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: peer node start
# command: peer node start --peer-chaincodedev=true
ports:
- 7051:7051
- 7053:7053
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/msp/peer
- ./crypto-config/peerOrganizations/org1.example.com/users:/etc/hyperledger/msp/users
- ./config:/etc/hyperledger/configtx
depends_on:
- orderer.example.com
networks:
- basic

关于hyperledger - 启动 super 账本 fabcar 示例应用程序时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45856564/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com