IT咨询服务Fabric

fabric-ca-server db 链接出错,但DB没有LOG?

我遇到FABRIC CA server链接DB的问题,我的CA-SERVER的DB设置如下db: type: postgres datasource: host=9.110.24.46 port=5432 user=postgres password=9XXXXX dbname=postgres tls:我的postgres能用PGADMIN和pgql远端登录。但就在FABRIC链接的时候失败,在FABRIC端可以...显示全部

我遇到FABRIC CA server链接DB的问题,我的CA-SERVER的DB设置如下db:
type: postgres
datasource: host=9.110.24.46 port=5432 user=postgres password=9XXXXX dbname=postgres
tls:
我的postgres能用PGADMIN和pgql远端登录。但就在FABRIC链接的时候失败,在FABRIC端可以看到出错信息,但在PG端没有任何LOG。有没同行能提供pg_hba.conf设置?我的pg_hba.conf设置如下

IPv4 local connections:

host all all 0.0.0.0/0 ident

host all all 0.0.0.0/0 trust
host all all 127.0.0.1/32 trust
local all postgres trust
host all all 9.110.24.46/0 trust
host all postgres 127.0.0.1/32 trust
host all postgres 127.0.0.1/32 trust
host all postgres 0.0.0.0/32 trust
host all postgres 0.0.0.0/0 trust

2018/07/16 23:19:56 [WARNING] Failed to connect to database 'postgres'
2018/07/16 23:19:56 [DEBUG] Connecting to PostgreSQL server, using connection string: host=9.110.24.46 port=5432 user= password= dbname=postgres
2018/07/16 23:19:56 [WARNING] Failed to connect to database 'postgres'
2018/07/16 23:19:56 [DEBUG] Connecting to PostgreSQL server, using connection string: host=9.110.24.46 port=5432 user= password= dbname=template1
2018/07/16 23:19:56 [WARNING] Failed to connect to database 'template1'
2018/07/16 23:19:56 [ERROR] Error occurred initializing database: Failed to create user registry for PostgreSQL: Failed to connect to Postgres database. Postgres requires connecting to a specific database, the following databases were tried: [postgres postgres template1]. Please create one of these database before continuing

收起
参与4

返回杨文云的回答

杨文云杨文云数据库管理员GBS

我已解决,应该是FABRIC的BUG,在启动CA-SERVER的时候如果用了--boot 时指定的ADMIN代替了FBARIC-CA-SERVER-CONF.YAML里的DB里设置的USERID,我在POSTGRES加了ADMIN role后或没用--BOOT 参数就可以启动FABRIC-CA-SERVER。这是一个坑。已给FABRIC PROJECT写信应该会修正这个BUG。

IT咨询服务 · 2018-07-18
浏览1988

回答者

杨文云
数据库管理员GBS
擅长领域: 数据库云计算服务器

杨文云 最近回答过的问题

回答状态

  • 发布时间:2018-07-18
  • 关注会员:1 人
  • 回答浏览:1988
  • X社区推广