Here what I did so far after
make install.
mkdir /usr/local/pgsql/log
Run
./usr/local/pgsql/bin/pg_ctl –D
/postgres_data/pgsql/data –l /usr/local/pgsql/log/logfile start
psql
in the psql shell
psql# create user replica
replication login encrypted password ‘replicauser@’;
psql# alter user postgres
password ‘password@’;
configure postgresql.conf:
port = 5432
unix_socket_directorys = ’tmp’
max_files_per_process = 1000
listen_addresses = ‘localhost,
192.168.2.122 ‘ à (master-server-ip)
wal_level = replica
max_replication_slots = 10
archive_mode = on
archive_command = ‘cp –I %p
/u02/postgres/main/archive/%f’
max_wal_senders = 10
wal_keep_segments = 64
for pg_hba.conf, I added:
local
all postgres md5 à authenticate postgres
host
replication replica
192.##.##.##/32 md5 à master-server
host
replication replica
192.##.##.##/32 md5 à slave-server
$ mkdir –p
/u02/postgres/main/archive
$ systemctl restart postgresql
=== AUTHENTICATING FOR
org.freedesktop.systemd1.manage-units ===
Autehtication is required to
manage system services or units.
Authenticating as: sysmaint
Password:
=== AUTHENTICATION COMPLETE ===
Job for postgresql-11.service
failed because the control process existed with error code. See “systemctl
status postgresql-11.service” and “journalctl –xe” for details.
For the status, it complained about
/usr/lib/systemd/system/postgresql-11.service; disabled; vendor preset: disabled_
Active: failed (Result:
exit-code) since date: time
Process:10188
ExecStartPre=/usr/pgsql-11/bin/postgresql-11-check-db-dir ${PGDATA}
(code=existed, status=1/FAILURE)
I un-commented data_directory and
correct the path to postgresql.conf per SA suggested and still get the same
error above
data_directory =
‘/postgres_data/pgsql/data/’ --> data folder is on shared drive.
hba_file =
‘/postgres_data/pgsql/pg_hba.conf’
still prompt for the user’s
password even I am logging as postgres os user.
the binary (postgres_home) =
/usr/local/pgsql/ should owned by root:root, right?
The problem I think but not sure
I am right, I found there’s another source on /usr/pgql-11/bin existed on the
server. When the SA installed the OS Patch, the server had
postgres-9.6. I can run any date for Postgresql 11. He applied OS
Patches updated, removed 9.6 and yum the postgresql11-11.1-1PGDG.rhel7.x86_64.rpm
successful, configure, make and make install and start the postgresql service without error until the configuration of pg_hba.conf and postgresql.conf. The restart service failed.
Wonder if I can remove /usr/pgql-11 or not but not sure which
one is the corrected binaries. Comparing with the single node postgres
server I did last year, the /usr/local/pgsql sounds convinced right binaries
one but /usr/pgsql-11 have more functions.