任何人都对此有所帮助,我想在一个Vm中使用pgpool与其他两个Vm一起复制postgresql数据。我是这个领域的新手我在三个Vm中安装了postgresql-9.3,在一个Vm中安装了pgpool-II。现在我想知道如何在vm之间复制数据和Pgpool.conf文件,pool_hba.conf文件和pcp.conf中有哪些必要的更改?我应该在postgresql文件中做些什么更改,比如postgresql.conf& pg_hba.conf我应该在哪里进行这些更改,无论是在主节点中,如在Vm中我安装pgpool-II还是在从节点中安装其他两个Vm?
请帮助我,我处于混乱的状态,并为我提供良好的网站或教程,以便遵循这个规定?
更新请参阅配置文件 - 在
下面STANDBY SERVER
pg_hba.conf
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
#host all all 127.0.0.1/32 ident
# IPv6 local connections:
#host all all ::1/128 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 ident
#host replication postgres ::1/128 ident
# host all all 0.0.0.0.0 trust
host all postgres 0.0.0.0.0 trust
# host all all primaryipaddress trust
local all all trust
host all all 192.168.1.0/24 md5
postgresql.conf
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5433
wal_level = hot_standby
#archive_command = '‘cp %p /var/lib/pgsql/wal_archive_27/%f'
max_wal_senders = 2
hot_standby = on
Primary Server
pgpool.conf
# - pgpool Connection Settings -
listen_addresses = '*'
socket_dir = '/var/ru
# - pgpool Communication Manager Connection Settings -
pcp_port = 9898
pcp_socket_dir = '/var/run'
# - Backend Connection Settings -
backend_hostname0 = 'xxxxxxx’'
backend_port0 = 5432
backend_weight0 = 1
backend_data_directory0 = '/var/lib/pgsql/9.3/data'
backend_flag0 = 'ALLOW_TO_FAILOVER'
#backend_hostnamex1 = 'xxxxxxxx’
#backend_port1 = 5433
#backend_weight1 = 1
#backend_data_directory1 = '/var/lib/pgsql/9.3/data'
#backend_flag1 = 'ALLOW_TO_FAILOVER'ckend_hostname1 = '3rd vm'
backend_hostname1 = 'xxxxxxxxxxxx’
backend_port1 = 5433
backend_weight1 = 1
backend_data_directory1 = '/var/lib/pgsql/9.3/data'
backend_flag1 = 'ALLOW_TO_FAILOVER'
# - What to log -
print_timestamp = on
log_connections = on
log_hostname = on
log_statement = on
log_per_node_statement = on
log_standby_delay = 'if_over_threshold'
# FILE LOCATIONS
pid_file_name = '/var/run/pgpool-II-93/pgpool.pid'
logdir = '/var/log/pgpool'
# REPLICATION MODE
replication_mode = on
replicate_select = on
# - Degenerate handling -
replication_stop_on_mismatch = on
# LOAD BALANCING
load_balance_mode = on
# HEALTH CHECK
health_check_user = 'apache'
pg_hba.conf
# TYPE DATABASE USER CIDR-ADDRESS METHOD
host all all 0.0.0.0/0 md5
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all postgres 127.0.0.1/32 trust
# Allow any user from any host with IP address 192.168.93.x to connect
# to database "postgres" as the same user name that ident reports for
# the connection (typically the Unix user name).
#
# TYPE DATABASE USER CIDR-ADDRESS METHOD
host postgres all xxxxxxxx ident
# Allow a user from host 192.168.12.10 to connect to database
# "postgres" if the user's password is correctly supplied.
#
# TYPE DATABASE USER CIDR-ADDRESS METHOD
host postgres all xxxxxxxxx md5
host all postgres xxxxxxxxxx trust
#host all postgres xxxxxxxxxx trust
postgresql.conf
wal_level = hot_standby
#archive_mode = on
max_wal_senders = 2
hot_standby = on
log_statement = 'all'
提前致谢
帕尔
答案 0 :(得分:0)
您可以设置PostgreSQL的本机流复制,以便在PG服务器之间进行数据复制,并在其上配置pgpool-II。 看看下面的教程 http://www.pgpool.net/pgpool-web/contrib_docs/simple_sr_setting_3.1/