debian11 pgpool

echo "
deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib">/etc/apt/sources.list

 

apt-get update

apt-get install -y curl

apt-get install -y gnupg2 

curl http://mirrors.zju.edu.cn/postgresql/repos/apt/ACCC4CF8.asc | apt-key add -

 

vim /etc/apt/sources.list.d/pgdg.list

deb http://mirrors.zju.edu.cn/postgresql/repos/apt/ bullseye-pgdg main

 

apt-get update

timedatectl set-timezone Asia/Shanghai
 

apt-get install -y locales-all

 

apt-get -y install pgpool2 libpgpool2 postgresql-11-pgpool2

---------------------

字符集问题

dpkg-reconfigure locales

-----------------------

mkdir /var/run/pgpool

mkdir /var/log/pgpool

chmod -R 777 /var/run/pgpool

chmod -R 777 /var/log/pgpool

 

 

 cp /etc/pgpool2/pgpool.conf /etc/pgpool2/pgpool.conf.bak

 

cd /etc/pgpool2/

wget www.alexman.cn/pgpool.conf.20240301

pg_md5 --md5auth --username=postgres "alex1234"

vim /etc/pgpool2/pool_hba.conf

host all all 0.0.0.0/0 md5

 

-----------------------

psql免认证

export PGPASSWORD=alex1234

------------------------

pgpool测试:

select pg_is_in_recovery()

show pool_nodes

 

posted @ 2024-03-01 14:19  alexhe  阅读(2)  评论(0编辑  收藏  举报