[关闭]
@zhangyy 2021-07-23T11:14:42.000000Z 字数 2154 阅读 146

greenplum的升级与连接池pgbouncer

greenplum系列


一:greenplum 的升级

1.1 greenplum的文件最新版本准备

  1. 下载地址:
  2. https://network.pivotal.io/products/vmware-tanzu-greenplum
  3. 下载:
  4. greenplum-db-6.17.0-rhel7-x86_64.rpm

image_1fahgfreu4eflljdug1sppri69.png-201.6kB

1.2 升级greenplum

  1. 上传新版本的GP 包到 gpmaster节点,然后同步所有主机
  2. 切换到root
  3. 后执行命令:
  4. cd /home/gpadmin/ [全部节点]
  5. rpm -Uvh greenplum-db-6.17.0-rhel7-x86_64.rpm

image_1fahbhhp0f08ekk1d0r715pri16.png-285kB

image_1fahbq33q1mv91equsn41qc313ii2j.png-101.8kB

  1. 重启一下GP 集群
  2. gpstop -a
  3. gpstart -a

image_1fahc7g1nsn081dg7h1lj718kd5h.png-204.3kB

image_1fahc9rih1ifco3511r11j1i1l986o.png-192kB

image_1fahc5u6m1hadcei2k41ajd2tq4n.png-281.3kB

二: gp的连接池pgbouncer

2.1 pgbouncer的概述:

  1. PgBouncer工具管理用于PostgreSQLGreenplum数据库连接的连接池。
  2. Greenplum数据库安装包括PgBouncer连接池软件。下列主题描述了如何对Greenplum数据库设置和使用PgBouncer。有关如何把PgBouncerPostgreSQL一起使用请见 PgBouncer网站
  3. 参考:
  4. https://gp-docs-cn.github.io/docs/admin_guide/access_db/topics/pgbouncer.html
  5. pgbouncer的官网
  6. http://www.pgbouncer.org/
  7. 下载 pgbouncer1.14 版本
  8. pgbouncer-1.14.0.tar.gz
  9. 上传到node06.flyfish.com 主机

2.2 安装配置pgbouncer

  1. 安装 pgbouncer
  2. yum install libevent*
  3. yum install gcc gcc-c++ openssl*

image_1fahd2dvmr6s1udj18a91jjtmk375.png-118.2kB

  1. tar -zxvf pgbouncer-1.14.0.tar.gz
  2. ./configure --prefix=/usr/local/pgbouncer
  3. make
  4. make install
  5. mkdir /usr/local/pgbouncer/config
  6. cp -p pgbouncer.ini userlist.txt /usr/local/pgbouncer/config/

image_1fahdqk3d1q6qike184ek1c4b82.png-116.1kB

image_1fahdr5eqe721i241uqb1udv5d18f.png-78.8kB

image_1fahdrhrpt0gve715bg1u5p1p878s.png-104.7kB

image_1fahe2gbtr3u9v0100p1qtlbrg99.png-64.1kB

  1. useradd pgbouncer && echo pgbouncer |passwd pgbouncer --stdin
  2. chown -R pgbouncer:pgbouncer /usr/local/pgbouncer

image_1fahe3d2os9nam45qu1ih81kss9m.png-91.7kB

  1. cd /usr/local/pgbouncer/config
  2. cp -p pgbouncer.ini pgbouncer.ini.bak
  3. vim pgbouncer.ini
  4. [databases]
  5. postgres = host=192.168.100.11 port=5432 dbname=postgres auth_user=postgres
  6. gpperfmon = host=192.168.100.11 port=5432 dbname=gpperfmon auth_user=postgres
  7. template0 = host=192.168.100.11 port=5432 dbname=template0 auth_user=postgres
  8. template1 = host=192.168.100.11 port=5432 dbname=template1 auth_user=postgres
  9. flyfish_db = host=192.168.100.11 port=5432 dbname=flyfish_db auth_user=postgres
  10. [pgbouncer]
  11. logfile = /usr/local/pgbouncer/pgbouncer.log
  12. pidfile = /usr/local/pgbouncer/pgbouncer.pid
  13. listen_addr = 0.0.0.0
  14. listen_port = 6432
  15. auth_type = trust
  16. auth_file = /usr/local/pgbouncer/config/userlist.txt

image_1fahftu8s1mfd1k361shl4491ks034.png-65.8kB

image_1fahenjkj11vt3he1k9duda1v4nm.png-59kB

image_1faheo243cifhuv1qd81c3376i13.png-38.9kB

  1. cp -p userlist.txt userlist.txt.bak
  2. vim userlist.txt
  3. "flyfish" "flyfish123"
  4. "postgres" "postgres123"
  5. 这两个账号前提是在greenplum 的数据库当中有授权
  6. create user flyfish with password 'flyfish123';
  7. create user postgres with password 'postgres123';

image_1faheom7opj11d7813i715l1ana1g.png-29.3kB

image_1fahep35ap2p1e731pci2g7u1b1t.png-67.4kB

  1. 启动pgbouncer
  2. cd /usr/local/pgbouncer
  3. bin/pgbouncer -d config/pgbouncer.ini

image_1faherljuho49bf10pr1lgj165h2a.png-110kB

image_1fahes7pb138m3qo1jl01kr51slb2n.png-86.2kB

  1. 登录测试:
  2. psql -h 192.168.100.16 -p 6432 -U flyfish
  3. psql -h 192.168.100.16 -p 6432 -U postgres

image_1fahg6ssa1kdhe3jbr1ral15243h.png-113.2kB

image_1fahgcjon1n1ghbg1clj53i9h63u.png-119.6kB

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注