CouchDB 拨号TCP 172.28.0.4:5983:获取套接字选项:连接被拒绝

uqxowvwt  于 2022-12-09  发布在  CouchDB
关注(0)|答案(1)|浏览(133)

我正在使用fabric-dev-servers和docker-compose创建一个网络并安装一个名片,但是当我执行./startFabric.sh时,在启动网络结束时出现以下错误。

2020-05-18 07:29:59.593 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2020-05-18 07:29:59.595 UTC [grpc] Printf -> DEBU 003 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 172.28.0.5:7051: getsockopt: connection refused"; Reconnecting to {peer0.org1.example.com:7051 <nil>}
2020-05-18 07:30:00.596 UTC [grpc] Printf -> DEBU 004 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 172.28.0.5:7051: getsockopt: connection refused"; Reconnecting to {peer0.org1.example.com:7051 <nil>}
2020-05-18 07:30:02.302 UTC [grpc] Printf -> DEBU 005 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp 172.28.0.5:7051: getsockopt: connection refused"; Reconnecting to {peer0.org1.example.com:7051 <nil>}
Error: Error getting endorser client channel: endorser client failed to connect to peer0.org1.example.com:7051: failed to create new connection: context deadline exceeded

当我做docker logs peer0.org1.example.com
我得到以下日志

2020-05-18 07:29:15.885 UTC [couchdb] handleRequest -> DEBU 023 HTTP Request: GET / HTTP/1.1 | Host: couchdb:5983 | User-Agent: Go-http-client/1.1 | Accept: multipart/related | Accept-Encoding: gzip |  | 
2020-05-18 07:29:15.886 UTC [couchdb] handleRequest -> WARN 024 Retrying couchdb request in 16s. Attempt:8  Error:Get http://couchdb:5983/: dial tcp 172.28.0.4:5983: getsockopt: connection refused
2020-05-18 07:29:31.887 UTC [couchdb] handleRequest -> DEBU 025 HTTP Request: GET / HTTP/1.1 | Host: couchdb:5983 | User-Agent: Go-http-client/1.1 | Accept: multipart/related | Accept-Encoding: gzip |  | 
2020-05-18 07:29:31.888 UTC [couchdb] handleRequest -> WARN 026 Retrying couchdb request in 32s. Attempt:9  Error:Get http://couchdb:5983/: dial tcp 172.28.0.4:5983: getsockopt: connection refused
2020-05-18 07:30:03.889 UTC [couchdb] handleRequest -> DEBU 027 HTTP Request: GET / HTTP/1.1 | Host: couchdb:5983 | User-Agent: Go-http-client/1.1 | Accept: multipart/related | Accept-Encoding: gzip |  | 
2020-05-18 07:30:03.890 UTC [couchdb] handleRequest -> WARN 028 Retrying couchdb request in 1m4s. Attempt:10  Error:Get http://couchdb:5983/: dial tcp 172.28.0.4:5983: getsockopt: connection refused
2020-05-18 07:31:07.891 UTC [couchdb] handleRequest -> DEBU 029 HTTP Request: GET / HTTP/1.1 | Host: couchdb:5983 | User-Agent: Go-http-client/1.1 | Accept: multipart/related | Accept-Encoding: gzip |  | 
2020-05-18 07:31:07.893 UTC [couchdb] handleRequest -> WARN 02a Retrying couchdb request in 2m8s. Attempt:11  Error:Get http://couchdb:5983/: dial tcp 172.28.0.4:5983: getsockopt: connection refused

这是hlfv 11的docker-compose.yml

version: '2'

services:
  ca.org1.example.com:
    image: hyperledger/fabric-ca:$ARCH-1.1.0
    environment:
      - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
      - FABRIC_CA_SERVER_CA_NAME=ca.org1.example.com

    ports:
      - "7054:7054"
    command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/19ab65abbb04807dad12e4c0a9aaa6649e70868e3abd0217a322d89e47e1a6ae_sk -b admin:adminpw -d'
    volumes:
      - ./crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
    container_name: ca.org1.example.com

  orderer.example.com:
    container_name: orderer.example.com
    image: hyperledger/fabric-orderer:$ARCH-1.1.0
    environment:
      - ORDERER_GENERAL_LOGLEVEL=debug
      - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
      - ORDERER_GENERAL_GENESISMETHOD=file
      - ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/composer-genesis.block
      - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
      - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/msp/orderer/msp
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: orderer
    ports:
      - 7050:7050
    volumes:
        - ./:/etc/hyperledger/configtx
        - ./crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/etc/hyperledger/msp/orderer/msp

  peer0.org1.example.com:
    container_name: peer0.org1.example.com
    image: hyperledger/fabric-peer:$ARCH-1.1.0
    dns_search: .
    environment:
      - CORE_LOGGING_LEVEL=debug
      - GODEBUG=netdns=go 
      - CORE_CHAINCODE_LOGGING_LEVEL=DEBUG
      - CORE_LOGGING_PEER=debug # addition
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      - CORE_PEER_ID=peer0.org1.example.com
      - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
      - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=composer_default
      - CORE_PEER_LOCALMSPID=Org1MSP
      - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/peer/msp
    #  - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=hlfv11_basic
      - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
      - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb:5983
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric
    command: peer node start
    ports:
      - 7051:7051
      - 7053:7053
    volumes:
        - /var/run/:/host/var/run/
        - ./:/etc/hyperledger/configtx
        - ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/peer/msp
        - ./crypto-config/peerOrganizations/org1.example.com/users:/etc/hyperledger/msp/users
    depends_on:
      - orderer.example.com
      - couchdb
    #networks:
    #  - basic

  couchdb:
    container_name: couchdb
    image: hyperledger/fabric-couchdb:$ARCH-0.4.6
    ports:
      - 5983:5983
    environment:
      DB_URL: http://localhost:5983/member_db

我尝试了所有可能的解决方案,但仍然不工作,请帮助。

mfpqipee

mfpqipee1#

尚未在对等服务中定义couchdb用户名和密码

- CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=
      - CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=

相关问题