create extension pgpool_regclass;
create extension pgpool_recovery;
psql -U postgres -h 172.16.144.145 -p 5432 -f /usr/local/pgsql/share/extension/pgpool-
recovery.sql template1
执行以上命令时,会在主数据库上的 template1 表空间下面创建几个 recovery 需
要的函数。
3.3 配置 pcp.conf
cd /usr/local/pgpool/etc/
cp pcp.conf.sample pcp.conf
pgpool 提供 pcp 接口,可以查看、管理 pgpool 的状态,并且可以远程操作 pgpool
。pcp.conf 是用来对 pcp 相关命令认证的文件,格式为º USERID:MD5PASSWD。
执行 pg_md5 -u postgres -p 命令后,让输入密码,然后会出现 md5 加密后的
字符串
password:123456
XXXXXXXXXXXXXXXXXXXXXXX
然后在 pcp.conf 中添加 postgres:XXXXXXXXXXXXXX
配置 pgpool.conf
# ----------------------------
# pgPool-II configuration file
# ----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# Whitespace may be used. Comments are introduced with "#" anywhere on a line.
# The complete list of parameter names and allowed values can be found in the
# pgPool-II documentation.
#
# This file is read on server startup and when the server receives a SIGHUP
# signal. If you edit the file on a running system, you have to SIGHUP the
# server for the changes to take effect, or use "pgpool reload". Some
# parameters, which are marked below, require a server shutdown and restart to
# take effect.
#
#------------------------------------------------------------------------------
# CONNECTIONS
#------------------------------------------------------------------------------