Preparing the PEM Server for pgBouncer Connections v8
You must configure the PEM database server to accept connections from pgBouncer; the following example demonstrates the steps required to prepare the PEM database server.
Create a dedicated user named pgbouncer on the PEM database server. For example:
Create a user named pem_admin1 (a non-super user) with pem_admin and pem_agent_pool role membership on the PEM database server. For example:
Grant CONNECT privilege to the pgbouncer user on the pem database. For example:
Grant USAGE privilege to the pgbouncer user for the pem schema on the pem database. For example:
Grant EXECUTE privilege to the pgbouncer user on the pem.get_agent_pool_auth(text) function in the pem 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 will create a user with the same name with a random password, and grant
pem_agent
andpem_agent_pool
roles to the user. This allows pgBouncer to use a proxy user on behalf of the agent. For example:Add the following entries to the start of the
pg_hba.conf
file of the PEM database server; this will allow pgBouncer user to connect to the pem database using the md5 authentication method. For example:
After configuring the PEM server, you should configure pgBouncer.