pgbouncer.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
lista de usuários.txt
"postgres" "postgres1"
Pode ser conectado por psql
:
psql -p 6432 -h 127.0.0.1 -U postgres jiradb
(Prompt password: postgres1)
Mas tente conectar do aplicativo:
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>
Ao reiniciar o Jira, o banco de dados não pode ser conectado novamente:
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.)
Estou testando em um servidor. O Jira está instalado no jira
usuário. O pgBouncer está sendo executado em postgres
user.
Isso funciona: