[PostgreSQL]: Replication setup

 

Postgres installation :

[ root @ masterhost : ~ ] yum install postgresql postgresql-server
http://guegs3.nam.nsroot.net/SOELinux/repos/prod/soe6gdeproducts-x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 – “The requested URL returned error: 404 Not Found”
Trying other mirror.
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package postgresql94.x86_64 0:9.4.4-1PGDG.rhel6 will be installed
—> Package postgresql94-server.x86_64 0:9.4.4-1PGDG.rhel6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================================================================================================
Installing:
postgresql94 x86_64 9.4.4-1PGDG.rhel6 pgdg94 1.0 M
postgresql94-server x86_64 9.4.4-1PGDG.rhel6 pgdg94 4.3 M

Transaction Summary
============================================================================================================================================================================================================================================
Install 2 Package(s)

Total download size: 5.4 M
Installed size: 22 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): postgresql94-9.4.4-1PGDG.rhel6.x86_64.rpm | 1.0 MB 00:00
(2/2): postgresql94-server-9.4.4-1PGDG.rhel6.x86_64.rpm | 4.3 MB 00:02
——————————————————————————————————————————————————————————————————————————————–
Total 1.7 MB/s | 5.4 MB 00:03
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : postgresql94-9.4.4-1PGDG.rhel6.x86_64 1/2
Installing : postgresql94-server-9.4.4-1PGDG.rhel6.x86_64 2/2
Verifying : postgresql94-server-9.4.4-1PGDG.rhel6.x86_64 1/2
Verifying : postgresql94-9.4.4-1PGDG.rhel6.x86_64 2/2

Installed:
postgresql94.x86_64 0:9.4.4-1PGDG.rhel6 postgresql94-server.x86_64 0:9.4.4-1PGDG.rhel6

Complete!
[ root @ masterhost : ~ ]

[ root @ masterhost : /etc/rc.d/init.d ] ll -lthr postgresql*
-rwxr-xr-x 1 root root 9.9K Jun 11 08:10 postgresql-9.4
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ] chkconfig postgresql-9.4 on
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ] chown postgres:postgres /var/lib/pgsql/9.4/ -R
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ slavehost : /etc/rc.d/init.d ] service postgresql-9.4 initdb
Data directory is not empty!
[ root @ slavehost : /etc/rc.d/init.d ] [FAILED]
[ root @ slavehost : /etc/rc.d/init.d ]
[ root @ slavehost : /etc/rc.d/init.d ] rm -rf /var/lib/pgsql/9.4/*
[ root @ slavehost : /etc/rc.d/init.d ]

[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ] service postgresql-9.4 initdb
Initializing database: [ OK ]
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ] ll -lhtr /var/lib/pgsql/9.4/data/
total 112K
drwx—— 2 postgres postgres 4.0K Jul 24 02:53 pg_serial
drwx—— 2 postgres postgres 4.0K Jul 24 02:53 pg_dynshmem
-rw——- 1 postgres postgres 4 Jul 24 02:53 PG_VERSION
drwx—— 2 postgres postgres 4.0K Jul 24 02:53 pg_twophase
drwx—— 2 postgres postgres 4.0K Jul 24 02:53 pg_tblspc
drwx—— 2 postgres postgres 4.0K Jul 24 02:53 pg_stat_tmp
drwx—— 2 postgres postgres 4.0K Jul 24 02:53 pg_stat
drwx—— 2 postgres postgres 4.0K Jul 24 02:53 pg_snapshots
drwx—— 2 postgres postgres 4.0K Jul 24 02:53 pg_replslot
drwx—— 4 postgres postgres 4.0K Jul 24 02:53 pg_multixact
drwx—— 4 postgres postgres 4.0K Jul 24 02:53 pg_logical
-rw——- 1 postgres postgres 21K Jul 24 02:53 postgresql.conf
-rw——- 1 postgres postgres 88 Jul 24 02:53 postgresql.auto.conf
-rw——- 1 postgres postgres 1.6K Jul 24 02:53 pg_ident.conf
-rw——- 1 postgres postgres 4.2K Jul 24 02:53 pg_hba.conf
drwx—— 3 postgres postgres 4.0K Jul 24 02:53 pg_xlog
drwx—— 2 postgres postgres 4.0K Jul 24 02:53 pg_subtrans
drwx—— 2 postgres postgres 4.0K Jul 24 02:53 pg_clog
drwx—— 2 postgres postgres 4.0K Jul 24 02:53 pg_notify
drwx—— 2 postgres postgres 4.0K Jul 24 02:53 global
drwx—— 5 postgres postgres 4.0K Jul 24 02:53 base
drwx—— 2 postgres postgres 4.0K Jul 24 02:53 pg_log
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ] service postgresql-9.4 start
Starting postgresql-9.4 service: [ OK ]
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ] ps -ef | grep postgres
postgres 2946 1 0 02:53 ? 00:00:00 /usr/pgsql-9.4/bin/postmaster -D /var/lib/pgsql/9.4/data
postgres 2952 2946 0 02:53 ? 00:00:00 postgres: logger process
postgres 2956 2946 0 02:53 ? 00:00:00 postgres: checkpointer process
postgres 2957 2946 0 02:53 ? 00:00:00 postgres: writer process
postgres 2958 2946 0 02:53 ? 00:00:00 postgres: wal writer process
postgres 2959 2946 0 02:53 ? 00:00:00 postgres: autovacuum launcher process
postgres 2960 2946 0 02:53 ? 00:00:00 postgres: stats collector process
root 2997 24468 0 02:54 pts/3 00:00:00 grep postgres
root 28916 20938 0 Jul23 pts/2 00:00:00 su – postgres
postgres 28917 28916 0 Jul23 pts/2 00:00:00 -bash
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ] su postgres
[ postgres @ masterhost : /etc/rc.d/init.d ]
[ postgres @ masterhost : /etc/rc.d/init.d ]
[ postgres @ masterhost : /etc/rc.d/init.d ]
[ postgres @ masterhost : /etc/rc.d/init.d ]
[ postgres @ masterhost : /etc/rc.d/init.d ]
[ postgres @ masterhost : /etc/rc.d/init.d ]
[ postgres @ masterhost : /etc/rc.d/init.d ] psql -d template1 -U postgres
psql (9.4.4)
Type “help” for help.

template1=#
template1=# \h
Available help:
ABORT ALTER SEQUENCE CREATE AGGREGATE CREATE TABLE DROP EVENT TRIGGER DROP TEXT SEARCH TEMPLATE RESET
ALTER AGGREGATE ALTER SERVER CREATE CAST CREATE TABLE AS DROP EXTENSION DROP TRIGGER REVOKE
ALTER COLLATION ALTER SYSTEM CREATE COLLATION CREATE TABLESPACE DROP FOREIGN DATA WRAPPER DROP TYPE ROLLBACK
ALTER CONVERSION ALTER TABLE CREATE CONVERSION CREATE TEXT SEARCH CONFIGURATION DROP FOREIGN TABLE DROP USER ROLLBACK PREPARED
ALTER DATABASE ALTER TABLESPACE CREATE DATABASE CREATE TEXT SEARCH DICTIONARY DROP FUNCTION DROP USER MAPPING ROLLBACK TO SAVEPOINT
ALTER DEFAULT PRIVILEGES ALTER TEXT SEARCH CONFIGURATION CREATE DOMAIN CREATE TEXT SEARCH PARSER DROP GROUP DROP VIEW SAVEPOINT
ALTER DOMAIN ALTER TEXT SEARCH DICTIONARY CREATE EVENT TRIGGER CREATE TEXT SEARCH TEMPLATE DROP INDEX END SECURITY LABEL
ALTER EVENT TRIGGER ALTER TEXT SEARCH PARSER CREATE EXTENSION CREATE TRIGGER DROP LANGUAGE EXECUTE SELECT
ALTER EXTENSION ALTER TEXT SEARCH TEMPLATE CREATE FOREIGN DATA WRAPPER CREATE TYPE DROP MATERIALIZED VIEW EXPLAIN SELECT INTO
ALTER FOREIGN DATA WRAPPER ALTER TRIGGER CREATE FOREIGN TABLE CREATE USER DROP OPERATOR FETCH SET
ALTER FOREIGN TABLE ALTER TYPE CREATE FUNCTION CREATE USER MAPPING DROP OPERATOR CLASS GRANT SET CONSTRAINTS
ALTER FUNCTION ALTER USER CREATE GROUP CREATE VIEW DROP OPERATOR FAMILY INSERT SET ROLE
ALTER GROUP ALTER USER MAPPING CREATE INDEX DEALLOCATE DROP OWNED LISTEN SET SESSION AUTHORIZATION
ALTER INDEX ALTER VIEW CREATE LANGUAGE DECLARE DROP ROLE LOAD SET TRANSACTION
ALTER LANGUAGE ANALYZE CREATE MATERIALIZED VIEW DELETE DROP RULE LOCK SHOW
ALTER LARGE OBJECT BEGIN CREATE OPERATOR DISCARD DROP SCHEMA MOVE START TRANSACTION
ALTER MATERIALIZED VIEW CHECKPOINT CREATE OPERATOR CLASS DO DROP SEQUENCE NOTIFY TABLE
ALTER OPERATOR CLOSE CREATE OPERATOR FAMILY DROP AGGREGATE DROP SERVER PREPARE TRUNCATE
ALTER OPERATOR CLASS CLUSTER CREATE ROLE DROP CAST DROP TABLE PREPARE TRANSACTION UNLISTEN
ALTER OPERATOR FAMILY COMMENT CREATE RULE DROP COLLATION DROP TABLESPACE REASSIGN OWNED UPDATE
ALTER ROLE COMMIT CREATE SCHEMA DROP CONVERSION DROP TEXT SEARCH CONFIGURATION REFRESH MATERIALIZED VIEW VACUUM
ALTER RULE COMMIT PREPARED CREATE SEQUENCE DROP DATABASE DROP TEXT SEARCH DICTIONARY REINDEX VALUES
ALTER SCHEMA COPY CREATE SERVER DROP DOMAIN DROP TEXT SEARCH PARSER RELEASE SAVEPOINT WITH
template1=#
template1=#
[ root @ masterhost : /etc/rc.d/init.d ] netstat -nlp | head -2
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ] netstat -nlp | grep post
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 2946/postmaster
unix 2 [ ACC ] STREAM LISTENING 14231903 2946/postmaster /tmp/.s.PGSQL.5432
[ root @ masterhost : /etc/rc.d/init.d ]

[ root @ masterhost : /etc/rc.d/init.d ] ps -ef | grep postgres
postgres 2946 1 0 02:53 ? 00:00:00 /usr/pgsql-9.4/bin/postmaster -D /var/lib/pgsql/9.4/data
postgres 2952 2946 0 02:53 ? 00:00:00 postgres: logger process
postgres 2956 2946 0 02:53 ? 00:00:00 postgres: checkpointer process
postgres 2957 2946 0 02:53 ? 00:00:00 postgres: writer process
postgres 2958 2946 0 02:53 ? 00:00:00 postgres: wal writer process
postgres 2959 2946 0 02:53 ? 00:00:00 postgres: autovacuum launcher process
postgres 2960 2946 0 02:53 ? 00:00:00 postgres: stats collector process
root 4444 24468 0 03:03 pts/3 00:00:00 grep postgres
root 28916 20938 0 Jul23 pts/2 00:00:00 su – postgres
postgres 28917 28916 0 Jul23 pts/2 00:00:00 -bash
[ root @ masterhost : /etc/rc.d/init.d ]
[ root @ masterhost : /etc/rc.d/init.d ]

Configuration for Replication :-

[ root @ slavehost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 128K
-rwx—— 1 postgres postgres 4 Jul 24 10:47 PG_VERSION
drwx—— 2 postgres postgres 4.0K Jul 24 10:47 pg_twophase
drwx—— 2 postgres postgres 4.0K Jul 24 10:47 pg_tblspc
drwx—— 2 postgres postgres 4.0K Jul 24 10:47 pg_snapshots
drwx—— 2 postgres postgres 4.0K Jul 24 10:47 pg_serial
drwx—— 2 postgres postgres 4.0K Jul 24 10:47 pg_replslot
drwx—— 4 postgres postgres 4.0K Jul 24 10:47 pg_multixact
drwx—— 4 postgres postgres 4.0K Jul 24 10:47 pg_logical
drwx—— 2 postgres postgres 4.0K Jul 24 10:47 pg_dynshmem
drwx—— 2 postgres postgres 4.0K Jul 24 10:47 pg_subtrans
drwx—— 2 postgres postgres 4.0K Jul 24 10:47 pg_clog
drwx—— 5 postgres postgres 4.0K Jul 24 10:47 base
-rwx—— 1 postgres postgres 141 Jul 24 10:50 recovery.done
-rw——- 1 postgres postgres 202 Jul 24 11:18 backup_label.old
drwx—— 3 postgres postgres 4.0K Jul 24 11:23 pg_xlog
-rwx—— 1 postgres postgres 4.2K Jul 24 15:17 pg_hba.conf
-rwx—— 1 postgres postgres 88 Jul 24 15:17 postgresql.auto.conf
-rwx—— 1 postgres postgres 1.6K Jul 24 15:17 pg_ident.conf
-rwx—— 1 postgres postgres 21K Jul 24 15:17 postgresql.conf
-rw——- 1 postgres postgres 80 Jul 24 15:19 postmaster.pid
-rwx—— 1 postgres postgres 59 Jul 24 15:19 postmaster.opts
drwx—— 2 postgres postgres 4.0K Jul 24 15:19 pg_notify
drwx—— 2 postgres postgres 4.0K Jul 24 15:19 pg_stat
drwx—— 2 postgres postgres 4.0K Jul 27 00:00 pg_log
drwx—— 2 postgres postgres 4.0K Jul 27 02:20 global
drwx—— 2 postgres postgres 4.0K Jul 27 02:20 pg_stat_tmp
[ root @ slavehost : /var/lib/pgsql/9.4/data ]
[ root @ slavehost : /var/lib/pgsql/9.4/data ] grep -v “#” pg_hba.conf
host replication rep 10.116.175.107/32 md5

local all all peer
host all all 127.0.0.1/32 ident
host all all ::1/128 ident
[ root @ slavehost : /var/lib/pgsql/9.4/data ]
[ root @ slavehost : /var/lib/pgsql/9.4/data ]
[ root @ slavehost : /var/lib/pgsql/9.4/data ]
[ root @ slavehost : /var/lib/pgsql/9.4/data ]
[ root @ slavehost : /var/lib/pgsql/9.4/data ]
[ root @ slavehost : /var/lib/pgsql/9.4/data ]
[ root @ slavehost : /var/lib/pgsql/9.4/data ] grep -v “#” postgresql.conf

listen_addresses = ‘localhost,10.42.105.44’
wal_level = ‘hot_standby’
max_wal_senders = 1

[ root @ slavehost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] grep -v ‘#’ pg_hba.conf
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] grep -v ‘#’ postgresql.conf

listen_addresses = ‘localhost,10.116.175.107’
wal_level = ‘hot_standby’
archive_mode = on
archive_command = ‘cd .’
max_wal_senders = 1
hot_standby = on
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
Enbling Open SSH
[ root @ masterhost : /etc/opt/SSHtectia/keys ] /opt/tectia/util/generate_keys postgres
Attempt to generate key pair for postgres…
Generating 2048-bit rsa key pair
6 Oo.oOo.ooOo.
Key generated.
2048-bit rsa, postgres@masterhost, Fri Jul 24 2015 08:32:32 -0400
Private key saved to /etc/opt/SSHtectia/keys/postgres/id_rsa_2048_a
Public key saved to /etc/opt/SSHtectia/keys/postgres/id_rsa_2048_a.pub
Successfully generated the key pair for user postgres.
Please enter IP address(es) or hostname(s) of trusted SSH client machine(s) separated by space:

WARNING: Trusted host relationship is not set up.
[ root @ masterhost : /etc/opt/SSHtectia/keys ]
[ root @ masterhost : /etc/opt/SSHtectia/keys ]
[ root @ masterhost : /etc/opt/SSHtectia/keys ]
[ root @ masterhost : /etc/opt/SSHtectia/keys ] cd postgres/
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ] ls -lthr
total 16K
-r——– 1 postgres root 1.6K Jul 24 08:32 id_rsa_2048_a
-r–r–r– 1 root root 539 Jul 24 08:32 id_rsa_2048_a.pub
-r–r–r– 1 root root 203 Jul 24 08:32 authorization
-r–r–r– 1 root root 136 Jul 24 08:32 identification
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ] ls
authorization identification id_rsa_2048_a id_rsa_2048_a.pub
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ] cp id_rsa_2048_a.pub postgres_masterhost_id_rsa_2048_a.pub
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ] su – postgres
-bash-4.1$ ssh localhost
warning: Host key for the host “localhost” not found from store.

@@
@@ WARNING: CLIENT ACCEPTED CONNECTION TO UNKNOWN HOST
@@ BECAUSE OF CONFIGURATION!
@@

Please make sure that this server is the one you want to connect to.
Accepting connection to unknown host may lead to a security vulnerability.

The new host key will be saved and this warning message will not be reported
next time the connection to this host is made.

The fingerprint of the host public key is:
Babble: xulad-hybas-lydap-byhih-cubob-ranyp-tidid-gevag-munat-mytod-kixix
RFC4716: df:a6:7b:be:4a:6e:cf:1a:52:0c:94:ff:b2:10:85:c4
You are authorized to use this System for approved business purposes only.
Use for any other purpose is prohibited. All transactional records, reports,
email, software and other data generated by or residing upon this System,
to the extent permitted by local law, are the property of dbversitygroup Inc.
or one of its subsidiaries or their affiliates
(individually or collectively ‘ dbversitygroup ‘) and may be used by dbversitygroup
for any purpose authorized and permissible in your country of work.
Activities on this System are monitored to the extent permitted by local law.
-bash-4.1$ logout
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ] passwd postgres
Changing password for user postgres.

You can now choose the new password.

A valid password should be a mix of upper and lower case letters,
digits, and other characters. You can use a 6 character long
password with characters from at least 2 of these 4 classes.
An upper case letter that begins the password and a digit that
ends it do not count towards the number of character classes used,
unless disable_firstupper_lastdigit_check option is enabled.

Enter new password:
Weak password: based on personal login information.
Re-type new password:
passwd: all authentication tokens updated successfully.
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ] scp postgres_masterhost_id_rsa_2048_a.pub postgres@slavehost:/tmp/.

You are authorized to use this System for approved business purposes only.
Use for any other purpose is prohibited. All transactional records, reports,
email, software and other data generated by or residing upon this System,
to the extent permitted by local law, are the property of dbversitygroup Inc.
or one of its subsidiaries or their affiliates
(individually or collectively ‘ dbversitygroup ‘) and may be used by dbversitygroup
for any purpose authorized and permissible in your country of work.
Activities on this System are monitored to the extent permitted by local law.
PAM Authentication
Password:
postgres_masterhost_id_rsa_2048_a.pub | 539B | 5.8kiB/s | TOC: 00:00:00 | 100%
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ] su postgres
[ postgres @ masterhost : /etc/opt/SSHtectia/keys/postgres ] cp /tmp/postgres_slavehost_id_rsa_2048_a.pub .
cp: cannot create regular file `./postgres_slavehost_id_rsa_2048_a.pub’: Permission denied
[ postgres @ masterhost : /etc/opt/SSHtectia/keys/postgres ] exit
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ] cp /tmp/postgres_slavehost_id_rsa_2048_a.pub .
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ] su –
[ root @ masterhost : ~ ] su – postgres
-bash-4.1$ ssh slavehost
warning: Host key for the host “slavehost” not found from store.

@@
@@ WARNING: CLIENT ACCEPTED CONNECTION TO UNKNOWN HOST
@@ BECAUSE OF CONFIGURATION!
@@

Please make sure that this server is the one you want to connect to.
Accepting connection to unknown host may lead to a security vulnerability.

The new host key will be saved and this warning message will not be reported
next time the connection to this host is made.

The fingerprint of the host public key is:
Babble: xemor-durib-patad-bevuz-suzaz-zytis-nylop-dedoh-sufym-fodyk-syxux
RFC4716: ae:03:c7:d1:c7:c4:c5:f2:c2:f7:7c:41:6f:66:12:1d
You are authorized to use this System for approved business purposes only.
Use for any other purpose is prohibited. All transactional records, reports,
email, software and other data generated by or residing upon this System,
to the extent permitted by local law, are the property of dbversitygroup Inc.
or one of its subsidiaries or their affiliates
(individually or collectively ‘ dbversitygroup ‘) and may be used by dbversitygroup
for any purpose authorized and permissible in your country of work.
Activities on this System are monitored to the extent permitted by local law.
Last login: Fri Jul 24 2015 08:38:33 -0400 from masterhost.nam.nsroot.net
-bash-4.1$ logout
[ root @ masterhost : ~ ] logout
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ] vi authorization
# SSH Tectia authorized public key in UserConfigDirectory
Key id_rsa_2048_a.pub
Options command=”eval $SSH_ORIGINAL_COMMAND”

Key postgres_slavehost_id_rsa_2048_a.pub
Options command=”eval $SSH_ORIGINAL_COMMAND”
# OpenSSH authorized public key in UserConfigDirectory
Key authorized_keys2
~
~
~
“authorization” 8L, 292C written
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ root @ masterhost : /etc/opt/SSHtectia/keys/postgres ] su postgres
[ postgres @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ postgres @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ postgres @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ postgres @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ postgres @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ postgres @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ postgres @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ postgres @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ postgres @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ postgres @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ postgres @ masterhost : /etc/opt/SSHtectia/keys/postgres ] hostname -i
10.116.175.107
[ postgres @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ postgres @ masterhost : /etc/opt/SSHtectia/keys/postgres ]
[ postgres @ masterhost : /etc/opt/SSHtectia/keys/postgres ] exit
Configuration

[ postgres @ masterhost : ~/9.4/data/pg_log ] psql
psql (9.4.4)
Type “help” for help.

postgres=#
postgres=# select * from rep_test;
ERROR: relation “rep_test” does not exist
LINE 1: select * from rep_test;
^
postgres=#
postgres=#
postgres=# show tables;
ERROR: unrecognized configuration parameter “tables”
postgres=#
postgres=#
postgres=# INSERT INTO rep_test VALUES (‘oops’);
ERROR: relation “rep_test” does not exist
LINE 1: INSERT INTO rep_test VALUES (‘oops’);
^
postgres=#
postgres=#
postgres=# show tables;
ERROR: unrecognized configuration parameter “tables”
postgres=#
postgres=#
postgres=#
postgres=#
postgres=#
postgres=# CREATE TABLE rep_test (test varchar(40));
CREATE TABLE
postgres=#
postgres=#
postgres=# INSERT INTO rep_test VALUES (‘oops’);
INSERT 0 1
postgres=#
postgres=#
postgres=# select * from rep_test;
test
——
oops
(1 row)

postgres=# \q
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ] exit
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ] /etc/rc.d/init.d/postgresql-9.4 restart
Stopping postgresql-9.4 service: [ OK ]
Starting postgresql-9.4 service: [ OK ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ] su postgres
[ postgres @ masterhost : ~/9.4 ]
[ postgres @ masterhost : ~/9.4 ]
[ postgres @ masterhost : ~/9.4 ]
[ postgres @ masterhost : ~/9.4 ]
[ postgres @ masterhost : ~/9.4 ]
[ postgres @ masterhost : ~/9.4 ]
[ postgres @ masterhost : ~/9.4 ]
[ postgres @ masterhost : ~/9.4 ]
[ postgres @ masterhost : ~/9.4 ] tailf postgresql-Fri.log
tailf: cannot stat “postgresql-Fri.log”: No such file or directory
[ postgres @ masterhost : ~/9.4 ]
[ postgres @ masterhost : ~/9.4 ]
[ postgres @ masterhost : ~/9.4 ]
[ postgres @ masterhost : ~/9.4 ] cd data/
backup_label.old pg_clog/ pg_ident.conf pg_multixact/ pg_serial/ pg_stat_tmp/ pg_twophase/ postgresql.auto.conf postmaster.pid
base/ pg_dynshmem/ pg_log/ pg_notify/ pg_snapshots/ pg_subtrans/ PG_VERSION postgresql.conf
global/ pg_hba.conf pg_logical/ pg_replslot/ pg_stat/ pg_tblspc/ pg_xlog/ postmaster.opts
[ postgres @ masterhost : ~/9.4 ] cd data/pg_log
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ] tailf postgresql-Fri.log
< 2015-07-24 10:08:27.125 EDT >STATEMENT: show tables;
< 2015-07-24 10:10:06.819 EDT >LOG: received fast shutdown request
< 2015-07-24 10:10:06.819 EDT >LOG: aborting any active transactions
< 2015-07-24 10:10:06.819 EDT >LOG: autovacuum launcher shutting down
< 2015-07-24 10:10:06.820 EDT >LOG: shutting down
< 2015-07-24 10:10:06.865 EDT >LOG: database system is shut down
< 2015-07-24 10:10:07.901 EDT >LOG: database system was shut down at 2015-07-24 10:10:06 EDT
< 2015-07-24 10:10:07.903 EDT >LOG: MultiXact member wraparound protections are now enabled
< 2015-07-24 10:10:07.905 EDT >LOG: autovacuum launcher started
< 2015-07-24 10:10:07.906 EDT >LOG: database system is ready to accept connections

^C
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ] data
bash: data: command not found
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ] date
Fri Jul 24 10:10:42 EDT 2015
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ] psql
psql (9.4.4)
Type “help” for help.

postgres=#
postgres=#
postgres=# select * from rep_test;
test
——
oops
(1 row)

postgres=#
postgres=#
postgres=# INSERT INTO rep_test VALUES (‘oops’);
INSERT 0 1
postgres=#
postgres=#
postgres=# INSERT INTO rep_test VALUES (‘oops’);
INSERT 0 1
postgres=#
postgres=#
postgres=#
postgres=#
postgres=#
postgres=# \q
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ]
[ postgres @ masterhost : ~/9.4/data/pg_log ] exit
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ] /etc/rc.d/init.d/postgresql-9.4 stop
Stopping postgresql-9.4 service:

[ OK ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ] cd data
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 120K
drwx—— 2 postgres postgres 4.0K Jul 24 09:50 pg_twophase
drwx—— 2 postgres postgres 4.0K Jul 24 09:50 pg_tblspc
drwx—— 2 postgres postgres 4.0K Jul 24 09:50 pg_replslot
drwx—— 2 postgres postgres 4.0K Jul 24 09:50 pg_dynshmem
drwx—— 2 postgres postgres 4.0K Jul 24 09:50 pg_snapshots
drwx—— 2 postgres postgres 4.0K Jul 24 09:50 pg_serial
drwx—— 4 postgres postgres 4.0K Jul 24 09:50 pg_multixact
drwx—— 5 postgres postgres 4.0K Jul 24 09:50 base
-rwx—— 1 postgres postgres 22K Jul 24 09:50 postgresql.conf
drwx—— 2 postgres postgres 4.0K Jul 24 09:50 pg_subtrans
drwx—— 4 postgres postgres 4.0K Jul 24 09:50 pg_logical
drwx—— 2 postgres postgres 4.0K Jul 24 09:50 pg_clog
-rwx—— 1 postgres postgres 4.2K Jul 24 09:50 pg_hba.conf
-rwx—— 1 postgres postgres 1.6K Jul 24 09:50 pg_ident.conf
drwx—— 2 postgres postgres 4.0K Jul 24 09:50 pg_log
-rwx—— 1 postgres postgres 202 Jul 24 09:50 backup_label.old
-rwx—— 1 postgres postgres 88 Jul 24 09:50 postgresql.auto.conf
-rwx—— 1 postgres postgres 4 Jul 24 09:50 PG_VERSION
drwx—— 2 postgres postgres 4.0K Jul 24 10:10 pg_notify
-rwx—— 1 postgres postgres 59 Jul 24 10:10 postmaster.opts
drwx—— 2 postgres postgres 4.0K Jul 24 10:11 global
drwx—— 3 postgres postgres 4.0K Jul 24 10:11 pg_xlog
drwx—— 2 postgres postgres 4.0K Jul 24 10:11 pg_stat_tmp
drwx—— 2 postgres postgres 4.0K Jul 24 10:11 pg_stat
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] rm -rf *
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cp /tmp/pg_xlog/ .
cp: omitting directory `/tmp/pg_xlog/’
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 0
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cp /tmp/pg_xlog/ . -R
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 4.0K
drwx—— 3 root root 4.0K Jul 24 10:12 pg_xlog
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] chown postgres:postgres * -R
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] chown 700 * -R
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 8.0K
drwx—— 3 700 postgres 4.0K Jul 24 10:12 pg_xlog
drwxr-xr-x 5 postgres postgres 4.0K Jul 24 10:15 base
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 8.0K
drwx—— 3 700 postgres 4.0K Jul 24 10:12 pg_xlog
drwxr-xr-x 5 postgres postgres 4.0K Jul 24 10:15 base
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 8.0K
drwx—— 3 700 postgres 4.0K Jul 24 10:12 pg_xlog
drwxr-xr-x 5 postgres postgres 4.0K Jul 24 10:15 base
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 8.0K
drwx—— 3 700 postgres 4.0K Jul 24 10:12 pg_xlog
drwxr-xr-x 5 postgres postgres 4.0K Jul 24 10:15 base
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 8.0K
drwx—— 3 700 postgres 4.0K Jul 24 10:12 pg_xlog
drwxr-xr-x 5 postgres postgres 4.0K Jul 24 10:15 base
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 28K
drwx—— 3 700 postgres 4.0K Jul 24 10:12 pg_xlog
drwxr-xr-x 5 postgres postgres 4.0K Jul 24 10:15 base
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 global
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_clog
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_dynshmem
-rw-r–r– 1 postgres postgres 4.2K Jul 24 10:15 pg_hba.conf
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 124K
drwx—— 3 700 postgres 4.0K Jul 24 10:12 pg_xlog
drwxr-xr-x 5 postgres postgres 4.0K Jul 24 10:15 base
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 global
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_clog
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_dynshmem
-rw-r–r– 1 postgres postgres 4.2K Jul 24 10:15 pg_hba.conf
-rw-r–r– 1 postgres postgres 1.6K Jul 24 10:15 pg_ident.conf
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_log
drwxr-xr-x 4 postgres postgres 4.0K Jul 24 10:15 pg_logical
drwxr-xr-x 4 postgres postgres 4.0K Jul 24 10:15 pg_multixact
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_notify
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_replslot
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_serial
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_snapshots
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_stat
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_stat_tmp
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_subtrans
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_tblspc
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_twophase
-rw-r–r– 1 postgres postgres 4 Jul 24 10:15 PG_VERSION
-rw-r–r– 1 postgres postgres 88 Jul 24 10:15 postgresql.auto.conf
-rw-r–r– 1 postgres postgres 22K Jul 24 10:15 postgresql.conf
-rw-r–r– 1 postgres postgres 59 Jul 24 10:15 postmaster.opts
-rw-r–r– 1 postgres postgres 81 Jul 24 10:15 postmaster.pid
-rw-r–r– 1 postgres postgres 141 Jul 24 10:15 recovery.conf
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] chown postgres:postgres * -R
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cp /tmp/pg_xlog/ . -R
cp: overwrite `./pg_xlog/000000010000000000000001′? y
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 124K
drwx—— 3 postgres postgres 4.0K Jul 24 10:12 pg_xlog
drwxr-xr-x 5 postgres postgres 4.0K Jul 24 10:15 base
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 global
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_clog
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_dynshmem
-rw-r–r– 1 postgres postgres 4.2K Jul 24 10:15 pg_hba.conf
-rw-r–r– 1 postgres postgres 1.6K Jul 24 10:15 pg_ident.conf
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_log
drwxr-xr-x 4 postgres postgres 4.0K Jul 24 10:15 pg_logical
drwxr-xr-x 4 postgres postgres 4.0K Jul 24 10:15 pg_multixact
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_notify
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_replslot
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_serial
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_snapshots
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_stat
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_stat_tmp
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_subtrans
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_tblspc
drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_twophase
-rw-r–r– 1 postgres postgres 4 Jul 24 10:15 PG_VERSION
-rw-r–r– 1 postgres postgres 88 Jul 24 10:15 postgresql.auto.conf
-rw-r–r– 1 postgres postgres 22K Jul 24 10:15 postgresql.conf
-rw-r–r– 1 postgres postgres 59 Jul 24 10:15 postmaster.opts
-rw-r–r– 1 postgres postgres 81 Jul 24 10:15 postmaster.pid
-rw-r–r– 1 postgres postgres 141 Jul 24 10:15 recovery.conf
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] vi pg_hba.conf
# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the “Client Authentication” section in the PostgreSQL
# documentation for a complete description of this file. A short
# synopsis follows.
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access. Records take one of these forms:
#
# local DATABASE USER METHOD [OPTIONS]
# host DATABASE USER ADDRESS METHOD [OPTIONS]
host replication rep 10.42.105.44/32 md5

# hostssl DATABASE USER ADDRESS METHOD [OPTIONS]
# hostnossl DATABASE USER ADDRESS METHOD [OPTIONS]
#
# (The uppercase items must be replaced by actual values.)
#
# The first field is the connection type: “local” is a Unix-domain
# socket, “host” is either a plain or SSL-encrypted TCP/IP socket,
# “hostssl” is an SSL-encrypted TCP/IP socket, and “hostnossl” is a
# plain TCP/IP socket.
#
# DATABASE can be “all”, “sameuser”, “samerole”, “replication”, a
# database name, or a comma-separated list thereof. The “all”
# keyword does not match “replication”. Access to replication
# must be enabled in a separate record (see example below).
#
# USER can be “all”, a user name, a group name prefixed with “+”, or a
# comma-separated list thereof. In both the DATABASE and USER fields
# you can also write a file name prefixed with “@” to include names
# from a separate file.
#
# ADDRESS specifies the set of hosts the record matches. It can be a
# host name, or it is made up of an IP address and a CIDR mask that is
# an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
# specifies the number of significant bits in the mask. A host name
# that starts with a dot (.) matches a suffix of the actual host name.
# Alternatively, you can write an IP address and netmask in separate
# columns to specify the set of hosts. Instead of a CIDR-address, you
# can write “samehost” to match any of the server’s own IP addresses,
# or “samenet” to match any address in any subnet that the server is
# directly connected to.
#
# METHOD can be “trust”, “reject”, “md5”, “password”, “gss”, “sspi”,
# “ident”, “peer”, “pam”, “ldap”, “radius” or “cert”. Note that
# “password” sends passwords in clear text; “md5” is preferred since
# it sends encrypted passwords.
#
# OPTIONS are a set of options for the authentication in the format
# NAME=VALUE. The available options depend on the different
# authentication methods — refer to the “Client Authentication”
# section in the documentation for a list of which options are
# available for which authentication methods.
#
# Database and user names containing spaces, commas, quotes and other
“pg_hba.conf” 91L, 4281C written
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] vi postgresql.conf
# —————————–
# PostgreSQL configuration file
# —————————–
#
# This file consists of lines of the form:
#
# name = value
#
# (The “=” is optional.) 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 PostgreSQL documentation.
#
# The commented-out settings shown in this file represent the default values.
# Re-commenting a setting is NOT sufficient to revert it to the default value;
# you need to reload the server.
#
# 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 “pg_ctl reload”. Some
# parameters, which are marked below, require a server shutdown and restart to
# take effect.
#
# Any parameter can also be given as a command-line option to the server, e.g.,
# “postgres -c log_connections=on”. Some parameters can be changed at run time
# with the “SET” SQL command.
#
# Memory units: kB = kilobytes Time units: ms = milliseconds
# MB = megabytes s = seconds
# GB = gigabytes min = minutes
# TB = terabytes h = hours
# d = days
#——————————————————————————
# FILE LOCATIONS
#——————————————————————————

# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.

#data_directory = ‘ConfigDir’ # use data in another directory
# (change requires restart)
#hba_file = ‘ConfigDir/pg_hba.conf’ # host-based authentication file
# (change requires restart)
#ident_file = ‘ConfigDir/pg_ident.conf’ # ident configuration file
# (change requires restart)

# If external_pid_file is not explicitly set, no extra PID file is written.
#external_pid_file = ” # write an extra PID file
# (change requires restart)
#——————————————————————————
# CONNECTIONS AND AUTHENTICATION
#——————————————————————————

# – Connection Settings –

“postgresql.conf” 631L, 21561C
#——————————————————————————
# VERSION/PLATFORM COMPATIBILITY
#——————————————————————————

# – Previous PostgreSQL Versions –

#array_nulls = on
#backslash_quote = safe_encoding # on, off, or safe_encoding
#default_with_oids = off
#escape_string_warning = on
#lo_compat_privileges = off
#quote_all_identifiers = off
#sql_inheritance = on
#standard_conforming_strings = on
#synchronize_seqscans = on

# – Other Platforms and Clients –

#transform_null_equals = off
#——————————————————————————
# ERROR HANDLING
#——————————————————————————

#exit_on_error = off # terminate session on any error?
#restart_after_crash = on # reinitialize after backend crash?
#——————————————————————————
# CONFIG FILE INCLUDES
#——————————————————————————

# These options allow settings to be loaded from files other than the
# default postgresql.conf.

#include_dir = ‘conf.d’ # include files ending in ‘.conf’ from
# directory ‘conf.d’
#include_if_exists = ‘exists.conf’ # include file only if it exists
#include = ‘special.conf’ # include file
#——————————————————————————
# CUSTOMIZED OPTIONS
#——————————————————————————

# Add settings for extensions here

listen_addresses = ‘localhost,10.116.175.107’
wal_level = ‘hot_standby’
archive_mode = on
archive_command = ‘cd .’
max_wal_senders = 1
hot_standby = on
“postgresql.conf” 631L, 21563C written
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] /etc/rc.d/init.d/postgresql-9.4 start
Starting postgresql-9.4 service: [FAILED]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] /etc/rc.d/init.d/postgresql-9.4 stop
Stopping postgresql-9.4 service: [ OK ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] /etc/rc.d/init.d/postgresql-9.4 start
Starting postgresql-9.4 service: [FAILED]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lths
total 120K
4.0K -rw-r–r– 1 postgres postgres 59 Jul 24 10:20 postmaster.opts
4.0K drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:20 pg_notify
4.0K drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:20 global
24K -rw-r–r– 1 postgres postgres 22K Jul 24 10:18 postgresql.conf
8.0K -rw-r–r– 1 postgres postgres 4.2K Jul 24 10:17 pg_hba.conf
4.0K -rw-r–r– 1 postgres postgres 141 Jul 24 10:15 recovery.conf
4.0K -rw-r–r– 1 postgres postgres 88 Jul 24 10:15 postgresql.auto.conf
4.0K -rw-r–r– 1 postgres postgres 4 Jul 24 10:15 PG_VERSION
4.0K drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_twophase
4.0K drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_tblspc
4.0K drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_subtrans
4.0K drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_stat_tmp
4.0K drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_stat
4.0K drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_snapshots
4.0K drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_serial
4.0K drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_replslot
4.0K drwxr-xr-x 4 postgres postgres 4.0K Jul 24 10:15 pg_multixact
4.0K drwxr-xr-x 4 postgres postgres 4.0K Jul 24 10:15 pg_logical
4.0K drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_log
4.0K -rw-r–r– 1 postgres postgres 1.6K Jul 24 10:15 pg_ident.conf
4.0K drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_dynshmem
4.0K drwxr-xr-x 2 postgres postgres 4.0K Jul 24 10:15 pg_clog
4.0K drwxr-xr-x 5 postgres postgres 4.0K Jul 24 10:15 base
4.0K drwx—— 3 postgres postgres 4.0K Jul 24 10:12 pg_xlog
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cd ..
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ] ls -lhtr
total 16K
drwx—— 19 postgres postgres 4.0K Jul 24 09:23 data_old
-rw——- 1 postgres postgres 5.3K Jul 24 10:20 pgstartup.log
drwx—— 19 postgres postgres 4.0K Jul 24 10:20 data
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ] cat pgstartup.log
The files belonging to this database system will be owned by user “postgres”.
This user must also own the server process.

The database cluster will be initialized with locale “en_US.UTF-8”.
The default database encoding has accordingly been set to “UTF8”.
The default text search configuration will be set to “english”.

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/pgsql/9.4/data … ok
creating subdirectories … ok
selecting default max_connections … 100
selecting default shared_buffers … 128MB
selecting dynamic shared memory implementation … posix
creating configuration files … ok
creating template1 database in /var/lib/pgsql/9.4/data/base/1 … ok
initializing pg_authid … ok
initializing dependencies … ok
creating system views … ok
loading system objects’ descriptions … ok
creating collations … ok
creating conversions … ok
creating dictionaries … ok
setting privileges on built-in objects … ok
creating information schema … ok
loading PL/pgSQL server-side language … ok
vacuuming database template1 … ok
copying template1 to template0 … ok
copying template1 to postgres … ok
syncing data to disk … ok

Success. You can now start the database server using:

/usr/pgsql-9.4/bin/postgres -D /var/lib/pgsql/9.4/data
or
/usr/pgsql-9.4/bin/pg_ctl -D /var/lib/pgsql/9.4/data -l logfile start

The files belonging to this database system will be owned by user “postgres”.
This user must also own the server process.

The database cluster will be initialized with locale “en_US.UTF-8”.
The default database encoding has accordingly been set to “UTF8”.
The default text search configuration will be set to “english”.

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/pgsql/9.4/data … ok
creating subdirectories … ok
selecting default max_connections … 100
selecting default shared_buffers … 128MB
selecting dynamic shared memory implementation … posix
creating configuration files … ok
creating template1 database in /var/lib/pgsql/9.4/data/base/1 … ok
initializing pg_authid … ok
initializing dependencies … ok
creating system views … ok
loading system objects’ descriptions … ok
creating collations … ok
creating conversions … ok
creating dictionaries … ok
setting privileges on built-in objects … ok
creating information schema … ok
loading PL/pgSQL server-side language … ok
vacuuming database template1 … ok
copying template1 to template0 … ok
copying template1 to postgres … ok
syncing data to disk … ok

Success. You can now start the database server using:

/usr/pgsql-9.4/bin/postgres -D /var/lib/pgsql/9.4/data
or
/usr/pgsql-9.4/bin/pg_ctl -D /var/lib/pgsql/9.4/data -l logfile start

< 2015-07-24 07:48:26.027 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 07:48:26.055 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 07:48:26.055 EDT >HINT: Future log output will appear in directory “pg_log”.
runuser: cannot set groups: Operation not permitted
< 2015-07-24 09:11:05.037 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 09:11:05.066 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 09:11:05.066 EDT >HINT: Future log output will appear in directory “pg_log”.
runuser: cannot set groups: Operation not permitted
< 2015-07-24 09:55:56.290 EDT >FATAL: data directory “/var/lib/pgsql/9.4/data” has group or world access
< 2015-07-24 09:55:56.290 EDT >DETAIL: Permissions should be u=rwx (0700).
< 2015-07-24 09:59:49.442 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 09:59:49.444 EDT >LOG: could not bind IPv4 socket: Cannot assign requested address
< 2015-07-24 09:59:49.444 EDT >HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
< 2015-07-24 09:59:49.444 EDT >WARNING: could not create listen socket for “10.42.105.44”
< 2015-07-24 09:59:49.458 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 09:59:49.458 EDT >HINT: Future log output will appear in directory “pg_log”.
< 2015-07-24 10:10:07.884 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 10:10:07.885 EDT >LOG: could not bind IPv4 socket: Cannot assign requested address
< 2015-07-24 10:10:07.885 EDT >HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
< 2015-07-24 10:10:07.885 EDT >WARNING: could not create listen socket for “10.42.105.44”
< 2015-07-24 10:10:07.899 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 10:10:07.899 EDT >HINT: Future log output will appear in directory “pg_log”.
< 2015-07-24 10:20:17.038 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 10:20:17.058 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 10:20:17.058 EDT >HINT: Future log output will appear in directory “pg_log”.
< 2015-07-24 10:20:28.527 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 10:20:28.546 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 10:20:28.546 EDT >HINT: Future log output will appear in directory “pg_log”.
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ] cd data/pg_log
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] ll -lhtr
total 4.0K
-rw-r–r– 1 postgres postgres 3.0K Jul 24 10:20 postgresql-Fri.log
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] cat postgresql-Fri.log
< 2015-07-24 07:48:26.057 EDT >LOG: database system was shut down at 2015-07-24 07:47:51 EDT
< 2015-07-24 07:48:26.065 EDT >LOG: MultiXact member wraparound protections are now enabled
< 2015-07-24 07:48:26.067 EDT >LOG: database system is ready to accept connections
< 2015-07-24 07:48:26.067 EDT >LOG: autovacuum launcher started
< 2015-07-24 07:48:34.117 EDT >LOG: provided user name (postgres) and authenticated user name (root) do not match
< 2015-07-24 07:48:34.117 EDT >FATAL: Peer authentication failed for user “postgres”
< 2015-07-24 07:48:34.117 EDT >DETAIL: Connection matched pg_hba.conf line 80: “local all all peer”
< 2015-07-24 09:11:03.993 EDT >LOG: received fast shutdown request
< 2015-07-24 09:11:03.993 EDT >LOG: aborting any active transactions
< 2015-07-24 09:11:03.993 EDT >LOG: autovacuum launcher shutting down
< 2015-07-24 09:11:03.994 EDT >LOG: shutting down
< 2015-07-24 09:11:04.006 EDT >LOG: database system is shut down
< 2015-07-24 09:11:05.068 EDT >LOG: database system was shut down at 2015-07-24 09:11:04 EDT
< 2015-07-24 09:11:05.076 EDT >LOG: MultiXact member wraparound protections are now enabled
< 2015-07-24 09:11:05.085 EDT >LOG: database system is ready to accept connections
< 2015-07-24 09:11:05.085 EDT >LOG: autovacuum launcher started
< 2015-07-24 09:24:23.826 EDT >FATAL: role “root” does not exist
< 2015-07-24 10:13:59.657 EDT >FATAL: could not open archive status directory “pg_xlog/archive_status”: Permission denied
< 2015-07-24 10:13:59.658 EDT >LOG: archiver process (PID 10760) exited with exit code 1
< 2015-07-24 10:13:59.658 EDT >FATAL: could not open archive status directory “pg_xlog/archive_status”: Permission denied
< 2015-07-24 10:13:59.659 EDT >LOG: archiver process (PID 20904) exited with exit code 1
< 2015-07-24 10:20:17.060 EDT >LOG: database system was interrupted; last known up at 2015-07-24 10:14:35 EDT
< 2015-07-24 10:20:17.088 EDT >LOG: entering standby mode
< 2015-07-24 10:20:17.088 EDT >LOG: invalid primary checkpoint record
< 2015-07-24 10:20:17.088 EDT >LOG: invalid secondary checkpoint record
< 2015-07-24 10:20:17.088 EDT >PANIC: could not locate a valid checkpoint record
< 2015-07-24 10:20:17.088 EDT >LOG: startup process (PID 16587) was terminated by signal 6: Aborted
< 2015-07-24 10:20:17.088 EDT >LOG: aborting startup due to startup process failure
< 2015-07-24 10:20:28.548 EDT >LOG: database system was interrupted; last known up at 2015-07-24 10:14:35 EDT
< 2015-07-24 10:20:28.575 EDT >LOG: entering standby mode
< 2015-07-24 10:20:28.576 EDT >LOG: invalid primary checkpoint record
< 2015-07-24 10:20:28.576 EDT >LOG: invalid secondary checkpoint record
< 2015-07-24 10:20:28.576 EDT >PANIC: could not locate a valid checkpoint record
< 2015-07-24 10:20:28.576 EDT >LOG: startup process (PID 16661) was terminated by signal 6: Aborted
< 2015-07-24 10:20:28.576 EDT >LOG: aborting startup due to startup process failure
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] ps -ef | grep postgres
root 17003 30569 0 10:22 pts/3 00:00:00 grep postgres
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] chown postgres:postgres * -R
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] cd ..
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cd ..
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ] chown postgres:postgres * -R
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ] chown 700 * -R
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ] ls -lhtr
total 16K
drwx—— 19 700 postgres 4.0K Jul 24 09:23 data_old
-rw——- 1 700 postgres 5.3K Jul 24 10:20 pgstartup.log
drwx—— 19 700 postgres 4.0K Jul 24 10:20 data
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ] /etc/rc.d/init.d/postgresql-9.4 start
Starting postgresql-9.4 service: [FAILED]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ] cat postgresql-Fri.log
cat: postgresql-Fri.log: No such file or directory
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ] cd data
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cd pg_log
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] cat postgresql-Fri.log
< 2015-07-24 07:48:26.057 EDT >LOG: database system was shut down at 2015-07-24 07:47:51 EDT
< 2015-07-24 07:48:26.065 EDT >LOG: MultiXact member wraparound protections are now enabled
< 2015-07-24 07:48:26.067 EDT >LOG: database system is ready to accept connections
< 2015-07-24 07:48:26.067 EDT >LOG: autovacuum launcher started
< 2015-07-24 07:48:34.117 EDT >LOG: provided user name (postgres) and authenticated user name (root) do not match
< 2015-07-24 07:48:34.117 EDT >FATAL: Peer authentication failed for user “postgres”
< 2015-07-24 07:48:34.117 EDT >DETAIL: Connection matched pg_hba.conf line 80: “local all all peer”
< 2015-07-24 09:11:03.993 EDT >LOG: received fast shutdown request
< 2015-07-24 09:11:03.993 EDT >LOG: aborting any active transactions
< 2015-07-24 09:11:03.993 EDT >LOG: autovacuum launcher shutting down
< 2015-07-24 09:11:03.994 EDT >LOG: shutting down
< 2015-07-24 09:11:04.006 EDT >LOG: database system is shut down
< 2015-07-24 09:11:05.068 EDT >LOG: database system was shut down at 2015-07-24 09:11:04 EDT
< 2015-07-24 09:11:05.076 EDT >LOG: MultiXact member wraparound protections are now enabled
< 2015-07-24 09:11:05.085 EDT >LOG: database system is ready to accept connections
< 2015-07-24 09:11:05.085 EDT >LOG: autovacuum launcher started
< 2015-07-24 09:24:23.826 EDT >FATAL: role “root” does not exist
< 2015-07-24 10:13:59.657 EDT >FATAL: could not open archive status directory “pg_xlog/archive_status”: Permission denied
< 2015-07-24 10:13:59.658 EDT >LOG: archiver process (PID 10760) exited with exit code 1
< 2015-07-24 10:13:59.658 EDT >FATAL: could not open archive status directory “pg_xlog/archive_status”: Permission denied
< 2015-07-24 10:13:59.659 EDT >LOG: archiver process (PID 20904) exited with exit code 1
< 2015-07-24 10:20:17.060 EDT >LOG: database system was interrupted; last known up at 2015-07-24 10:14:35 EDT
< 2015-07-24 10:20:17.088 EDT >LOG: entering standby mode
< 2015-07-24 10:20:17.088 EDT >LOG: invalid primary checkpoint record
< 2015-07-24 10:20:17.088 EDT >LOG: invalid secondary checkpoint record
< 2015-07-24 10:20:17.088 EDT >PANIC: could not locate a valid checkpoint record
< 2015-07-24 10:20:17.088 EDT >LOG: startup process (PID 16587) was terminated by signal 6: Aborted
< 2015-07-24 10:20:17.088 EDT >LOG: aborting startup due to startup process failure
< 2015-07-24 10:20:28.548 EDT >LOG: database system was interrupted; last known up at 2015-07-24 10:14:35 EDT
< 2015-07-24 10:20:28.575 EDT >LOG: entering standby mode
< 2015-07-24 10:20:28.576 EDT >LOG: invalid primary checkpoint record
< 2015-07-24 10:20:28.576 EDT >LOG: invalid secondary checkpoint record
< 2015-07-24 10:20:28.576 EDT >PANIC: could not locate a valid checkpoint record
< 2015-07-24 10:20:28.576 EDT >LOG: startup process (PID 16661) was terminated by signal 6: Aborted
< 2015-07-24 10:20:28.576 EDT >LOG: aborting startup due to startup process failure
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] > postgresql-Fri.log
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] /etc/rc.d/init.d/postgresql-9.4 start
Starting postgresql-9.4 service: [FAILED]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] cat postgresql-Fri.log
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] /etc/rc.d/init.d/postgresql-9.4 stop
Stopping postgresql-9.4 service: [ OK ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] cat postgresql-Fri.log
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] cat postgresql-Fri.log
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] cat ../../*.log
The files belonging to this database system will be owned by user “postgres”.
This user must also own the server process.

The database cluster will be initialized with locale “en_US.UTF-8”.
The default database encoding has accordingly been set to “UTF8”.
The default text search configuration will be set to “english”.

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/pgsql/9.4/data … ok
creating subdirectories … ok
selecting default max_connections … 100
selecting default shared_buffers … 128MB
selecting dynamic shared memory implementation … posix
creating configuration files … ok
creating template1 database in /var/lib/pgsql/9.4/data/base/1 … ok
initializing pg_authid … ok
initializing dependencies … ok
creating system views … ok
loading system objects’ descriptions … ok
creating collations … ok
creating conversions … ok
creating dictionaries … ok
setting privileges on built-in objects … ok
creating information schema … ok
loading PL/pgSQL server-side language … ok
vacuuming database template1 … ok
copying template1 to template0 … ok
copying template1 to postgres … ok
syncing data to disk … ok

Success. You can now start the database server using:

/usr/pgsql-9.4/bin/postgres -D /var/lib/pgsql/9.4/data
or
/usr/pgsql-9.4/bin/pg_ctl -D /var/lib/pgsql/9.4/data -l logfile start

The files belonging to this database system will be owned by user “postgres”.
This user must also own the server process.

The database cluster will be initialized with locale “en_US.UTF-8”.
The default database encoding has accordingly been set to “UTF8”.
The default text search configuration will be set to “english”.

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/pgsql/9.4/data … ok
creating subdirectories … ok
selecting default max_connections … 100
selecting default shared_buffers … 128MB
selecting dynamic shared memory implementation … posix
creating configuration files … ok
creating template1 database in /var/lib/pgsql/9.4/data/base/1 … ok
initializing pg_authid … ok
initializing dependencies … ok
creating system views … ok
loading system objects’ descriptions … ok
creating collations … ok
creating conversions … ok
creating dictionaries … ok
setting privileges on built-in objects … ok
creating information schema … ok
loading PL/pgSQL server-side language … ok
vacuuming database template1 … ok
copying template1 to template0 … ok
copying template1 to postgres … ok
syncing data to disk … ok

Success. You can now start the database server using:

/usr/pgsql-9.4/bin/postgres -D /var/lib/pgsql/9.4/data
or
/usr/pgsql-9.4/bin/pg_ctl -D /var/lib/pgsql/9.4/data -l logfile start

< 2015-07-24 07:48:26.027 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 07:48:26.055 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 07:48:26.055 EDT >HINT: Future log output will appear in directory “pg_log”.
runuser: cannot set groups: Operation not permitted
< 2015-07-24 09:11:05.037 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 09:11:05.066 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 09:11:05.066 EDT >HINT: Future log output will appear in directory “pg_log”.
runuser: cannot set groups: Operation not permitted
< 2015-07-24 09:55:56.290 EDT >FATAL: data directory “/var/lib/pgsql/9.4/data” has group or world access
< 2015-07-24 09:55:56.290 EDT >DETAIL: Permissions should be u=rwx (0700).
< 2015-07-24 09:59:49.442 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 09:59:49.444 EDT >LOG: could not bind IPv4 socket: Cannot assign requested address
< 2015-07-24 09:59:49.444 EDT >HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
< 2015-07-24 09:59:49.444 EDT >WARNING: could not create listen socket for “10.42.105.44”
< 2015-07-24 09:59:49.458 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 09:59:49.458 EDT >HINT: Future log output will appear in directory “pg_log”.
< 2015-07-24 10:10:07.884 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 10:10:07.885 EDT >LOG: could not bind IPv4 socket: Cannot assign requested address
< 2015-07-24 10:10:07.885 EDT >HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
< 2015-07-24 10:10:07.885 EDT >WARNING: could not create listen socket for “10.42.105.44”
< 2015-07-24 10:10:07.899 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 10:10:07.899 EDT >HINT: Future log output will appear in directory “pg_log”.
< 2015-07-24 10:20:17.038 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 10:20:17.058 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 10:20:17.058 EDT >HINT: Future log output will appear in directory “pg_log”.
< 2015-07-24 10:20:28.527 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 10:20:28.546 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 10:20:28.546 EDT >HINT: Future log output will appear in directory “pg_log”.
postmaster cannot access the server configuration file “/var/lib/pgsql/9.4/data/postgresql.conf”: Permission denied
postmaster cannot access the server configuration file “/var/lib/pgsql/9.4/data/postgresql.conf”: Permission denied
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] cat /var/lib/pgsql/9.4/data/postgresql.conf
# —————————–
# PostgreSQL configuration file
# —————————–
#
# This file consists of lines of the form:
#
# name = value
#
# (The “=” is optional.) 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 PostgreSQL documentation.
#
# The commented-out settings shown in this file represent the default values.
# Re-commenting a setting is NOT sufficient to revert it to the default value;
# you need to reload the server.
#
# 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 “pg_ctl reload”. Some
# parameters, which are marked below, require a server shutdown and restart to
# take effect.
#
# Any parameter can also be given as a command-line option to the server, e.g.,
# “postgres -c log_connections=on”. Some parameters can be changed at run time
# with the “SET” SQL command.
#
# Memory units: kB = kilobytes Time units: ms = milliseconds
# MB = megabytes s = seconds
# GB = gigabytes min = minutes
# TB = terabytes h = hours
# d = days
#——————————————————————————
# FILE LOCATIONS
#——————————————————————————

# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.

#data_directory = ‘ConfigDir’ # use data in another directory
# (change requires restart)
#hba_file = ‘ConfigDir/pg_hba.conf’ # host-based authentication file
# (change requires restart)
#ident_file = ‘ConfigDir/pg_ident.conf’ # ident configuration file
# (change requires restart)

# If external_pid_file is not explicitly set, no extra PID file is written.
#external_pid_file = ” # write an extra PID file
# (change requires restart)
#——————————————————————————
# CONNECTIONS AND AUTHENTICATION
#——————————————————————————

# – Connection Settings –

#listen_addresses = ‘localhost’ # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to ‘localhost’; use ‘*’ for all
# (change requires restart)
#port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
# Note: Increasing max_connections costs ~400 bytes of shared memory per
# connection slot, plus lock space (see max_locks_per_transaction).
#superuser_reserved_connections = 3 # (change requires restart)
#unix_socket_directories = ‘/tmp’ # comma-separated list of directories
# (change requires restart)
#unix_socket_group = ” # (change requires restart)
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
# (change requires restart)
#bonjour = off # advertise server via Bonjour
# (change requires restart)
#bonjour_name = ” # defaults to the computer name
# (change requires restart)

# – Security and Authentication –

#authentication_timeout = 1min # 1s-600s
#ssl = off # (change requires restart)
#ssl_ciphers = ‘HIGH:MEDIUM:+3DES:!aNULL’ # allowed SSL ciphers
# (change requires restart)
#ssl_prefer_server_ciphers = on # (change requires restart)
#ssl_ecdh_curve = ‘prime256v1’ # (change requires restart)
#ssl_renegotiation_limit = 512MB # amount of data between renegotiations
#ssl_cert_file = ‘server.crt’ # (change requires restart)
#ssl_key_file = ‘server.key’ # (change requires restart)
#ssl_ca_file = ” # (change requires restart)
#ssl_crl_file = ” # (change requires restart)
#password_encryption = on
#db_user_namespace = off

# GSSAPI using Kerberos
#krb_server_keyfile = ”
#krb_caseins_users = off

# – TCP Keepalives –
# see “man 7 tcp” for details

#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
# 0 selects the system default
#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
# 0 selects the system default
#tcp_keepalives_count = 0 # TCP_KEEPCNT;
# 0 selects the system default
#——————————————————————————
# RESOURCE USAGE (except WAL)
#——————————————————————————

# – Memory –

shared_buffers = 128MB # min 128kB
# (change requires restart)
#huge_pages = try # on, off, or try
# (change requires restart)
#temp_buffers = 8MB # min 800kB
#max_prepared_transactions = 0 # zero disables the feature
# (change requires restart)
# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory
# per transaction slot, plus lock space (see max_locks_per_transaction).
# It is not advisable to set max_prepared_transactions nonzero unless you
# actively intend to use prepared transactions.
#work_mem = 4MB # min 64kB
#maintenance_work_mem = 64MB # min 1MB
#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem
#max_stack_depth = 2MB # min 100kB
dynamic_shared_memory_type = posix # the default is the first option
# supported by the operating system:
# posix
# sysv
# windows
# mmap
# use none to disable dynamic shared memory

# – Disk –

#temp_file_limit = -1 # limits per-session temp file space
# in kB, or -1 for no limit

# – Kernel Resource Usage –

#max_files_per_process = 1000 # min 25
# (change requires restart)
#shared_preload_libraries = ” # (change requires restart)

# – Cost-Based Vacuum Delay –

#vacuum_cost_delay = 0 # 0-100 milliseconds
#vacuum_cost_page_hit = 1 # 0-10000 credits
#vacuum_cost_page_miss = 10 # 0-10000 credits
#vacuum_cost_page_dirty = 20 # 0-10000 credits
#vacuum_cost_limit = 200 # 1-10000 credits

# – Background Writer –

#bgwriter_delay = 200ms # 10-10000ms between rounds
#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round
#bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round

# – Asynchronous Behavior –

#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching
#max_worker_processes = 8
#——————————————————————————
# WRITE AHEAD LOG
#——————————————————————————

# – Settings –

#wal_level = minimal # minimal, archive, hot_standby, or logical
# (change requires restart)
#fsync = on # turns forced synchronization on or off
#synchronous_commit = on # synchronization level;
# off, local, remote_write, or on
#wal_sync_method = fsync # the default is the first option
# supported by the operating system:
# open_datasync
# fdatasync (default on Linux)
# fsync
# fsync_writethrough
# open_sync
#full_page_writes = on # recover from partial page writes
#wal_log_hints = off # also do full page writes of non-critical updates
# (change requires restart)
#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
# (change requires restart)
#wal_writer_delay = 200ms # 1-10000 milliseconds

#commit_delay = 0 # range 0-100000, in microseconds
#commit_siblings = 5 # range 1-1000

# – Checkpoints –

#checkpoint_segments = 3 # in logfile segments, min 1, 16MB each
#checkpoint_timeout = 5min # range 30s-1h
#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 – 1.0
#checkpoint_warning = 30s # 0 disables

# – Archiving –

#archive_mode = off # allows archiving to be done
# (change requires restart)
#archive_command = ” # command to use to archive a logfile segment
# placeholders: %p = path of file to archive
# %f = file name only
# e.g. ‘test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f’
#archive_timeout = 0 # force a logfile segment switch after this
# number of seconds; 0 disables
#——————————————————————————
# REPLICATION
#——————————————————————————

# – Sending Server(s) –

# Set these on the master and on any standby that will send replication data.

#max_wal_senders = 0 # max number of walsender processes
# (change requires restart)
#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
#wal_sender_timeout = 60s # in milliseconds; 0 disables

#max_replication_slots = 0 # max number of replication slots
# (change requires restart)

# – Master Server –

# These settings are ignored on a standby server.

#synchronous_standby_names = ” # standby servers that provide sync rep
# comma-separated list of application_name
# from standby(s); ‘*’ = all
#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed

# – Standby Servers –

# These settings are ignored on a master server.

#hot_standby = off # “on” allows queries during recovery
# (change requires restart)
#max_standby_archive_delay = 30s # max delay before canceling queries
# when reading WAL from archive;
# -1 allows indefinite delay
#max_standby_streaming_delay = 30s # max delay before canceling queries
# when reading streaming WAL;
# -1 allows indefinite delay
#wal_receiver_status_interval = 10s # send replies at least this often
# 0 disables
#hot_standby_feedback = off # send info from standby to prevent
# query conflicts
#wal_receiver_timeout = 60s # time that receiver waits for
# communication from master
# in milliseconds; 0 disable

listen_addresses = ‘localhost,10.42.105.44’
wal_level = ‘hot_standby’
archive_mode = on
archive_command = ‘cd .’
max_wal_senders = 1
hot_standby = on

#——————————————————————————
# QUERY TUNING
#——————————————————————————

# – Planner Method Configuration –

#enable_bitmapscan = on
#enable_hashagg = on
#enable_hashjoin = on
#enable_indexscan = on
#enable_indexonlyscan = on
#enable_material = on
#enable_mergejoin = on
#enable_nestloop = on
#enable_seqscan = on
#enable_sort = on
#enable_tidscan = on

# – Planner Cost Constants –

#seq_page_cost = 1.0 # measured on an arbitrary scale
#random_page_cost = 4.0 # same scale as above
#cpu_tuple_cost = 0.01 # same scale as above
#cpu_index_tuple_cost = 0.005 # same scale as above
#cpu_operator_cost = 0.0025 # same scale as above
#effective_cache_size = 4GB

# – Genetic Query Optimizer –

#geqo = on
#geqo_threshold = 12
#geqo_effort = 5 # range 1-10
#geqo_pool_size = 0 # selects default based on effort
#geqo_generations = 0 # selects default based on effort
#geqo_selection_bias = 2.0 # range 1.5-2.0
#geqo_seed = 0.0 # range 0.0-1.0

# – Other Planner Options –

#default_statistics_target = 100 # range 1-10000
#constraint_exclusion = partition # on, off, or partition
#cursor_tuple_fraction = 0.1 # range 0.0-1.0
#from_collapse_limit = 8
#join_collapse_limit = 8 # 1 disables collapsing of explicit
# JOIN clauses
#——————————————————————————
# ERROR REPORTING AND LOGGING
#——————————————————————————

# – Where to Log –

log_destination = ‘stderr’ # Valid values are combinations of
# stderr, csvlog, syslog, and eventlog,
# depending on platform. csvlog
# requires logging_collector to be on.

# This is used when logging to stderr:
logging_collector = on # Enable capturing of stderr and csvlog
# into log files. Required to be on for
# csvlogs.
# (change requires restart)

# These are only used if logging_collector is on:
log_directory = ‘pg_log’ # directory where log files are written,
# can be absolute or relative to PGDATA
log_filename = ‘postgresql-%a.log’ # log file name pattern,
# can include strftime() escapes
#log_file_mode = 0600 # creation mode for log files,
# begin with 0 to use octal notation
log_truncate_on_rotation = on # If on, an existing log file with the
# same name as the new log file will be
# truncated rather than appended to.
# But such truncation only occurs on
# time-driven rotation, not on restarts
# or size-driven rotation. Default is
# off, meaning append to existing files
# in all cases.
log_rotation_age = 1d # Automatic rotation of logfiles will
# happen after that time. 0 disables.
log_rotation_size = 0 # Automatic rotation of logfiles will
# happen after that much log output.
# 0 disables.

# These are relevant when logging to syslog:
#syslog_facility = ‘LOCAL0’
#syslog_ident = ‘postgres’

# This is only relevant when logging to eventlog (win32):
#event_source = ‘PostgreSQL’

# – When to Log –

#client_min_messages = notice # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# log
# notice
# warning
# error

#log_min_messages = warning # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic

#log_min_error_statement = error # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic (effectively off)

#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
# and their durations, > 0 logs only
# statements running at least this number
# of milliseconds
# – What to Log –

#debug_print_parse = off
#debug_print_rewritten = off
#debug_print_plan = off
#debug_pretty_print = on
#log_checkpoints = off
#log_connections = off
#log_disconnections = off
#log_duration = off
#log_error_verbosity = default # terse, default, or verbose messages
#log_hostname = off
log_line_prefix = ‘< %m >’ # special values:
# %a = application name
# %u = user name
# %d = database name
# %r = remote host and port
# %h = remote host
# %p = process ID
# %t = timestamp without milliseconds
# %m = timestamp with milliseconds
# %i = command tag
# %e = SQL state
# %c = session ID
# %l = session line number
# %s = session start timestamp
# %v = virtual transaction ID
# %x = transaction ID (0 if none)
# %q = stop here in non-session
# processes
# %% = ‘%’
# e.g. ‘<%u%%%d> ‘
#log_lock_waits = off # log lock waits >= deadlock_timeout
#log_statement = ‘none’ # none, ddl, mod, all
#log_temp_files = -1 # log temporary files equal or larger
# than the specified size in kilobytes;
# -1 disables, 0 logs all temp files
log_timezone = ‘US/Eastern’
#——————————————————————————
# RUNTIME STATISTICS
#——————————————————————————

# – Query/Index Statistics Collector –

#track_activities = on
#track_counts = on
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
#update_process_title = on
#stats_temp_directory = ‘pg_stat_tmp’
# – Statistics Monitoring –

#log_parser_stats = off
#log_planner_stats = off
#log_executor_stats = off
#log_statement_stats = off
#——————————————————————————
# AUTOVACUUM PARAMETERS
#——————————————————————————

#autovacuum = on # Enable autovacuum subprocess? ‘on’
# requires track_counts to also be on.
#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and
# their durations, > 0 logs only
# actions running at least this number
# of milliseconds.
#autovacuum_max_workers = 3 # max number of autovacuum subprocesses
# (change requires restart)
#autovacuum_naptime = 1min # time between autovacuum runs
#autovacuum_vacuum_threshold = 50 # min number of row updates before
# vacuum
#autovacuum_analyze_threshold = 50 # min number of row updates before
# analyze
#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
# (change requires restart)
#autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age
# before forced vacuum
# (change requires restart)
#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
# autovacuum, in milliseconds;
# -1 means use vacuum_cost_delay
#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
# autovacuum, -1 means use
# vacuum_cost_limit
#——————————————————————————
# CLIENT CONNECTION DEFAULTS
#——————————————————————————

# – Statement Behavior –

#search_path = ‘”$user”,public’ # schema names
#default_tablespace = ” # a tablespace name, ” uses the default
#temp_tablespaces = ” # a list of tablespace names, ” uses
# only default tablespace
#check_function_bodies = on
#default_transaction_isolation = ‘read committed’
#default_transaction_read_only = off
#default_transaction_deferrable = off
#session_replication_role = ‘origin’
#statement_timeout = 0 # in milliseconds, 0 is disabled
#lock_timeout = 0 # in milliseconds, 0 is disabled
#vacuum_freeze_min_age = 50000000
#vacuum_freeze_table_age = 150000000
#vacuum_multixact_freeze_min_age = 5000000
#vacuum_multixact_freeze_table_age = 150000000
#bytea_output = ‘hex’ # hex, escape
#xmlbinary = ‘base64’
#xmloption = ‘content’

# – Locale and Formatting –

datestyle = ‘iso, mdy’
#intervalstyle = ‘postgres’
timezone = ‘US/Eastern’
#timezone_abbreviations = ‘Default’ # Select the set of available time zone
# abbreviations. Currently, there are
# Default
# Australia (historical usage)
# India
# You can create your own file in
# share/timezonesets/.
#extra_float_digits = 0 # min -15, max 3
#client_encoding = sql_ascii # actually, defaults to database
# encoding

# These settings are initialized by initdb, but they can be changed.
lc_messages = ‘en_US.UTF-8’ # locale for system error message
# strings
lc_monetary = ‘en_US.UTF-8’ # locale for monetary formatting
lc_numeric = ‘en_US.UTF-8’ # locale for number formatting
lc_time = ‘en_US.UTF-8’ # locale for time formatting

# default configuration for text search
default_text_search_config = ‘pg_catalog.english’

# – Other Defaults –

#dynamic_library_path = ‘$libdir’
#local_preload_libraries = ”
#session_preload_libraries = ”
#——————————————————————————
# LOCK MANAGEMENT
#——————————————————————————

#deadlock_timeout = 1s
#max_locks_per_transaction = 64 # min 10
# (change requires restart)
# Note: Each lock table slot uses ~270 bytes of shared memory, and there are
# max_locks_per_transaction * (max_connections + max_prepared_transactions)
# lock table slots.
#max_pred_locks_per_transaction = 64 # min 10
# (change requires restart)
#——————————————————————————
# VERSION/PLATFORM COMPATIBILITY
#——————————————————————————

# – Previous PostgreSQL Versions –

#array_nulls = on
#backslash_quote = safe_encoding # on, off, or safe_encoding
#default_with_oids = off
#escape_string_warning = on
#lo_compat_privileges = off
#quote_all_identifiers = off
#sql_inheritance = on
#standard_conforming_strings = on
#synchronize_seqscans = on

# – Other Platforms and Clients –

#transform_null_equals = off
#——————————————————————————
# ERROR HANDLING
#——————————————————————————

#exit_on_error = off # terminate session on any error?
#restart_after_crash = on # reinitialize after backend crash?
#——————————————————————————
# CONFIG FILE INCLUDES
#——————————————————————————

# These options allow settings to be loaded from files other than the
# default postgresql.conf.

#include_dir = ‘conf.d’ # include files ending in ‘.conf’ from
# directory ‘conf.d’
#include_if_exists = ‘exists.conf’ # include file only if it exists
#include = ‘special.conf’ # include file
#——————————————————————————
# CUSTOMIZED OPTIONS
#——————————————————————————

# Add settings for extensions here

listen_addresses = ‘localhost,10.116.175.107’
wal_level = ‘hot_standby’
archive_mode = on
archive_command = ‘cd .’
max_wal_senders = 1
hot_standby = on
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] ll -lhtr /var/lib/pgsql/9.4/data/postgresql.conf
-rw-r–r– 1 700 postgres 22K Jul 24 10:18 /var/lib/pgsql/9.4/data/postgresql.conf
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] chown postgres:postgres /var/lib/pgsql/9.4/ -R
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] chmod 700 /var/lib/pgsql/9.4/ -R
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] > ../../*.log
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] /etc/rc.d/init.d/postgresql-9.4 restart
Stopping postgresql-9.4 service: [ OK ]
Starting postgresql-9.4 service: [FAILED]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] cat../../*.log
-bash: cat../../*.log: No such file or directory
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] cat ../../*.log
< 2015-07-24 10:29:54.199 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 10:29:54.217 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 10:29:54.217 EDT >HINT: Future log output will appear in directory “pg_log”.
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] ll -lhtr
total 4.0K
-rwx—— 1 postgres postgres 582 Jul 24 10:29 postgresql-Fri.log
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] cat postgresql-Fri.log
< 2015-07-24 10:29:54.219 EDT >LOG: database system was interrupted; last known up at 2015-07-24 10:14:35 EDT
< 2015-07-24 10:29:54.241 EDT >LOG: entering standby mode
< 2015-07-24 10:29:54.241 EDT >LOG: invalid primary checkpoint record
< 2015-07-24 10:29:54.241 EDT >LOG: invalid secondary checkpoint record
< 2015-07-24 10:29:54.241 EDT >PANIC: could not locate a valid checkpoint record
< 2015-07-24 10:29:54.241 EDT >LOG: startup process (PID 18155) was terminated by signal 6: Aborted
< 2015-07-24 10:29:54.241 EDT >LOG: aborting startup due to startup process failure
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] /etc/rc.d/init.d/postgresql-9.4 stop
Stopping postgresql-9.4 service: [ OK ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ]
[ root @ masterhost : /var/lib/pgsql/9.4/data/pg_log ] cd ..
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 120K
drwx—— 3 postgres postgres 4.0K Jul 24 10:12 pg_xlog
drwx—— 5 postgres postgres 4.0K Jul 24 10:15 base
drwx—— 2 postgres postgres 4.0K Jul 24 10:15 pg_clog
drwx—— 2 postgres postgres 4.0K Jul 24 10:15 pg_dynshmem
-rwx—— 1 postgres postgres 1.6K Jul 24 10:15 pg_ident.conf
drwx—— 2 postgres postgres 4.0K Jul 24 10:15 pg_log
drwx—— 4 postgres postgres 4.0K Jul 24 10:15 pg_logical
drwx—— 4 postgres postgres 4.0K Jul 24 10:15 pg_multixact
drwx—— 2 postgres postgres 4.0K Jul 24 10:15 pg_replslot
drwx—— 2 postgres postgres 4.0K Jul 24 10:15 pg_serial
drwx—— 2 postgres postgres 4.0K Jul 24 10:15 pg_snapshots
drwx—— 2 postgres postgres 4.0K Jul 24 10:15 pg_stat
drwx—— 2 postgres postgres 4.0K Jul 24 10:15 pg_stat_tmp
drwx—— 2 postgres postgres 4.0K Jul 24 10:15 pg_subtrans
drwx—— 2 postgres postgres 4.0K Jul 24 10:15 pg_tblspc
drwx—— 2 postgres postgres 4.0K Jul 24 10:15 pg_twophase
-rwx—— 1 postgres postgres 4 Jul 24 10:15 PG_VERSION
-rwx—— 1 postgres postgres 88 Jul 24 10:15 postgresql.auto.conf
-rwx—— 1 postgres postgres 141 Jul 24 10:15 recovery.conf
-rwx—— 1 postgres postgres 4.2K Jul 24 10:17 pg_hba.conf
-rwx—— 1 postgres postgres 22K Jul 24 10:18 postgresql.conf
drwx—— 2 postgres postgres 4.0K Jul 24 10:20 global
-rwx—— 1 postgres postgres 59 Jul 24 10:29 postmaster.opts
drwx—— 2 postgres postgres 4.0K Jul 24 10:29 pg_notify
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cp *.conf ../
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cd ..
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ] ll -lhtr
total 56K
drwx—— 19 postgres postgres 4.0K Jul 24 09:23 data_old
-rwx—— 1 postgres postgres 288 Jul 24 10:29 pgstartup.log
drwx—— 19 postgres postgres 4.0K Jul 24 10:29 data
-rwx—— 1 root root 1.6K Jul 24 10:33 pg_ident.conf
-rwx—— 1 root root 4.2K Jul 24 10:33 pg_hba.conf
-rwx—— 1 root root 141 Jul 24 10:33 recovery.conf
-rwx—— 1 root root 22K Jul 24 10:33 postgresql.conf
-rwx—— 1 root root 88 Jul 24 10:33 postgresql.auto.conf
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ] cd data
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] rm -rf *
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] /etc/rc.d/init.d/postgresql-9.4 initdb
Initializing database: [ OK ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 112K
-rw——- 1 postgres postgres 4 Jul 24 10:33 PG_VERSION
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_twophase
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_tblspc
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_stat_tmp
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_stat
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_snapshots
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_serial
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_replslot
drwx—— 4 postgres postgres 4.0K Jul 24 10:33 pg_multixact
drwx—— 4 postgres postgres 4.0K Jul 24 10:33 pg_logical
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_dynshmem
-rw——- 1 postgres postgres 21K Jul 24 10:33 postgresql.conf
-rw——- 1 postgres postgres 88 Jul 24 10:33 postgresql.auto.conf
-rw——- 1 postgres postgres 4.2K Jul 24 10:33 pg_hba.conf
-rw——- 1 postgres postgres 1.6K Jul 24 10:33 pg_ident.conf
drwx—— 3 postgres postgres 4.0K Jul 24 10:33 pg_xlog
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_subtrans
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_clog
drwx—— 2 postgres postgres 4.0K Jul 24 10:34 pg_notify
drwx—— 2 postgres postgres 4.0K Jul 24 10:34 global
drwx—— 5 postgres postgres 4.0K Jul 24 10:34 base
drwx—— 2 postgres postgres 4.0K Jul 24 10:34 pg_log
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cp ../*.conf .
cp: overwrite `./pg_hba.conf’? y
cp: overwrite `./pg_ident.conf’? y
cp: overwrite `./postgresql.auto.conf’? y
cp: overwrite `./postgresql.conf’? y
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] /etc/rc.d/init.d/postgresql-9.4 stop
Stopping postgresql-9.4 service: [ OK ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] mv pg_xlog/ ../ -R
mv: invalid option — ‘R’
Try `mv –help’ for more information.
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] mv pg_xlog/ ../
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cd ..
[ root @ masterhost : /var/lib/pgsql/9.4 ] ll -lhtr
total 60K
drwx—— 19 postgres postgres 4.0K Jul 24 09:23 data_old
-rwx—— 1 root root 1.6K Jul 24 10:33 pg_ident.conf
-rwx—— 1 root root 4.2K Jul 24 10:33 pg_hba.conf
-rwx—— 1 root root 141 Jul 24 10:33 recovery.conf
-rwx—— 1 root root 22K Jul 24 10:33 postgresql.conf
-rwx—— 1 root root 88 Jul 24 10:33 postgresql.auto.conf
drwx—— 3 postgres postgres 4.0K Jul 24 10:33 pg_xlog
-rwx—— 1 postgres postgres 1.7K Jul 24 10:34 pgstartup.log
drwx—— 18 postgres postgres 4.0K Jul 24 10:35 data
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ]
[ root @ masterhost : /var/lib/pgsql/9.4 ] cd data
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lthr
total 112K
-rw——- 1 postgres postgres 4 Jul 24 10:33 PG_VERSION
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_twophase
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_tblspc
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_stat_tmp
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_stat
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_snapshots
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_serial
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_replslot
drwx—— 4 postgres postgres 4.0K Jul 24 10:33 pg_multixact
drwx—— 4 postgres postgres 4.0K Jul 24 10:33 pg_logical
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_dynshmem
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_subtrans
drwx—— 2 postgres postgres 4.0K Jul 24 10:33 pg_clog
drwx—— 2 postgres postgres 4.0K Jul 24 10:34 pg_notify
drwx—— 2 postgres postgres 4.0K Jul 24 10:34 global
drwx—— 5 postgres postgres 4.0K Jul 24 10:34 base
drwx—— 2 postgres postgres 4.0K Jul 24 10:34 pg_log
-rw——- 1 postgres postgres 4.2K Jul 24 10:34 pg_hba.conf
-rw——- 1 postgres postgres 1.6K Jul 24 10:34 pg_ident.conf
-rw——- 1 postgres postgres 88 Jul 24 10:34 postgresql.auto.conf
-rwx—— 1 root root 141 Jul 24 10:34 recovery.conf
-rw——- 1 postgres postgres 22K Jul 24 10:34 postgresql.conf
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] rm -rf *
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] /etc/rc.d/init.d/postgresql-9.4 stop
Stopping postgresql-9.4 service: [ OK ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] /etc/rc.d/init.d/postgresql-9.4 initdb
Initializing database: [ OK ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] /etc/rc.d/init.d/postgresql-9.4 start
Starting postgresql-9.4 service: [ OK ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cp ../*.conf .
cp: overwrite `./pg_hba.conf’? y
cp: overwrite `./pg_ident.conf’? y
cp: overwrite `./postgresql.auto.conf’? y
cp: overwrite `./postgresql.conf’? y
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cp ../pg_xlog/ . -R
cp: overwrite `./pg_xlog/000000010000000000000001′? y
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] hostnaem -i
-bash: hostnaem: command not found
[ root @ masterhost : /var/lib/pgsql/9.4/data ] hostname -i
10.116.175.107
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 124K
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_twophase
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_snapshots
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_serial
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_dynshmem
-rw——- 1 postgres postgres 4 Jul 24 10:42 PG_VERSION
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_tblspc
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_stat
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_replslot
drwx—— 4 postgres postgres 4.0K Jul 24 10:42 pg_multixact
drwx—— 4 postgres postgres 4.0K Jul 24 10:42 pg_logical
drwx—— 3 postgres postgres 4.0K Jul 24 10:42 pg_xlog
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_subtrans
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_clog
drwx—— 5 postgres postgres 4.0K Jul 24 10:42 base
-rw——- 1 postgres postgres 81 Jul 24 10:42 postmaster.pid
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_notify
-rw——- 1 postgres postgres 59 Jul 24 10:42 postmaster.opts
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_log
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 global
-rw——- 1 postgres postgres 4.2K Jul 24 10:42 pg_hba.conf
-rw——- 1 postgres postgres 1.6K Jul 24 10:42 pg_ident.conf
-rw——- 1 postgres postgres 88 Jul 24 10:42 postgresql.auto.conf
-rwx—— 1 root root 141 Jul 24 10:42 recovery.conf
-rw——- 1 postgres postgres 22K Jul 24 10:42 postgresql.conf
drwx—— 2 postgres postgres 4.0K Jul 24 11:03 pg_stat_tmp
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] chmod 700 /var/lib/pgsql/9.4/ -R; chown postgres:postgres /var/lib/pgsql/9.4/ -R
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat ../pgstartup.log; cat pg_log/postgresql-Fri.log ; > pg_log/postgresql-Fri.log; > ../pgstartup.logchmod 700 /var/lib/pgsql/9.4/ -R; chown postgres:postgres /var/lib/pgsql/9.4/ -R
< 2015-07-24 10:29:54.199 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 10:29:54.217 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 10:29:54.217 EDT >HINT: Future log output will appear in directory “pg_log”.
The files belonging to this database system will be owned by user “postgres”.
This user must also own the server process.

The database cluster will be initialized with locale “en_US.UTF-8”.
The default database encoding has accordingly been set to “UTF8”.
The default text search configuration will be set to “english”.

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/pgsql/9.4/data … ok
creating subdirectories … ok
selecting default max_connections … 100
selecting default shared_buffers … 128MB
selecting dynamic shared memory implementation … posix
creating configuration files … ok
creating template1 database in /var/lib/pgsql/9.4/data/base/1 … ok
initializing pg_authid … ok
initializing dependencies … ok
creating system views … ok
loading system objects’ descriptions … ok
creating collations … ok
creating conversions … ok
creating dictionaries … ok
setting privileges on built-in objects … ok
creating information schema … ok
loading PL/pgSQL server-side language … ok
vacuuming database template1 … ok
copying template1 to template0 … ok
copying template1 to postgres … ok
syncing data to disk … ok

Success. You can now start the database server using:

/usr/pgsql-9.4/bin/postgres -D /var/lib/pgsql/9.4/data
or
/usr/pgsql-9.4/bin/pg_ctl -D /var/lib/pgsql/9.4/data -l logfile start

The files belonging to this database system will be owned by user “postgres”.
This user must also own the server process.

The database cluster will be initialized with locale “en_US.UTF-8”.
The default database encoding has accordingly been set to “UTF8”.
The default text search configuration will be set to “english”.

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/pgsql/9.4/data … ok
creating subdirectories … ok
selecting default max_connections … 100
selecting default shared_buffers … 128MB
selecting dynamic shared memory implementation … posix
creating configuration files … ok
creating template1 database in /var/lib/pgsql/9.4/data/base/1 … ok
initializing pg_authid … ok
initializing dependencies … ok
creating system views … ok
loading system objects’ descriptions … ok
creating collations … ok
creating conversions … ok
creating dictionaries … ok
setting privileges on built-in objects … ok
creating information schema … ok
loading PL/pgSQL server-side language … ok
vacuuming database template1 … ok
copying template1 to template0 … ok
copying template1 to postgres … ok
syncing data to disk … ok

Success. You can now start the database server using:

/usr/pgsql-9.4/bin/postgres -D /var/lib/pgsql/9.4/data
or
/usr/pgsql-9.4/bin/pg_ctl -D /var/lib/pgsql/9.4/data -l logfile start

< 2015-07-24 10:42:25.550 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 10:42:25.568 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 10:42:25.568 EDT >HINT: Future log output will appear in directory “pg_log”.
< 2015-07-24 10:42:25.570 EDT >LOG: database system was shut down at 2015-07-24 10:42:21 EDT
< 2015-07-24 10:42:25.572 EDT >LOG: MultiXact member wraparound protections are now enabled
< 2015-07-24 10:42:25.574 EDT >LOG: autovacuum launcher started
< 2015-07-24 10:42:25.575 EDT >LOG: database system is ready to accept connections
-bash: 700: command not found
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat ../pgstartup.log; cat pg_log/postgresql-Fri.log ; > pg_log/postgresql-Fri.log; > ../pgstartup.log
< 2015-07-24 10:29:54.199 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 10:29:54.217 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 10:29:54.217 EDT >HINT: Future log output will appear in directory “pg_log”.
The files belonging to this database system will be owned by user “postgres”.
This user must also own the server process.

The database cluster will be initialized with locale “en_US.UTF-8”.
The default database encoding has accordingly been set to “UTF8”.
The default text search configuration will be set to “english”.

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/pgsql/9.4/data … ok
creating subdirectories … ok
selecting default max_connections … 100
selecting default shared_buffers … 128MB
selecting dynamic shared memory implementation … posix
creating configuration files … ok
creating template1 database in /var/lib/pgsql/9.4/data/base/1 … ok
initializing pg_authid … ok
initializing dependencies … ok
creating system views … ok
loading system objects’ descriptions … ok
creating collations … ok
creating conversions … ok
creating dictionaries … ok
setting privileges on built-in objects … ok
creating information schema … ok
loading PL/pgSQL server-side language … ok
vacuuming database template1 … ok
copying template1 to template0 … ok
copying template1 to postgres … ok
syncing data to disk … ok

Success. You can now start the database server using:

/usr/pgsql-9.4/bin/postgres -D /var/lib/pgsql/9.4/data
or
/usr/pgsql-9.4/bin/pg_ctl -D /var/lib/pgsql/9.4/data -l logfile start

The files belonging to this database system will be owned by user “postgres”.
This user must also own the server process.

The database cluster will be initialized with locale “en_US.UTF-8”.
The default database encoding has accordingly been set to “UTF8”.
The default text search configuration will be set to “english”.

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/pgsql/9.4/data … ok
creating subdirectories … ok
selecting default max_connections … 100
selecting default shared_buffers … 128MB
selecting dynamic shared memory implementation … posix
creating configuration files … ok
creating template1 database in /var/lib/pgsql/9.4/data/base/1 … ok
initializing pg_authid … ok
initializing dependencies … ok
creating system views … ok
loading system objects’ descriptions … ok
creating collations … ok
creating conversions … ok
creating dictionaries … ok
setting privileges on built-in objects … ok
creating information schema … ok
loading PL/pgSQL server-side language … ok
vacuuming database template1 … ok
copying template1 to template0 … ok
copying template1 to postgres … ok
syncing data to disk … ok

Success. You can now start the database server using:

/usr/pgsql-9.4/bin/postgres -D /var/lib/pgsql/9.4/data
or
/usr/pgsql-9.4/bin/pg_ctl -D /var/lib/pgsql/9.4/data -l logfile start

< 2015-07-24 10:42:25.550 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 10:42:25.568 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 10:42:25.568 EDT >HINT: Future log output will appear in directory “pg_log”.
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ps -ef | grep postgers
root 25376 30569 0 11:16 pts/3 00:00:00 grep postgers
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] /etc/rc.d/init.d/postgresql-9.4 stop
Stopping postgresql-9.4 service: [ OK ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ls -lhtr
total 120K
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_twophase
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_snapshots
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_serial
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_dynshmem
-rwx—— 1 postgres postgres 4 Jul 24 10:42 PG_VERSION
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_tblspc
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_replslot
drwx—— 4 postgres postgres 4.0K Jul 24 10:42 pg_multixact
drwx—— 4 postgres postgres 4.0K Jul 24 10:42 pg_logical
drwx—— 3 postgres postgres 4.0K Jul 24 10:42 pg_xlog
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_subtrans
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_clog
drwx—— 5 postgres postgres 4.0K Jul 24 10:42 base
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_notify
-rwx—— 1 postgres postgres 59 Jul 24 10:42 postmaster.opts
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 pg_log
drwx—— 2 postgres postgres 4.0K Jul 24 10:42 global
-rwx—— 1 postgres postgres 4.2K Jul 24 10:42 pg_hba.conf
-rwx—— 1 postgres postgres 1.6K Jul 24 10:42 pg_ident.conf
-rwx—— 1 postgres postgres 88 Jul 24 10:42 postgresql.auto.conf
-rwx—— 1 postgres postgres 141 Jul 24 10:42 recovery.conf
-rwx—— 1 postgres postgres 22K Jul 24 10:42 postgresql.conf
drwx—— 2 postgres postgres 4.0K Jul 24 11:16 pg_stat_tmp
drwx—— 2 postgres postgres 4.0K Jul 24 11:16 pg_stat
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] rm -rf *
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] /etc/rc.d/init.d/postgresql-9.4 initdb
Initializing database: [ OK ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] /etc/rc.d/init.d/postgresql-9.4 stop
Stopping postgresql-9.4 service: [ OK ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cp ../*.cnf .
cp: cannot stat `../*.cnf’: No such file or directory
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cp ../*.conf .
cp: overwrite `./pg_hba.conf’? y
cp: overwrite `./pg_ident.conf’? y
cp: overwrite `./postgresql.auto.conf’? y
cp: overwrite `./postgresql.conf’? y
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 120K
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_twophase
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_tblspc
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_stat
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_snapshots
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_serial
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_replslot
drwx—— 4 postgres postgres 4.0K Jul 24 11:17 pg_multixact
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_dynshmem
drwx—— 4 postgres postgres 4.0K Jul 24 11:17 pg_logical
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_subtrans
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_clog
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_notify
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 global
drwx—— 5 postgres postgres 4.0K Jul 24 11:17 base
-rw——- 1 postgres postgres 88 Jul 24 11:18 postgresql.auto.conf
-rwx—— 1 root root 141 Jul 24 11:18 recovery.conf
-rw——- 1 postgres postgres 22K Jul 24 11:18 postgresql.conf
-rw-r–r– 1 postgres postgres 202 Jul 24 11:18 backup_label
-rwx–x–x 1 postgres postgres 4.2K Jul 24 11:19 pg_hba.conf
-rwx–x–x 1 postgres postgres 1.6K Jul 24 11:19 pg_ident.conf
drwx—— 2 postgres postgres 4.0K Jul 24 11:19 pg_log
drwx—— 2 postgres postgres 4.0K Jul 24 11:19 pg_stat_tmp
-rwx–x–x 1 postgres postgres 4 Jul 24 11:19 PG_VERSION
drwx—— 3 postgres postgres 4.0K Jul 24 11:19 pg_xlog
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cp ../pg_xlog/ . -R
cp: overwrite `./pg_xlog/000000010000000000000001′? y
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cp ../*.conf .
cp: overwrite `./pg_hba.conf’? y
cp: overwrite `./pg_ident.conf’? y
cp: overwrite `./postgresql.auto.conf’? y
cp: overwrite `./postgresql.conf’? y
cp: overwrite `./recovery.conf’? y
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] chmod 700 /var/lib/pgsql/9.4/ -R; chown postgres:postgres /var/lib/pgsql/9.4/ -R
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat ../pgstartup.log; cat pg_log/postgresql-Fri.log ; > pg_log/postgresql-Fri.log; > ../pgstartup.log
The files belonging to this database system will be owned by user “postgres”.
This user must also own the server process.

The database cluster will be initialized with locale “en_US.UTF-8”.
The default database encoding has accordingly been set to “UTF8”.
The default text search configuration will be set to “english”.

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/pgsql/9.4/data … ok
creating subdirectories … ok
selecting default max_connections … 100
selecting default shared_buffers … 128MB
selecting dynamic shared memory implementation … posix
creating configuration files … ok
creating template1 database in /var/lib/pgsql/9.4/data/base/1 … ok
initializing pg_authid … ok
initializing dependencies … ok
creating system views … ok
loading system objects’ descriptions … ok
creating collations … ok
creating conversions … ok
creating dictionaries … ok
setting privileges on built-in objects … ok
creating information schema … ok
loading PL/pgSQL server-side language … ok
vacuuming database template1 … ok
copying template1 to template0 … ok
copying template1 to postgres … ok
syncing data to disk … ok

Success. You can now start the database server using:

/usr/pgsql-9.4/bin/postgres -D /var/lib/pgsql/9.4/data
or
/usr/pgsql-9.4/bin/pg_ctl -D /var/lib/pgsql/9.4/data -l logfile start

< 2015-07-24 11:01:47.120 EDT >LOG: database system was interrupted while in recovery at log time 2015-07-24 10:50:27 EDT
< 2015-07-24 11:01:47.120 EDT >HINT: If this has occurred more than once some data might be corrupted and you might need to choose an earlier recovery target.
< 2015-07-24 11:01:47.179 EDT >LOG: entering standby mode
< 2015-07-24 11:01:47.185 EDT >WARNING: WAL was generated with wal_level=minimal, data may be missing
< 2015-07-24 11:01:47.185 EDT >HINT: This happens if you temporarily set wal_level=minimal without taking a new base backup.
< 2015-07-24 11:01:47.186 EDT >LOG: consistent recovery state reached at 0/17123B8
< 2015-07-24 11:01:47.186 EDT >LOG: record with zero length at 0/17123B8
< 2015-07-24 11:01:47.186 EDT >LOG: trigger file found: /tmp/postgresql.trigger.5432
< 2015-07-24 11:01:47.186 EDT >LOG: redo is not required
< 2015-07-24 11:01:47.193 EDT >LOG: selected new timeline ID: 2
< 2015-07-24 11:01:47.423 EDT >LOG: archive recovery complete
< 2015-07-24 11:01:47.435 EDT >LOG: MultiXact member wraparound protections are now enabled
< 2015-07-24 11:01:47.444 EDT >LOG: database system is ready to accept connections
< 2015-07-24 11:01:47.444 EDT >LOG: autovacuum launcher started
< 2015-07-24 11:03:01.826 EDT >ERROR: role “rep” already exists
< 2015-07-24 11:03:01.826 EDT >STATEMENT: CREATE USER rep REPLICATION LOGIN CONNECTION LIMIT 1 ENCRYPTED PASSWORD ‘yourpassword’;
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] /etc/rc.d/init.d/postgresql-9.4 start
Starting postgresql-9.4 service: [ OK ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat ../pgstartup.log; cat pg_log/postgresql-Fri.log ; > pg_log/postgresql-Fri.log; > ../pgstartup.log
< 2015-07-24 11:20:54.542 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 11:20:54.557 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 11:20:54.557 EDT >HINT: Future log output will appear in directory “pg_log”.
< 2015-07-24 11:20:54.559 EDT >LOG: database system was interrupted; last known up at 2015-07-24 11:18:34 EDT
< 2015-07-24 11:20:54.584 EDT >LOG: entering standby mode
< 2015-07-24 11:20:54.586 EDT >LOG: redo starts at 0/2000028
< 2015-07-24 11:20:54.586 EDT >LOG: record with zero length at 0/2000100
< 2015-07-24 11:20:54.718 EDT >FATAL: could not connect to the primary server: FATAL: password authentication failed for user “rep”

[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] grep ‘test123’ *.conf
recovery.conf:primary_conninfo = ‘host=10.42.105.44 port=5432 user=rep password=test123’
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] sed “s/test123/yourpassword/g” *.conf
# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the “Client Authentication” section in the PostgreSQL
# documentation for a complete description of this file. A short
# synopsis follows.
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access. Records take one of these forms:
#
# local DATABASE USER METHOD [OPTIONS]
# host DATABASE USER ADDRESS METHOD [OPTIONS]
host replication rep 10.42.105.44/32 md5

# hostssl DATABASE USER ADDRESS METHOD [OPTIONS]
# hostnossl DATABASE USER ADDRESS METHOD [OPTIONS]
#
# (The uppercase items must be replaced by actual values.)
#
# The first field is the connection type: “local” is a Unix-domain
# socket, “host” is either a plain or SSL-encrypted TCP/IP socket,
# “hostssl” is an SSL-encrypted TCP/IP socket, and “hostnossl” is a
# plain TCP/IP socket.
#
# DATABASE can be “all”, “sameuser”, “samerole”, “replication”, a
# database name, or a comma-separated list thereof. The “all”
# keyword does not match “replication”. Access to replication
# must be enabled in a separate record (see example below).
#
# USER can be “all”, a user name, a group name prefixed with “+”, or a
# comma-separated list thereof. In both the DATABASE and USER fields
# you can also write a file name prefixed with “@” to include names
# from a separate file.
#
# ADDRESS specifies the set of hosts the record matches. It can be a
# host name, or it is made up of an IP address and a CIDR mask that is
# an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
# specifies the number of significant bits in the mask. A host name
# that starts with a dot (.) matches a suffix of the actual host name.
# Alternatively, you can write an IP address and netmask in separate
# columns to specify the set of hosts. Instead of a CIDR-address, you
# can write “samehost” to match any of the server’s own IP addresses,
# or “samenet” to match any address in any subnet that the server is
# directly connected to.
#
# METHOD can be “trust”, “reject”, “md5”, “password”, “gss”, “sspi”,
# “ident”, “peer”, “pam”, “ldap”, “radius” or “cert”. Note that
# “password” sends passwords in clear text; “md5” is preferred since
# it sends encrypted passwords.
#
# OPTIONS are a set of options for the authentication in the format
# NAME=VALUE. The available options depend on the different
# authentication methods — refer to the “Client Authentication”
# section in the documentation for a list of which options are
# available for which authentication methods.
#
# Database and user names containing spaces, commas, quotes and other
# special characters must be quoted. Quoting one of the keywords
# “all”, “sameuser”, “samerole” or “replication” makes the name lose
# its special character, and just match a database or username with
# that name.
#
# This file is read on server startup and when the postmaster receives
# a SIGHUP signal. If you edit the file on a running system, you have
# to SIGHUP the postmaster for the changes to take effect. You can
# use “pg_ctl reload” to do that.

# Put your actual configuration here
# ———————————-
#
# If you want to allow non-local connections, you need to add more
# “host” records. In that case you will also need to make PostgreSQL
# listen on a non-local interface via the listen_addresses
# configuration parameter, or via the -i or -h command line switches.

# 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
# PostgreSQL User Name Maps
# =========================
#
# Refer to the PostgreSQL documentation, chapter “Client
# Authentication” for a complete description. A short synopsis
# follows.
#
# This file controls PostgreSQL user name mapping. It maps external
# user names to their corresponding PostgreSQL user names. Records
# are of the form:
#
# MAPNAME SYSTEM-USERNAME PG-USERNAME
#
# (The uppercase quantities must be replaced by actual values.)
#
# MAPNAME is the (otherwise freely chosen) map name that was used in
# pg_hba.conf. SYSTEM-USERNAME is the detected user name of the
# client. PG-USERNAME is the requested PostgreSQL user name. The
# existence of a record specifies that SYSTEM-USERNAME may connect as
# PG-USERNAME.
#
# If SYSTEM-USERNAME starts with a slash (/), it will be treated as a
# regular expression. Optionally this can contain a capture (a
# parenthesized subexpression). The substring matching the capture
# will be substituted for \1 (backslash-one) if present in
# PG-USERNAME.
#
# Multiple maps may be specified in this file and used by pg_hba.conf.
#
# No map names are defined in the default configuration. If all
# system user names and PostgreSQL user names are the same, you don’t
# need anything in this file.
#
# This file is read on server startup and when the postmaster receives
# a SIGHUP signal. If you edit the file on a running system, you have
# to SIGHUP the postmaster for the changes to take effect. You can
# use “pg_ctl reload” to do that.

# Put your actual configuration here
# ———————————-

# MAPNAME SYSTEM-USERNAME PG-USERNAME
# Do not edit this file manually!
# It will be overwritten by the ALTER SYSTEM command.
# —————————–
# PostgreSQL configuration file
# —————————–
#
# This file consists of lines of the form:
#
# name = value
#
# (The “=” is optional.) 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 PostgreSQL documentation.
#
# The commented-out settings shown in this file represent the default values.
# Re-commenting a setting is NOT sufficient to revert it to the default value;
# you need to reload the server.
#
# 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 “pg_ctl reload”. Some
# parameters, which are marked below, require a server shutdown and restart to
# take effect.
#
# Any parameter can also be given as a command-line option to the server, e.g.,
# “postgres -c log_connections=on”. Some parameters can be changed at run time
# with the “SET” SQL command.
#
# Memory units: kB = kilobytes Time units: ms = milliseconds
# MB = megabytes s = seconds
# GB = gigabytes min = minutes
# TB = terabytes h = hours
# d = days
#——————————————————————————
# FILE LOCATIONS
#——————————————————————————

# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.

#data_directory = ‘ConfigDir’ # use data in another directory
# (change requires restart)
#hba_file = ‘ConfigDir/pg_hba.conf’ # host-based authentication file
# (change requires restart)
#ident_file = ‘ConfigDir/pg_ident.conf’ # ident configuration file
# (change requires restart)

# If external_pid_file is not explicitly set, no extra PID file is written.
#external_pid_file = ” # write an extra PID file
# (change requires restart)
#——————————————————————————
# CONNECTIONS AND AUTHENTICATION
#——————————————————————————

# – Connection Settings –

#listen_addresses = ‘localhost’ # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to ‘localhost’; use ‘*’ for all
# (change requires restart)
#port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
# Note: Increasing max_connections costs ~400 bytes of shared memory per
# connection slot, plus lock space (see max_locks_per_transaction).
#superuser_reserved_connections = 3 # (change requires restart)
#unix_socket_directories = ‘/tmp’ # comma-separated list of directories
# (change requires restart)
#unix_socket_group = ” # (change requires restart)
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
# (change requires restart)
#bonjour = off # advertise server via Bonjour
# (change requires restart)
#bonjour_name = ” # defaults to the computer name
# (change requires restart)

# – Security and Authentication –

#authentication_timeout = 1min # 1s-600s
#ssl = off # (change requires restart)
#ssl_ciphers = ‘HIGH:MEDIUM:+3DES:!aNULL’ # allowed SSL ciphers
# (change requires restart)
#ssl_prefer_server_ciphers = on # (change requires restart)
#ssl_ecdh_curve = ‘prime256v1’ # (change requires restart)
#ssl_renegotiation_limit = 512MB # amount of data between renegotiations
#ssl_cert_file = ‘server.crt’ # (change requires restart)
#ssl_key_file = ‘server.key’ # (change requires restart)
#ssl_ca_file = ” # (change requires restart)
#ssl_crl_file = ” # (change requires restart)
#password_encryption = on
#db_user_namespace = off

# GSSAPI using Kerberos
#krb_server_keyfile = ”
#krb_caseins_users = off

# – TCP Keepalives –
# see “man 7 tcp” for details

#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
# 0 selects the system default
#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
# 0 selects the system default
#tcp_keepalives_count = 0 # TCP_KEEPCNT;
# 0 selects the system default
#——————————————————————————
# RESOURCE USAGE (except WAL)
#——————————————————————————

# – Memory –

shared_buffers = 128MB # min 128kB
# (change requires restart)
#huge_pages = try # on, off, or try
# (change requires restart)
#temp_buffers = 8MB # min 800kB
#max_prepared_transactions = 0 # zero disables the feature
# (change requires restart)
# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory
# per transaction slot, plus lock space (see max_locks_per_transaction).
# It is not advisable to set max_prepared_transactions nonzero unless you
# actively intend to use prepared transactions.
#work_mem = 4MB # min 64kB
#maintenance_work_mem = 64MB # min 1MB
#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem
#max_stack_depth = 2MB # min 100kB
dynamic_shared_memory_type = posix # the default is the first option
# supported by the operating system:
# posix
# sysv
# windows
# mmap
# use none to disable dynamic shared memory

# – Disk –

#temp_file_limit = -1 # limits per-session temp file space
# in kB, or -1 for no limit

# – Kernel Resource Usage –

#max_files_per_process = 1000 # min 25
# (change requires restart)
#shared_preload_libraries = ” # (change requires restart)

# – Cost-Based Vacuum Delay –

#vacuum_cost_delay = 0 # 0-100 milliseconds
#vacuum_cost_page_hit = 1 # 0-10000 credits
#vacuum_cost_page_miss = 10 # 0-10000 credits
#vacuum_cost_page_dirty = 20 # 0-10000 credits
#vacuum_cost_limit = 200 # 1-10000 credits

# – Background Writer –

#bgwriter_delay = 200ms # 10-10000ms between rounds
#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round
#bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round

# – Asynchronous Behavior –

#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching
#max_worker_processes = 8
#——————————————————————————
# WRITE AHEAD LOG
#——————————————————————————

# – Settings –

#wal_level = minimal # minimal, archive, hot_standby, or logical
# (change requires restart)
#fsync = on # turns forced synchronization on or off
#synchronous_commit = on # synchronization level;
# off, local, remote_write, or on
#wal_sync_method = fsync # the default is the first option
# supported by the operating system:
# open_datasync
# fdatasync (default on Linux)
# fsync
# fsync_writethrough
# open_sync
#full_page_writes = on # recover from partial page writes
#wal_log_hints = off # also do full page writes of non-critical updates
# (change requires restart)
#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
# (change requires restart)
#wal_writer_delay = 200ms # 1-10000 milliseconds

#commit_delay = 0 # range 0-100000, in microseconds
#commit_siblings = 5 # range 1-1000

# – Checkpoints –

#checkpoint_segments = 3 # in logfile segments, min 1, 16MB each
#checkpoint_timeout = 5min # range 30s-1h
#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 – 1.0
#checkpoint_warning = 30s # 0 disables

# – Archiving –

#archive_mode = off # allows archiving to be done
# (change requires restart)
#archive_command = ” # command to use to archive a logfile segment
# placeholders: %p = path of file to archive
# %f = file name only
# e.g. ‘test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f’
#archive_timeout = 0 # force a logfile segment switch after this
# number of seconds; 0 disables
#——————————————————————————
# REPLICATION
#——————————————————————————

# – Sending Server(s) –

# Set these on the master and on any standby that will send replication data.

#max_wal_senders = 0 # max number of walsender processes
# (change requires restart)
#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
#wal_sender_timeout = 60s # in milliseconds; 0 disables

#max_replication_slots = 0 # max number of replication slots
# (change requires restart)

# – Master Server –

# These settings are ignored on a standby server.

#synchronous_standby_names = ” # standby servers that provide sync rep
# comma-separated list of application_name
# from standby(s); ‘*’ = all
#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed

# – Standby Servers –

# These settings are ignored on a master server.

#hot_standby = off # “on” allows queries during recovery
# (change requires restart)
#max_standby_archive_delay = 30s # max delay before canceling queries
# when reading WAL from archive;
# -1 allows indefinite delay
#max_standby_streaming_delay = 30s # max delay before canceling queries
# when reading streaming WAL;
# -1 allows indefinite delay
#wal_receiver_status_interval = 10s # send replies at least this often
# 0 disables
#hot_standby_feedback = off # send info from standby to prevent
# query conflicts
#wal_receiver_timeout = 60s # time that receiver waits for
# communication from master
# in milliseconds; 0 disable

listen_addresses = ‘localhost,10.42.105.44’
wal_level = ‘hot_standby’
archive_mode = on
archive_command = ‘cd .’
max_wal_senders = 1
hot_standby = on

#——————————————————————————
# QUERY TUNING
#——————————————————————————

# – Planner Method Configuration –

#enable_bitmapscan = on
#enable_hashagg = on
#enable_hashjoin = on
#enable_indexscan = on
#enable_indexonlyscan = on
#enable_material = on
#enable_mergejoin = on
#enable_nestloop = on
#enable_seqscan = on
#enable_sort = on
#enable_tidscan = on

# – Planner Cost Constants –

#seq_page_cost = 1.0 # measured on an arbitrary scale
#random_page_cost = 4.0 # same scale as above
#cpu_tuple_cost = 0.01 # same scale as above
#cpu_index_tuple_cost = 0.005 # same scale as above
#cpu_operator_cost = 0.0025 # same scale as above
#effective_cache_size = 4GB

# – Genetic Query Optimizer –

#geqo = on
#geqo_threshold = 12
#geqo_effort = 5 # range 1-10
#geqo_pool_size = 0 # selects default based on effort
#geqo_generations = 0 # selects default based on effort
#geqo_selection_bias = 2.0 # range 1.5-2.0
#geqo_seed = 0.0 # range 0.0-1.0

# – Other Planner Options –

#default_statistics_target = 100 # range 1-10000
#constraint_exclusion = partition # on, off, or partition
#cursor_tuple_fraction = 0.1 # range 0.0-1.0
#from_collapse_limit = 8
#join_collapse_limit = 8 # 1 disables collapsing of explicit
# JOIN clauses
#——————————————————————————
# ERROR REPORTING AND LOGGING
#——————————————————————————

# – Where to Log –

log_destination = ‘stderr’ # Valid values are combinations of
# stderr, csvlog, syslog, and eventlog,
# depending on platform. csvlog
# requires logging_collector to be on.

# This is used when logging to stderr:
logging_collector = on # Enable capturing of stderr and csvlog
# into log files. Required to be on for
# csvlogs.
# (change requires restart)

# These are only used if logging_collector is on:
log_directory = ‘pg_log’ # directory where log files are written,
# can be absolute or relative to PGDATA
log_filename = ‘postgresql-%a.log’ # log file name pattern,
# can include strftime() escapes
#log_file_mode = 0600 # creation mode for log files,
# begin with 0 to use octal notation
log_truncate_on_rotation = on # If on, an existing log file with the
# same name as the new log file will be
# truncated rather than appended to.
# But such truncation only occurs on
# time-driven rotation, not on restarts
# or size-driven rotation. Default is
# off, meaning append to existing files
# in all cases.
log_rotation_age = 1d # Automatic rotation of logfiles will
# happen after that time. 0 disables.
log_rotation_size = 0 # Automatic rotation of logfiles will
# happen after that much log output.
# 0 disables.

# These are relevant when logging to syslog:
#syslog_facility = ‘LOCAL0’
#syslog_ident = ‘postgres’

# This is only relevant when logging to eventlog (win32):
#event_source = ‘PostgreSQL’

# – When to Log –

#client_min_messages = notice # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# log
# notice
# warning
# error

#log_min_messages = warning # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic

#log_min_error_statement = error # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic (effectively off)

#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
# and their durations, > 0 logs only
# statements running at least this number
# of milliseconds
# – What to Log –

#debug_print_parse = off
#debug_print_rewritten = off
#debug_print_plan = off
#debug_pretty_print = on
#log_checkpoints = off
#log_connections = off
#log_disconnections = off
#log_duration = off
#log_error_verbosity = default # terse, default, or verbose messages
#log_hostname = off
log_line_prefix = ‘< %m >’ # special values:
# %a = application name
# %u = user name
# %d = database name
# %r = remote host and port
# %h = remote host
# %p = process ID
# %t = timestamp without milliseconds
# %m = timestamp with milliseconds
# %i = command tag
# %e = SQL state
# %c = session ID
# %l = session line number
# %s = session start timestamp
# %v = virtual transaction ID
# %x = transaction ID (0 if none)
# %q = stop here in non-session
# processes
# %% = ‘%’
# e.g. ‘<%u%%%d> ‘
#log_lock_waits = off # log lock waits >= deadlock_timeout
#log_statement = ‘none’ # none, ddl, mod, all
#log_temp_files = -1 # log temporary files equal or larger
# than the specified size in kilobytes;
# -1 disables, 0 logs all temp files
log_timezone = ‘US/Eastern’
#——————————————————————————
# RUNTIME STATISTICS
#——————————————————————————

# – Query/Index Statistics Collector –

#track_activities = on
#track_counts = on
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
#update_process_title = on
#stats_temp_directory = ‘pg_stat_tmp’
# – Statistics Monitoring –

#log_parser_stats = off
#log_planner_stats = off
#log_executor_stats = off
#log_statement_stats = off
#——————————————————————————
# AUTOVACUUM PARAMETERS
#——————————————————————————

#autovacuum = on # Enable autovacuum subprocess? ‘on’
# requires track_counts to also be on.
#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and
# their durations, > 0 logs only
# actions running at least this number
# of milliseconds.
#autovacuum_max_workers = 3 # max number of autovacuum subprocesses
# (change requires restart)
#autovacuum_naptime = 1min # time between autovacuum runs
#autovacuum_vacuum_threshold = 50 # min number of row updates before
# vacuum
#autovacuum_analyze_threshold = 50 # min number of row updates before
# analyze
#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
# (change requires restart)
#autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age
# before forced vacuum
# (change requires restart)
#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
# autovacuum, in milliseconds;
# -1 means use vacuum_cost_delay
#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
# autovacuum, -1 means use
# vacuum_cost_limit
#——————————————————————————
# CLIENT CONNECTION DEFAULTS
#——————————————————————————

# – Statement Behavior –

#search_path = ‘”$user”,public’ # schema names
#default_tablespace = ” # a tablespace name, ” uses the default
#temp_tablespaces = ” # a list of tablespace names, ” uses
# only default tablespace
#check_function_bodies = on
#default_transaction_isolation = ‘read committed’
#default_transaction_read_only = off
#default_transaction_deferrable = off
#session_replication_role = ‘origin’
#statement_timeout = 0 # in milliseconds, 0 is disabled
#lock_timeout = 0 # in milliseconds, 0 is disabled
#vacuum_freeze_min_age = 50000000
#vacuum_freeze_table_age = 150000000
#vacuum_multixact_freeze_min_age = 5000000
#vacuum_multixact_freeze_table_age = 150000000
#bytea_output = ‘hex’ # hex, escape
#xmlbinary = ‘base64’
#xmloption = ‘content’

# – Locale and Formatting –

datestyle = ‘iso, mdy’
#intervalstyle = ‘postgres’
timezone = ‘US/Eastern’
#timezone_abbreviations = ‘Default’ # Select the set of available time zone
# abbreviations. Currently, there are
# Default
# Australia (historical usage)
# India
# You can create your own file in
# share/timezonesets/.
#extra_float_digits = 0 # min -15, max 3
#client_encoding = sql_ascii # actually, defaults to database
# encoding

# These settings are initialized by initdb, but they can be changed.
lc_messages = ‘en_US.UTF-8’ # locale for system error message
# strings
lc_monetary = ‘en_US.UTF-8’ # locale for monetary formatting
lc_numeric = ‘en_US.UTF-8’ # locale for number formatting
lc_time = ‘en_US.UTF-8’ # locale for time formatting

# default configuration for text search
default_text_search_config = ‘pg_catalog.english’

# – Other Defaults –

#dynamic_library_path = ‘$libdir’
#local_preload_libraries = ”
#session_preload_libraries = ”
#——————————————————————————
# LOCK MANAGEMENT
#——————————————————————————

#deadlock_timeout = 1s
#max_locks_per_transaction = 64 # min 10
# (change requires restart)
# Note: Each lock table slot uses ~270 bytes of shared memory, and there are
# max_locks_per_transaction * (max_connections + max_prepared_transactions)
# lock table slots.
#max_pred_locks_per_transaction = 64 # min 10
# (change requires restart)
#——————————————————————————
# VERSION/PLATFORM COMPATIBILITY
#——————————————————————————

# – Previous PostgreSQL Versions –

#array_nulls = on
#backslash_quote = safe_encoding # on, off, or safe_encoding
#default_with_oids = off
#escape_string_warning = on
#lo_compat_privileges = off
#quote_all_identifiers = off
#sql_inheritance = on
#standard_conforming_strings = on
#synchronize_seqscans = on

# – Other Platforms and Clients –

#transform_null_equals = off
#——————————————————————————
# ERROR HANDLING
#——————————————————————————

#exit_on_error = off # terminate session on any error?
#restart_after_crash = on # reinitialize after backend crash?
#——————————————————————————
# CONFIG FILE INCLUDES
#——————————————————————————

# These options allow settings to be loaded from files other than the
# default postgresql.conf.

#include_dir = ‘conf.d’ # include files ending in ‘.conf’ from
# directory ‘conf.d’
#include_if_exists = ‘exists.conf’ # include file only if it exists
#include = ‘special.conf’ # include file
#——————————————————————————
# CUSTOMIZED OPTIONS
#——————————————————————————

# Add settings for extensions here

listen_addresses = ‘localhost,10.116.175.107’
wal_level = ‘hot_standby’
archive_mode = on
archive_command = ‘cd .’
max_wal_senders = 1
hot_standby = on
standby_mode = ‘on’
primary_conninfo = ‘host=10.42.105.44 port=5432 user=rep password=yourpassword’
trigger_file = ‘/tmp/postgresql.trigger.5432’
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] grep ‘test123’ *.conf
recovery.conf:primary_conninfo = ‘host=10.42.105.44 port=5432 user=rep password=test123’
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] sed -i “s/test123/yourpassword/g” *.conf
[ root @ masterhost : /var/lib/pgsql/9.4/data ]

[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] /etc/rc.d/init.d/postgresql-9.4 restart
Stopping postgresql-9.4 service: [ OK ]
Starting postgresql-9.4 service: [ OK ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat ../pgstartup.log; cat pg_log/postgresql-Fri.log ; > pg_log/postgresql-Fri.log; > ../pgstartup.log
< 2015-07-24 11:23:22.300 EDT >LOG: could not create IPv6 socket: Address family not supported by protocol
< 2015-07-24 11:23:22.331 EDT >LOG: redirecting log output to logging collector process
< 2015-07-24 11:23:22.331 EDT >HINT: Future log output will appear in directory “pg_log”.
< 2015-07-24 11:23:09.182 EDT >FATAL: could not connect to the primary server: FATAL: password authentication failed for user “rep”

< 2015-07-24 11:23:14.315 EDT >FATAL: could not connect to the primary server: FATAL: password authentication failed for user “rep”

< 2015-07-24 11:23:19.453 EDT >FATAL: could not connect to the primary server: FATAL: password authentication failed for user “rep”

< 2015-07-24 11:23:21.248 EDT >LOG: received fast shutdown request
< 2015-07-24 11:23:21.250 EDT >LOG: shutting down
< 2015-07-24 11:23:21.253 EDT >LOG: database system is shut down
< 2015-07-24 11:23:22.333 EDT >LOG: database system was shut down in recovery at 2015-07-24 11:23:21 EDT
< 2015-07-24 11:23:22.334 EDT >LOG: entering standby mode
< 2015-07-24 11:23:22.339 EDT >LOG: redo starts at 0/2000028
< 2015-07-24 11:23:22.339 EDT >LOG: record with zero length at 0/2000100
< 2015-07-24 11:23:22.554 EDT >LOG: started streaming WAL from primary at 0/2000000 on timeline 2
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat ../pgstartup.log; cat pg_log/postgresql-Fri.log ; > pg_log/postgresql-Fri.log; > ../pgstartup.log
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat ../pgstartup.log; cat pg_log/postgresql-Fri.log ; > pg_log/postgresql-Fri.log; > ../pgstartup.log
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] tailf pg_log/postgresql-Fri.log
^C
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] su postgres
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ] psql
psql: FATAL: the database system is starting up
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ] psql
psql: FATAL: the database system is starting up
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ] ps -ef | grep postgres
postgres 26669 1 0 11:23 ? 00:00:00 /usr/pgsql-9.4/bin/postmaster -D /var/lib/pgsql/9.4/data
postgres 26675 26669 0 11:23 ? 00:00:00 postgres: logger process
postgres 26678 26669 0 11:23 ? 00:00:00 postgres: startup process recovering 000000020000000000000002
postgres 26679 26669 0 11:23 ? 00:00:00 postgres: checkpointer process
postgres 26680 26669 0 11:23 ? 00:00:00 postgres: writer process
postgres 26681 26669 0 11:23 ? 00:00:00 postgres: wal receiver process streaming 0/2010588
root 26851 30569 0 11:24 pts/3 00:00:00 su postgres
postgres 26852 26851 0 11:24 pts/3 00:00:00 bash
postgres 26903 26852 0 11:24 pts/3 00:00:00 ps -ef
postgres 26904 26852 0 11:24 pts/3 00:00:00 grep postgres
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ] exit
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat ../pgstartup.log; cat pg_log/postgresql-Fri.log ; > pg_log/postgresql-Fri.log; > ../pgstartup.log
< 2015-07-24 11:24:35.292 EDT >FATAL: the database system is starting up
< 2015-07-24 11:24:42.435 EDT >FATAL: the database system is starting up
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] psql
psql: FATAL: the database system is starting up
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat pg_log/postgresql-Fri.log pg_log/postgresql-Fri.log
< 2015-07-24 11:25:32.737 EDT >FATAL: the database system is starting up
< 2015-07-24 11:25:32.737 EDT >FATAL: the database system is starting up
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat pg_log/postgresql-Fri.log pg_log/postgresql-Fri.log
< 2015-07-24 11:25:32.737 EDT >FATAL: the database system is starting up
< 2015-07-24 11:25:32.737 EDT >FATAL: the database system is starting up
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat pg_log/postgresql-Fri.log pg_log/postgresql-Fri.log
< 2015-07-24 11:25:32.737 EDT >FATAL: the database system is starting up
< 2015-07-24 11:25:32.737 EDT >FATAL: the database system is starting up
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat ../pgstartup.log; cat pg_log/postgresql-Fri.log ; > pg_log/postgresql-Fri.log; > ../pgstartup.log
< 2015-07-24 11:25:32.737 EDT >FATAL: the database system is starting up
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat ../pgstartup.log; cat pg_log/postgresql-Fri.log ; > pg_log/postgresql-Fri.log; > ../pgstartup.log
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat ../pgstartup.log; cat pg_log/postgresql-Fri.log ; > pg_log/postgresql-Fri.log; > ../pgstartup.log
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ps -ef | grep psql
root 27102 30569 0 11:26 pts/3 00:00:00 grep psql
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ps -ef | grep postgres
postgres 26669 1 0 11:23 ? 00:00:00 /usr/pgsql-9.4/bin/postmaster -D /var/lib/pgsql/9.4/data
postgres 26675 26669 0 11:23 ? 00:00:00 postgres: logger process
postgres 26678 26669 0 11:23 ? 00:00:00 postgres: startup process recovering 000000020000000000000002
postgres 26679 26669 0 11:23 ? 00:00:00 postgres: checkpointer process
postgres 26680 26669 0 11:23 ? 00:00:00 postgres: writer process
postgres 26681 26669 0 11:23 ? 00:00:00 postgres: wal receiver process streaming 0/2010588
root 27134 30569 0 11:26 pts/3 00:00:00 grep postgres
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ps -ef | grep postgres
postgres 26669 1 0 11:23 ? 00:00:00 /usr/pgsql-9.4/bin/postmaster -D /var/lib/pgsql/9.4/data
postgres 26675 26669 0 11:23 ? 00:00:00 postgres: logger process
postgres 26678 26669 0 11:23 ? 00:00:00 postgres: startup process recovering 000000020000000000000002
postgres 26679 26669 0 11:23 ? 00:00:00 postgres: checkpointer process
postgres 26680 26669 0 11:23 ? 00:00:00 postgres: writer process
postgres 26681 26669 0 11:23 ? 00:00:00 postgres: wal receiver process streaming 0/2010588
root 27182 30569 0 11:26 pts/3 00:00:00 grep postgres
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] psql
psql: FATAL: the database system is starting up
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] ll -lhtr
total 132K
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_twophase
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_tblspc
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_stat
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_snapshots
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_serial
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_replslot
drwx—— 4 postgres postgres 4.0K Jul 24 11:17 pg_multixact
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_dynshmem
drwx—— 4 postgres postgres 4.0K Jul 24 11:17 pg_logical
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_subtrans
drwx—— 2 postgres postgres 4.0K Jul 24 11:17 pg_clog
drwx—— 5 postgres postgres 4.0K Jul 24 11:17 base
-rwx—— 1 postgres postgres 202 Jul 24 11:18 backup_label.old
drwx—— 2 postgres postgres 4.0K Jul 24 11:19 pg_log
-rwx—— 1 postgres postgres 4 Jul 24 11:19 PG_VERSION
drwx—— 3 postgres postgres 4.0K Jul 24 11:19 pg_xlog
-rwx—— 1 postgres postgres 141 Jul 24 11:19 recovery.done
drwx—— 2 postgres postgres 4.0K Jul 24 11:20 global
drwx—— 2 postgres postgres 4.0K Jul 24 11:20 pg_stat_tmp
-rwx—— 1 postgres postgres 4.2K Jul 24 11:23 pg_hba.conf
-rwx—— 1 postgres postgres 88 Jul 24 11:23 postgresql.auto.conf
-rwx—— 1 postgres postgres 1.6K Jul 24 11:23 pg_ident.conf
-rwx—— 1 postgres postgres 22K Jul 24 11:23 postgresql.conf
-rwx—— 1 postgres postgres 146 Jul 24 11:23 recovery.conf
-rw——- 1 postgres postgres 81 Jul 24 11:23 postmaster.pid
drwx—— 2 postgres postgres 4.0K Jul 24 11:23 pg_notify
-rwx—— 1 postgres postgres 59 Jul 24 11:23 postmaster.opts
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat postmaster.opts
backup_label.old pg_clog/ pg_ident.conf pg_multixact/ pg_serial/ pg_stat_tmp/ pg_twophase/ postgresql.auto.conf postmaster.pid
base/ pg_dynshmem/ pg_log/ pg_notify/ pg_snapshots/ pg_subtrans/ PG_VERSION postgresql.conf recovery.conf
global/ pg_hba.conf pg_logical/ pg_replslot/ pg_stat/ pg_tblspc/ pg_xlog/ postmaster.opts recovery.done
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat postmaster.opts
backup_label.old pg_clog/ pg_ident.conf pg_multixact/ pg_serial/ pg_stat_tmp/ pg_twophase/ postgresql.auto.conf postmaster.pid
base/ pg_dynshmem/ pg_log/ pg_notify/ pg_snapshots/ pg_subtrans/ PG_VERSION postgresql.conf recovery.conf
global/ pg_hba.conf pg_logical/ pg_replslot/ pg_stat/ pg_tblspc/ pg_xlog/ postmaster.opts recovery.done
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat postmaster.opts
/usr/pgsql-9.4/bin/postgres “-D” “/var/lib/pgsql/9.4/data”
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] cat recovery.conf
standby_mode = ‘on’
primary_conninfo = ‘host=10.42.105.44 port=5432 user=rep password=yourpassword’
trigger_file = ‘/tmp/postgresql.trigger.5432’
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ]
[ root @ masterhost : /var/lib/pgsql/9.4/data ] su postgres
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ] psql
psql: FATAL: the database system is starting up
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ]
[ postgres @ masterhost : ~/9.4/data ] pg_log/postgresql-Fri.log
======================================================
Tectia – SSH Terminal 6.2.1.168
Copyright (c) 2000-2011 Tectia Corp – http://www.tectia.com/

Licensed to CD-ROM customer, N/A

Last login: Wed Jul 22 2015 13:54:22 -0400 from ruttanpvt009.nam.nsroot.net
$ bash
bash-4.1$
bash-4.1$
bash-4.1$
bash-4.1$
bash-4.1$ pbrun root

Password:
Enter reason for this privilege access:
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ] echo ” ” >> ~/.bashrc
[ root @ slavehost : ~ ] echo “####### http proxy settings ##### ” >> ~/.bashrc
[ root @ slavehost : ~ ] echo “export http_proxy=http://webproxy.ssmb.com:8080/” >> ~/.bashrc
[ root @ slavehost : ~ ] echo “export https_proxy=http://webproxy.ssmb.com:8080/” >> ~/.bashrc
[ root @ slavehost : ~ ] source ~/.bashrc
[ root @ slavehost : ~ ] env | grep ‘_proxy’
http_proxy=http://webproxy.ssmb.com:8080/
https_proxy=http://webproxy.ssmb.com:8080/
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ] echo “proxy=http://webproxy.ssmb.com:8080” >> /etc/yum.conf
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ] curl -O https://fastdl.mongodb.org/linux/mongodb-linux-i686-3.0.4.tgz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 36.5M 100 36.5M 0 0 5993k 0 0:00:06 0:00:06 –:–:– 6190k
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ] yum install postgresql-server
Setting up Install Process
soe6products | 1.2 kB 00:00
soe6u6 | 1.2 kB 00:00
No package postgresql-server available.
Error: Nothing to do
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ] cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.6 (Santiago)
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ]

[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ]

[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ] service postgresql-9.4 initdb
Initializing database: [ OK ]
[ root @ slavehost : ~ ]
[ root @ slavehost : ~ ]
[ root @ slavehost : /var/lib/pgsql/9.4/data ]

[ root @ slavehost : /var/lib/pgsql/9.4/data ] /etc/rc.d/init.d/postgresql-9.4 restart
Stopping postgresql-9.4 service: [ OK ]
Starting postgresql-9.4 service: [ OK ]
[ root @ slavehost : /var/lib/pgsql/9.4/data ]
[ root @ slavehost : /var/lib/pgsql/9.4/data ]
[ root @ slavehost : /var/lib/pgsql/9.4/data ] chmod 700 /var/lib/pgsql/9.4/ -R; chown postgres:postgres /var/lib/pgsql/9.4/ -R
[ root @ slavehost : /var/lib/pgsql/9.4/data ]
[ root @ slavehost : /var/lib/pgsql/9.4/data ]
[ root @ slavehost : /var/lib/pgsql/9.4/data ]
[ root @ slavehost : /var/lib/pgsql/9.4/data ] su postgres
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ] ll -lhtr
bash: ll: command not found
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ] psql -c “CREATE USER rep REPLICATION LOGIN CONNECTION LIMIT 1 ENCRYPTED PASSWORD ‘yourpassword’;”
ERROR: role “rep” already exists
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ] psql -c “select pg_start_backup(‘initial_backup’);”
pg_start_backup
—————–
0/2000028
(1 row)

[ postgres @ slavehost : ~/9.4/data ] scp -r * masterhost:/var/lib/pgsql/9.4/data/

You are authorized to use this System for approved business purposes only.
Use for any other purpose is prohibited. All transactional records, reports,
email, software and other data generated by or residing upon this System,
to the extent permitted by local law, are the property of dbversitygroup Inc.
or one of its subsidiaries or their affiliates
(individually or collectively ‘ dbversitygroup ‘) and may be used by dbversitygroup
for any purpose authorized and permissible in your country of work.
Activities on this System are monitored to the extent permitted by local law.
backup_label | 202B | 2.0kiB/s | TOC: 00:00:00 | 100%
12871 | 392kB | 2.1MiB/s | TOC: 00:00:00 | 100%
12847 | 256kB | 1.4MiB/s | TOC: 00:00:00 | 100%
12757 | 536kB | 2.8MiB/s | TOC: 00:00:00 | 100%
00000002.history | 41B | 305B/s | TOC: 00:00:00 | 100%
000000020000000000000001 | 16MB | 7.2MiB/s | TOC: 00:00:02 | 100%
000000020000000000000002 | 16MB | 6.5MiB/s | TOC: 00:00:02 | 100%
000000010000000000000001 | 16MB | 5.9MiB/s | TOC: 00:00:02 | 100%
postgresql.auto.conf | 88B | 679B/s | TOC: 00:00:00 | 100%
postgresql.conf | 21kB | 160.6kiB/s | TOC: 00:00:00 | 100%
postmaster.opts | 59B | 607B/s | TOC: 00:00:00 | 100%
postmaster.pid | 81B | 831B/s | TOC: 00:00:00 | 100%
recovery.done | 141B | 1.4kiB/s | TOC: 00:00:00 | 100%
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ]
[ postgres @ slavehost : ~/9.4/data ] cd
[ postgres @ slavehost : ~ ]
[ postgres @ slavehost : ~ ]
[ postgres @ slavehost : ~ ]
[ postgres @ slavehost : ~ ]
[ postgres @ slavehost : ~ ]
[ postgres @ slavehost : ~ ] psql
psql (9.4.4)
Type “help” for help.

postgres=#
postgres=#
postgres=# CREATE TABLE rep_test (test varchar(40));
CREATE TABLE
postgres=#
postgres=#
postgres=# INSERT INTO rep_test VALUES (‘data one’);
INSERT 0 1
postgres=# INSERT INTO rep_test VALUES (‘some more words’);
INSERT 0 1
postgres=# INSERT INTO rep_test VALUES (‘lalala’);
INSERT 0 1
postgres=# INSERT INTO rep_test VALUES (‘hello there’);
INSERT 0 1
postgres=# INSERT INTO rep_test VALUES (‘blahblah’);
INSERT 0 1
postgres=#
postgres=# SELECT * FROM rep_test;
test
—————–
data one
some more words
lalala
hello there
blahblah
(5 rows)

postgres=#
postgres=# SELECT * FROM rep_test;
test
—————–
data one
some more words
lalala
hello there
blahblah
(5 rows)

postgres=#
postgres=#
postgres=#
listen_addresses = ‘localhost,10.42.105.44’
wal_level = ‘hot_standby’
archive_mode = on
archive_command = ‘cd .’
max_wal_senders = 1
hot_standby = on

host replication rep 10.42.105.44/32 md5
listen_addresses = ‘localhost,10.116.175.107’
wal_level = ‘hot_standby’
archive_mode = on
archive_command = ‘cd .’
max_wal_senders = 1
hot_standby = on
rsync -cva –inplace –exclude=*pg_xlog* /var/lib/pgsql/9.4/data/ 10.116.175.107:/var/lib/pgsql/9.4/data

standby_mode = ‘on’
primary_conninfo = ‘host=10.42.105.44 port=5432 user=rep password=test123’
trigger_file = ‘/tmp/postgresql.trigger.5432’
chmod 700 /var/lib/pgsql/9.4/ -R; chown postgres:postgres /var/lib/pgsql/9.4/ -R
cat ../pgstartup.log; cat pg_log/postgresql-Fri.log ; > pg_log/postgresql-Fri.log; > ../pgstartup.log

==============

reference links :
https://wiki.postgresql.org/wiki/Streaming_Replication
http://www.postgresql.org/docs/9.3/static/tutorial-install.html
http://www.cyberdbversity.biz/tips/postgres-allow-remote-access-tcp-connection.html
http://www.cyberdbversity.biz/faq/howto-fedora-linux-install-postgresql-server/

  • Ask Question