repmgr+pg13.4叢集搭建
1:建立使用者,使用者組
groupadd postgres
useradd -g postgres postgres
2:root使用者,安裝依賴包
yum install -y bison
yum install -y flex
yum install -y readline-devel
yum install -y zlib-devel
3:postgres 建立安裝路徑和原始碼包上傳路徑:
mkdir -p /postgresql-12.4/data
mk
mkdir soft
4:上傳tar包原始碼:我上傳到/home/postgres/soft,並賦權,解壓,
5:編譯:postgres使用者編譯即可;
5.1配置選項生成Makefile,預設安裝到目錄:/home/postgres/postgresql-12.4
./configure --prefix=/home/postgres/postgresql-12.4
5.2編譯並安裝
make
make install
6:配置相關路徑,.bash_profile
export PGHOME=/home/postgres/postgresql-12.4
export PGDATA=/home/postgres/postgresql-12.4/data
PATH=$PATH:$HOME/bin:$PGHOME/bin
7:初始化資料庫
initdb -D /home/postgres/postgresql12.4/data
8:修改postgresql.conf,pg_hba.conf
8.1:pg_hba.conf
8.2:postgresq.conf
9:啟動資料庫
psql -U postgres -p 5444
10:設定postgres密碼
ALTER USER postgres with encrypted password '123456ab!';
study hard and make progress every day !