Preparing the PEM database server v9
You must configure the PEM database server to work with PgBouncer. This example shows how to configure the PEM database server.
Create a dedicated user named pgbouncer on the PEM database server:
Create a user named pem_admin1 (not a superuser) with
pem_admin
andpem_agent_pool role
membership on the PEM database server:Grant CONNECT privileges to the pgbouncer user on the
pem
database:Grant USAGE privileges to the pgbouncer user for the
pem
schema on thepem
database:Grant EXECUTE privileges to the pgbouncer user on the
pem.get_agent_pool_auth(text)
function in thepem
database. For example:Use the
pem.create_proxy_agent_user(varchar)
function to create a user named pem_agent_user1 on the PEM database server:The function creates a user with the same name with a random password and grants pem_agent and pem_agent_pool roles to the user. This approach allows pgBouncer to use a proxy user on behalf of the agent.
Add the following entries to the start of the
pg_hba.conf
file of the PEM database server. These entries allow the pgBouncer user to connect to thepem
database using the md5 authentication method.