暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

PostgreSQL学习随笔3 pgadmin pgAgent安装部署

2445

引言

PostgreSQL没有自带job机制,但是可以通过pgAgent来实现该功能,在pgAdmin v1.9版本之前,pgAgent是其安装包的一部分,pgAdmin v1.9之后 pgAgent独立成一个单独的软件包。

部署

    安装cmake编译工具
    tar -zxvf cmake-3.11.0-rc1.tar.gz
    cd cmake-3.11.0-rc1/
    ./configure --prefix=/opt/cmake3.11
    gmake
    gmake install

    安装wxGTK
    yum -y install gtk2-devel binutils-devel
    tar -jxvf wxGTK-2.8.12.tar
    cd wxGTK-2.8.12/
    ./configure --enable-shared=no --enable-unicode=yes --prefix=/opt/wxGTK-2.8.12
    make
    make install

    配置环境变量
    cd ~
    vi .bash_profile
    export PATH=/opt/pgagent/bin:/opt/wxGTK-2.8.12/bin:/opt/cmake3.11/bin:/opt/pgsql101/bin:$PATH
    export LD_LIBRARY_PATH=/opt/wxGTK-2.8.12/lib:$LD_LIBRARY_PATH
    source .bash_profile

    编译安装pgAgent
    tar -zxvf pgAgent-3.2.1-Source.tar.gz
    cd pgAgent-3.2.1-Source/

    ccmake ./

    生成配置
    CMAKE_BUILD_TYPE
    CMAKE_INSTALL_PREFIX 修改为此项 opt/pgagent
    PG_CONFIG_PATH /opt/pgsql101/bin/pg_config
    STATIC_BUILD ON
    WX_CONFIG_PATH /opt/wxGTK-2.8.12/bin/wx-config
    WX_DEBUG OFF

    按c配置,然后按g产生配置    

    接下来就可以编译安装了
    make    
    make install
     
    su - pg10

    在本地库的postgres库中创建调度信息, 表, 函数 :
    psql -h 127.0.0.1 -p 5432 -U postgres -d postgres -f opt/pgagent/share/pgagent.sql
    复制


    参考

    https://www.pgadmin.org/docs/pgadmin4/1.x/pgagent.html

    https://wenku.baidu.com/view/45559dc16429647d27284b73f242336c1eb930f8.html

    http://blog.csdn.net/hai520ny/article/details/52439036


    文章转载自CP的PostgreSQL厨房,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

    评论