• 记录一次编译安装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

  • 相关阅读:
    VS Code 快捷键(中英文对照版)
    一些网络资源
    VS Code插件
    Angular for TypeScript 语法快速指南 (基于2.0.0版本)
    Angular2 中的依赖包详解
    《ECMAScript 6 入门》阮一峰
    《JavaScript 标准参考教程》阮一峰
    Angular内提供了一个可以快速建立测试用web服务的方法:内存 (in-memory) 服务器
    由angular命令行工具(angular-cli)生成的目录和文件
    Angular 4.x 修仙之路
  • 原文地址:https://www.cnblogs.com/caidingyu/p/11510833.html
Copyright © 2020-2023  润新知