紧急:初始化分类帐提供程序时出错:无法连接到CouchDB,请检查主机名和端口:获取http:// couchdb1:5984 /:EOF

问题描述 投票:0回答:1

我正在尝试使用docker-compose在Linux(RHEL 7)计算机中启动超级账本结构网络。但是,对等容器将在一段时间后退出。在peer容器日志中,我可以看到以下错误。

2020-02-20 02:25:29.963 UTC [nodeCmd] serve -> INFO 001 Starting peer:
 Version: 1.4.4
 Commit SHA: 7917a40
 Go version: go1.12.12
 OS/Arch: linux/amd64
 Chaincode:
  Base Image Version: 0.4.18
  Base Docker Namespace: hyperledger
  Base Docker Label: org.hyperledger.fabric
  Docker Namespace: hyperledger
2020-02-20 02:25:29.964 UTC [ledgermgmt] initialize -> INFO 002 Initializing ledger mgmt
2020-02-20 02:25:29.964 UTC [kvledger] NewProvider -> INFO 003 Initializing ledger provider
2020-02-20 02:25:30.032 UTC [kvledger] NewProvider -> INFO 004 ledger provider Initialized
2020-02-20 02:25:30.200 UTC [couchdb] handleRequest -> WARN 005 Retrying couchdb request in 125ms. Attempt:1  Error:Get http://couchdb1:5984/: EOF
2020-02-20 02:25:30.386 UTC [couchdb] handleRequest -> WARN 006 Retrying couchdb request in 250ms. Attempt:2  Error:Get http://couchdb1:5984/: EOF
2020-02-20 02:25:30.689 UTC [couchdb] handleRequest -> WARN 007 Retrying couchdb request in 500ms. Attempt:3  Error:Get http://couchdb1:5984/: EOF
2020-02-20 02:25:31.241 UTC [couchdb] handleRequest -> WARN 008 Retrying couchdb request in 1s. Attempt:4  Error:Get http://couchdb1:5984/: EOF
2020-02-20 02:25:32.294 UTC [couchdb] handleRequest -> WARN 009 Retrying couchdb request in 2s. Attempt:5  Error:Get http://couchdb1:5984/: EOF
2020-02-20 02:25:34.347 UTC [couchdb] handleRequest -> WARN 00a Retrying couchdb request in 4s. Attempt:6  Error:Get http://couchdb1:5984/: EOF
2020-02-20 02:25:38.401 UTC [couchdb] handleRequest -> WARN 00b Retrying couchdb request in 8s. Attempt:7  Error:Get http://couchdb1:5984/: EOF
2020-02-20 02:25:46.455 UTC [couchdb] handleRequest -> WARN 00c Retrying couchdb request in 16s. Attempt:8  Error:Get http://couchdb1:5984/: EOF
2020-02-20 02:26:02.510 UTC [couchdb] handleRequest -> WARN 00d Retrying couchdb request in 32s. Attempt:9  Error:Get http://couchdb1:5984/: EOF
2020-02-20 02:26:34.565 UTC [couchdb] handleRequest -> WARN 00e Retrying couchdb request in 1m4s. Attempt:10  Error:Get http://couchdb1:5984/: EOF
2020-02-20 02:27:38.620 UTC [couchdb] handleRequest -> WARN 00f Retrying couchdb request in 2m8s. Attempt:11  Error:Get http://couchdb1:5984/: EOF
2020-02-20 02:29:46.675 UTC [couchdb] handleRequest -> WARN 010 Retrying couchdb request in 4m16s. Attempt:12  Error:Get http://couchdb1:5984/: EOF
2020-02-20 02:34:02.731 UTC [couchdb] handleRequest -> WARN 011 Retrying couchdb request in 8m32s. Attempt:13  Error:Get http://couchdb1:5984/: EOF
panic: Error initializing ledger provider: unable to connect to CouchDB, check the hostname and port: Get http://couchdb1:5984/: EOF

goroutine 1 [running]:
github.com/hyperledger/fabric/core/ledger/ledgermgmt.initialize(0xc0003728c0)
        /opt/gopath/src/github.com/hyperledger/fabric/core/ledger/ledgermgmt/ledger_mgmt.go:81 +0x78a
github.com/hyperledger/fabric/core/ledger/ledgermgmt.Initialize.func1()
        /opt/gopath/src/github.com/hyperledger/fabric/core/ledger/ledgermgmt/ledger_mgmt.go:53 +0x2a
sync.(*Once).Do(0x26d0748, 0xc0001ff458)
        /opt/go/src/sync/once.go:44 +0xb3
github.com/hyperledger/fabric/core/ledger/ledgermgmt.Initialize(0xc0003728c0)
        /opt/gopath/src/github.com/hyperledger/fabric/core/ledger/ledgermgmt/ledger_mgmt.go:52 +0x55
github.com/hyperledger/fabric/peer/node.serve(0x26d0668, 0x0, 0x0, 0x0, 0x0)
        /opt/gopath/src/github.com/hyperledger/fabric/peer/node/start.go:181 +0x568
github.com/hyperledger/fabric/peer/node.glob..func3(0x25c7240, 0x26d0668, 0x0, 0x0, 0x0, 0x0)
        /opt/gopath/src/github.com/hyperledger/fabric/peer/node/start.go:126 +0xf1
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).execute(0x25c7240, 0x26d0668, 0x0, 0x0, 0x25c7240, 0x26d0668)
        /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:762 +0x465
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x25c7960, 0xc0001fff60, 0x1, 0x1)
        /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:852 +0x2ec
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).Execute(...)
        /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:800
main.main()
        /opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:53 +0x41f

我怀疑docker容器中可能存在一些dns问题。所以我也尝试过在dns_search: .文件中添加- GODEBUG=netdns=godocker-compose.yaml

  peer0.org1.example.com:
    container_name: peer0.org1.example.com
    image: hyperledger/fabric-peer:1.4.4
    dns_search: .
    environment:
      - GODEBUG=netdns=go
      - CORE_PEER_ID=peer0.org1.example.com
      - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
      - CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org1.example.com:7051
      - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
      - CORE_PEER_LOCALMSPID=Org1MSP
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${COMPOSE_PROJECT_NAME}_example
      - FABRIC_LOGGING_SPEC=INFO
      - CORE_PEER_TLS_ENABLED=true
      - CORE_PEER_GOSSIP_USELEADERELECTION=true
      - CORE_PEER_GOSSIP_ORGLEADER=false
      - CORE_PEER_PROFILE_ENABLED=true
      - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt
      - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key
      - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt
      - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
      - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb0:5984
      - CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=admin
      - CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=admin

仍然是相同的错误。

docker docker-compose couchdb hyperledger-fabric hyperldger-fabric-peer
1个回答
0
投票
  1. 检查是否在docker-compose.yaml中定义了沙发数据库容器。
  2. 如果已定义,则使该应用程序依赖于对方容器。像

       - CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=admin
       - CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=admin
    depends_on:
       - couchdb1
    
  3. 检查您的couchdb容器是否已启动。如果没有,请使用docker-compose

  4. 上载容器
© www.soinside.com 2019 - 2024. All rights reserved.