弹跳器.ini
[databases]
jiradb = host=127.0.0.1 port=5432 dbname=jiradb
[pgbouncer]
listen_port = 6432
listen_addr = 127.0.0.1
auth_type = md5
auth_file = userlist.txt
logfile = pgbouncer.log
pidfile = pgbouncer.pid
admin_users = postgres
用户列表.txt
"postgres" "postgres1"
它可以通过以下方式连接psql
:
psql -p 6432 -h 127.0.0.1 -U postgres jiradb
(Prompt password: postgres1)
但尝试从应用程序连接:
Jira dbconfig.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jira-database-config>
<name>defaultDS</name>
<delegator-name>default</delegator-name>
<database-type>postgres72</database-type>
<schema-name>public</schema-name>
<jdbc-datasource>
<url>jdbc:postgresql://127.0.0.1:6432/jiradb</url>
<driver-class>org.postgresql.Driver</driver-class>
<username>postgres</username>
<password>postgres1</password>
<pool-min-size>20</pool-min-size>
<pool-max-size>20</pool-max-size>
<pool-max-wait>30000</pool-max-wait>
<validation-query>select 1</validation-query>
<min-evictable-idle-time-millis>60000</min-evictable-idle-time-millis>
<time-between-eviction-runs-millis>300000</time-between-eviction-runs-millis>
<pool-max-idle>20</pool-max-idle>
<pool-remove-abandoned>true</pool-remove-abandoned>
<pool-remove-abandoned-timeout>300</pool-remove-abandoned-timeout>
<pool-test-on-borrow>false</pool-test-on-borrow>
<pool-test-while-idle>true</pool-test-while-idle>
</jdbc-datasource>
</jira-database-config>
重启jira后,无法再次连接数据库:
Database: JIRA couldn't connect to your database
JIRA failed to establish a connection to your database.
This could be because:
Your database isn't running
The configuration of your dbconfig.xml file is incorrect (user, password, or database URL etc.)
There is a network issue between JIRA and your database (e.g. firewall, database doesn't allow remote access etc.)
我正在一台服务器上对其进行测试。Jira 安装在jira
用户处。pgBouncer 在postgres
用户下运行。
这有效: