github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/deploy/postgresql/scripts/pgbouncer_setup.sh (about)

     1  #!/bin/bash
     2  set -o errexit
     3  set -e
     4  mkdir -p /opt/bitnami/pgbouncer/conf/ /opt/bitnami/pgbouncer/logs/ /opt/bitnami/pgbouncer/tmp/
     5  cp /home/pgbouncer/conf/pgbouncer.ini /opt/bitnami/pgbouncer/conf/
     6  echo "\"$POSTGRESQL_USERNAME\" \"$POSTGRESQL_PASSWORD\"" > /opt/bitnami/pgbouncer/conf/userlist.txt
     7  echo -e "\\n[databases]" >> /opt/bitnami/pgbouncer/conf/pgbouncer.ini
     8  echo "postgres=host=$KB_POD_IP port=5432 dbname=postgres" >> /opt/bitnami/pgbouncer/conf/pgbouncer.ini
     9  chmod +777 /opt/bitnami/pgbouncer/conf/pgbouncer.ini
    10  chmod +777 /opt/bitnami/pgbouncer/conf/userlist.txt
    11  useradd pgbouncer
    12  chown -R pgbouncer:pgbouncer /opt/bitnami/pgbouncer/conf/ /opt/bitnami/pgbouncer/logs/ /opt/bitnami/pgbouncer/tmp/
    13  /opt/bitnami/scripts/pgbouncer/run.sh