Hyperledger fabric 无法连接到Postgres数据库Postgres需要连接到特定数据库,已尝试以下数据库:

Hyperledger fabric 无法连接到Postgres数据库Postgres需要连接到特定数据库,已尝试以下数据库:,hyperledger-fabric,hyperledger,hyperledger-fabric-ca,Hyperledger Fabric,Hyperledger,Hyperledger Fabric Ca,当我尝试连接fabric ca以使用postgres作为数据库时,出现了此错误 Using postgres database, connecting to database... 2019/10/22 09:21:16 [DEBUG] Database Name: fabriccaserver 2019/10/22 09:21:16 [DEBUG] Connecting to PostgreSQL server, using connection string: host=12

当我尝试连接fabric ca以使用postgres作为数据库时,出现了此错误

Using postgres database, connecting to database...
    2019/10/22 09:21:16 [DEBUG] Database Name: fabriccaserver
    2019/10/22 09:21:16 [DEBUG] Connecting to PostgreSQL server, using connection string: host=127.0.0.1 port=5432 user=**** password=**** dbname=fabriccaserver sslmode=disable
    2019/10/22 09:21:16 [WARNING] Failed to connect to database 'fabriccaserver'
    2019/10/22 09:21:16 [DEBUG] Connecting to PostgreSQL server, using connection string: host=127.0.0.1 port=5432 user=**** password=**** dbname=postgres sslmode=disable
    2019/10/22 09:21:16 [WARNING] Failed to connect to database 'postgres'
    2019/10/22 09:21:16 [DEBUG] Connecting to PostgreSQL server, using connection string: host=127.0.0.1 port=5432 user=**** password=**** dbname=template1 sslmode=disable
    2019/10/22 09:21:16 [WARNING] Failed to connect to database 'template1'
    2019/10/22 09:21:16 [ERROR] Error occurred initializing database: Failed to connect to Postgres database. Postgres requires connecting to a specific database, the following databases were tried: [fabriccaserver postgres template1]. Please create one of these database before continuing

我通过在主机I中放置容器_名称解决了这个错误

db:
  db:
  type: postgres
  datasource: host=db-postgres port=5432 user=postgres password=caDbPass12345 dbname=fabriccaserver sslmode=disable  
  tls:
      enabled: false
      certfiles:
      client:
        certfile:
        keyfile:
之前,我进入localhost并尝试使用127.0.0.1,之后我在docker-compose.yaml中看到我的postgres服务处于不同的网络下,ica.org1.example.com处于不同的网络下,我修复了该网络,并且在杀死和删除所有docker进程后还必须进行docker网络修剪