如何在fabric-ca服务器中将postgres添加为数据库?

时间:2019-10-07 10:24:13

标签: postgresql hyperledger-fabric hyperledger hyperledger-fabric-ca

我正在尝试将postgres添加为fabric-ca中的数据库?我尝试通过添加

将其添加到fabric-ca-server-config.yaml
db:
  type: postgres
  datasource: host=localhost port=5432 user=Username password=Password dbname=fabric_ca sslmode=verify-full

但是当我尝试初始化fabric-ca时出现错误,它引发了无法连接到postgres的警告,我在下面添加了错误和警告日志。

fabric-ca-server init -b admin:adminpw
2019/10/07 10:16:54 [INFO] Configuration file location: /home/ubuntu/fabric-ca/fabric-ca-server-config.yaml
2019/10/07 10:16:54 [INFO] Server Version: 1.4.4
2019/10/07 10:16:54 [INFO] Server Levels: &{Identity:2 Affiliation:1 Certificate:1 Credential:1 RAInfo:1 Nonce:1}
2019/10/07 10:16:54 [INFO] The CA key and certificate already exist
2019/10/07 10:16:54 [INFO] The key is stored by BCCSP provider 'SW'
2019/10/07 10:16:54 [INFO] The certificate is at: /home/ubuntu/fabric-ca/ca-cert.pem
2019/10/07 10:16:54 [WARNING] Failed to connect to database 'fabric_ca'
2019/10/07 10:16:54 [WARNING] Failed to connect to database 'postgres'
2019/10/07 10:16:54 [WARNING] Failed to connect to database 'template1'
2019/10/07 10:16:54 [ERROR] Error occurred initializing database: Failed to connect to Postgres database. Postgres requires connecting to a specific database, the following databases were tried: [fabric_ca postgres template1]. Please create one of these database before continuing
2019/10/07 10:16:54 [INFO] Home directory for default CA: /home/ubuntu/fabric-ca
2019/10/07 10:16:54 [INFO] Initialization was successful

0 个答案:

没有答案