从Jenkins连接到posgresql并运行脚本文件。

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

有谁试过从Jenkins连接到postgresql并尝试运行脚本?

我已经安装了 postgresql数据库插件 在jenkins中,然后在 Jenkins配置工具 我曾尝试配置postgresql,当我尝试 测试连接 越来越 错误 如下图所示。

我使用的是一台windows机器,并尝试使用padmin访问数据库,也尝试通过命令提示符中的psql访问数据库,他们工作正常,但现在连接jenkins得到以下错误信息

org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "223.228.174.18", user "jxxxxxxxxl", database "dxxxxxxxxx", SSL off
    at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:293)
postgresql jenkins jenkins-plugins
1个回答
0
投票

找到 postgresql.conf 文件并进行编辑。

在这个文件中,如果存在更新或添加了 '*' 对于 listen_address 如下图所示

listen_addresses = '*'

定位 pg_hba.conf 文件(通常在: pgsql/data/pg_hba.conf),并更新如下

host  all  all 0.0.0.0/0 md5

重新启动postgresql服务,比如

service postgresql restart

: 在基于linux的操作系统中,它通常会看起来像

/etc/init.d/postgresql restart

service postgresql restart

0
投票

我可以通过在Jekins配置中的附加属性中添加两个参数来解决这个问题。请看附件中的图片.修复图片1

© www.soinside.com 2019 - 2024. All rights reserved.