Running Environment: Primary: 192.168.111.150Standby: 192.168.111.15119425111.152os: CentOS5.8PostgreSQL: 9.1.2 or later. Streaming Replication is supported.
PostgreSQL cache details
Compiling PostgreSQL on Windows
Configuration and installation of LAPP (Linux + Apache + PostgreSQL + PHP) Environment in Ubuntu
Install and configure phppgAdmin on Ubuntu
Install PostgreSQL9.3 on CentOS
1. It is best to have the same environment for the Primary and Standby nodes in environment planning. 2. install PostgreSQL1) install PostgreSQL software on the Primary and Standy nodes with the installation path/opt/pgsql-9.1.22) set the postgres user's environment variable PGHOME =/opt/pgsql-9.1.2PGDATA =/storage0/database/postgres/mainPATH = $ PG_HOME/bin: $ PATH: $ HOME/bin 3. primary Node 1) switch to ipvs user $ su-ipvs2) initialize database $ initdb3) Configure pg_ipv.conf and add a line under # IPv4 local connections, set PostgreSQL access and its permissions host all 192.168.111.1/24 trust in # replication privilege. add a row below and set the replication user and permission host re Plication ipvs 192.168.111.1/24 trust4) Configure postgresql. conf configuration listening, modify listen_addresses = 'localhost' listen _ addresses = '*' # what IP address (es) to listen on; configure the Primary Replication parameter wal_level = partition = 5wal_keep_segments = 32archive_mode = onarchive_command = 'cp % p/storage0/database/S/archive/% f </dev/null' "/storage0/database /postgres/archive "is the storage path of the Replication archive. PostgreSQL stores the Replication WAL in the "/storage0/database/S/archive" path. 5) Start PostgreSQL database $ pg_ctl start6 on Primary. Execute the following command on primary: $ psql-c "SELECT pg_start_backup ('label', true) "Remove the files under the PGDATA directory of Primary, except postmaster. copy the pid to the/storage0/database/postgres/main directory of the Standby node, which is the PGDATA directory of the PostgreSQL database on the Standby node. $ Rsync-a $ {PGDATA}/postgres@192.168.111.151:/storage0/database/S/main -- exclude postmaster. pid $ psql-c "SELECT pg_stop_backup ()" content in the/storage0/database/S/main directory of 192.168.111.151 is as follows: