记录一次编译安装Pg_rman缺少依赖包的问题

系统版本:CentOS版本6.10(最终版)

pg_rman:https://github.com/ossc-db/pg_rman

 

-bash-4.1$ make
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic backup.o catalog.o data.o delete.o dir.o init.o parray.o pg_rman.o restore.o show.o util.o validate.o xlog.o controlfile.o pgsql_src/pg_ctl.o pgut/pgut.o pgut/pgut-port.o -L/usr/pgsql-9.5/lib -lpgcommon -lpgport -L/usr/pgsql-9.5/lib -lpq -L/usr/pgsql-9.5/lib -Wl,--as-needed -L/usr/lib64 -Wl,--as-needed -Wl,-rpath,'/usr/pgsql-9.5/lib',--enable-new-dtags -Wl,--build-id -lpgcommon -lpgport -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lrt -lcrypt -ldl -lm -o pg_rman
/usr/bin/ld: cannot find -lpam
collect2: ld 返回 1
make: *** [pg_rman] 错误 1

解决方法:

yum install pam-devel

-bash-4.1$ make

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic backup.o catalog.o data.o delete.o dir.o init.o parray.o pg_rman.o restore.o show.o util.o validate.o xlog.o controlfile.o pgsql_src/pg_ctl.o pgut/pgut.o pgut/pgut-port.o -L/usr/pgsql-9.5/lib -lpgcommon -lpgport -L/usr/pgsql-9.5/lib -lpq -L/usr/pgsql-9.5/lib -Wl,--as-needed -L/usr/lib64 -Wl,--as-needed -Wl,-rpath,'/usr/pgsql-9.5/lib',--enable-new-dtags -Wl,--build-id -lpgcommon -lpgport -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lrt -lcrypt -ldl -lm -o pg_rman
/usr/bin/ld: cannot find -lssl
collect2: ld 返回 1
make: *** [pg_rman] 错误 1

解决方法:

yum -y install openssl*

-bash-4.1$ make

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic backup.o catalog.o data.o delete.o dir.o init.o parray.o pg_rman.o restore.o show.o util.o validate.o xlog.o controlfile.o pgsql_src/pg_ctl.o pgut/pgut.o pgut/pgut-port.o -L/usr/pgsql-9.5/lib -lpgcommon -lpgport -L/usr/pgsql-9.5/lib -lpq -L/usr/pgsql-9.5/lib -Wl,--as-needed -L/usr/lib64 -Wl,--as-needed -Wl,-rpath,'/usr/pgsql-9.5/lib',--enable-new-dtags -Wl,--build-id -lpgcommon -lpgport -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lrt -lcrypt -ldl -lm -o pg_rman
/usr/bin/ld: cannot find -lreadline
collect2: ld 返回 1
make: *** [pg_rman] 错误 1

解决方法:

yum install readline-devel

编译安装pg_rman,注意pg_rman需要和postgres数据库安装在同一台主机上,在安装pg_rman之前请自行安装postgres

su - postgres
cd /tmp
git clone https://github.com/ossc-db/pg_rman.git
cd pg_rman/
git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/REL9_2_STABLE
  remotes/origin/REL9_3_STABLE
  remotes/origin/REL9_4_STABLE
  remotes/origin/REL9_5_STABLE
  remotes/origin/REL9_6_STABLE
  remotes/origin/REL_10_STABLE
  remotes/origin/master
  remotes/origin/pre-9.2
$ git checkout REL9_5_STABLE
Already on 'REL9_5_STABLE'
$ git status
$ On branch REL9_5_STABLE
nothing to commit, working directory clean

 配置环境变量

su - postgres
cd /tmp/pg_rman
make
make install

-bash-4.1$ cat ~/.bash_profile
PGDATA=/data_2/pg_server/data
export PGDATA
export PGHOME=/usr/pgsql-9.5
export PGHOME
PATH=$PATH:$HOME/.local/bin:$HOME/bin:$PGHOME/bin
export PATH
export SRVLOG_PATH=/data_2/pg_server/data/pg_log
export ARCLOG_PATH=/data/dbBack/walbackup
export BACKUP_PATH=/data/dbBack/pg_rman_backupset

source ~/.bash_profile

make installcheck

 执行回归测试,验证pg_rman是否可用

-bash-4.1$ make installcheck
/usr/pgsql-9.5/lib/pgxs/src/makefiles/../../src/test/regress/pg_regress --inputdir=./ --bindir='/usr/pgsql-9.5/bin'    --dbname=contrib_regression init option showum backup_from_standby arc_srv_log_management
(using postmaster on Unix socket, default port)
============== dropping database "contrib_regression" ==============
Password: 
DROP DATABASE
============== creating database "contrib_regression" ==============
Password: 
CREATE DATABASE
Password: 
ALTER DATABASE
============== running regression test queries        ==============
test init                     ... Password: 
ok
test option                   ... Password: 
ok
test show                     ... Password: 
ok
test delete                   ... Password: 
ok
test purge                    ... Password: 
ok
test backup                   ... Password: 
ok
test backup_management        ... Password: 
ok
test restore                  ... Password: 
ok
test restore_checksum         ... Password: 
ok
test backup_from_standby      ... Password: 
ok
test arc_srv_log_management   ... Password: 
ok

======================
 All 11 tests passed. 
======================

  

安装参考:https://yq.aliyun.com/articles/691338

转载于:https://www.cnblogs.com/caidingyu/p/11510833.html

你可能感兴趣的:(记录一次编译安装Pg_rman缺少依赖包的问题)