Pusisin siin kahe postgre andmebaasi peegeldamisega.
Seadistus ise lihtne – lihtsalt masin A (master DB ja PGPool-II) ja masin B (slave)
# Replication mode
replication_mode = true
# Load balancing mode, i.e., all SELECTs are load balanced.
# This is ignored if replication_mode is false.
load_balance_mode = false
# If true, operate in master/slave mode.
master_slave_mode = false
# backend_hostname, backend_port, backend_weight
# here are examples
backend_hostname0 = 'master'
backend_port0 = 5432
backend_weight0 = 1
backend_data_directory0 = '/var/lib/pgsql/data'
backend_hostname1 = 'slave'
backend_port1 = 5432
backend_weight1 = 1
backend_data_directory1 = '/var/lib/pgsql/data'
Pusisin mitu tundi ja ikka pgpool logis:
ERROR: pid 23466: pool_read_int: data does not match between between master(0) slot[1] (50331648)
ERROR: pid 23466: pool_do_auth: read auth kind failed
Lahendus peitus slave pg_hba.conf. Lihtsalt trustisin vajaliku IP pealt.
Väidetavalt Pgpool ei toeta clear text auth-i.
In the replication mode or master/slave mode, trust, clear text password, pam methods are supported. clear text password is not supported. md5 is supported by using "pool_passwd". Here are steps to enable md5 authentication:
Login as DB user and type "pg_md5 --md5auth " user name and md5 encrypted password is registered into pool_passwd. If pool_passwd does not exist yet, pg_md5 command will automatically create it for you.
The format of pool_passwd is "username:encrypted_passwd".
You need to also add appropreate md5 entry to pool_hba.conf. See Setting up pool_hba.conf for client authentication (HBA) for more details.
Please note that the user name and passowrd must be identical to those registered in PostgreSQL.
In all the other modes, trust, clear text password, crypt, md5, pam methods are supported.
pgpool-II does not support pg_hba.conf-like access controls. If the TCP/IP connection is enabled, pgpool-II accepts all the connections from any host. If needed, use iptables and such to control access from other hosts. (PostgreSQL server accepting pgpool-II connections can use pg_hba.conf, of course).